nutterb / HydeNet

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

Bug in setNode() - parameter value check for univ distributions #5

Closed jdutch27 closed 9 years ago

jdutch27 commented 9 years ago

net <- setNode(net, d.dimer, nodeType = "dpois", lambda=-10)

This should return an error message like the following:

paste0("Node '", node, "': parameter '", bad.param,"' outside allowable range in '", nodeDist,"' (",jagsDists$paramLimit[jagsDists$FnName==nodeDist],")")

nutterb commented 9 years ago

I incorporated a new function validateParameters to take care of this. It also required an additional column in the jagsDists data object which gives the R logic to validate the parameter.

It's a wicked slick implementation, if I do say so myself.