nutterb / HydeNet

Hybrid Decision Networks in R
Other
23 stars 3 forks source link

factorRef and objects of class 'cpt' #69

Closed jarrod-dalton closed 9 years ago

jarrod-dalton commented 9 years ago

I noticed that we haven't tracked the factor levels for objects of class cpt within compileJagsModel() and compileDecisionModel(). For each cpt node, we'll need to create a list element in compiledHydeNetworkObject$factorRef that contains these factor codings.

nutterb commented 9 years ago

I'm going to have to think on this one a little bit. cpt coerces everything to a factor, so if you pass numeric values to cpt, they won't get mapped in the factorRefs because they don't appear in network$data as factors. But, theoretically, they should still pass to JAGS just fine as numerics. This is something I'll have to play with and come up with some options to present.

nutterb commented 9 years ago

Upon inspection, I found all kinds of flaws with this. The factorRef object only incorporated factors in the global data element, but wouldn't address anything in the node-specific nodeData element. This has been resolved, streamlined, and incorporates cpt as well.