-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Passing multiple model objects to setNode (+ Issue #6) #7
Comments
I think I might be more comfortable with this as a separate function. This proposal seems like the user is providing the information as several nodes at once. It's a great idea, and can be done, but I might suggest something more like net <- setNodeModels(lm(wells ~ 1, data=d2),
glm(pregnant ~ 1, family=binomial, data=d1)) This may require an additional element for each node, if we are going to accept the possibility of differing data objects for each model. But if |
Agreed to have separate functions. |
See Issue #20 . We may consider doing the above but for single nodes, using an adaptation of modelToNode(). |
|
In Issue #6 (get node distn from model object) I assumed only a single model object.
Maybe the modelObjects parameter should be a list of model objects instead of a single model object.
Here's what I think the user should be able to do.
mod.pe <- glm(pe ~ wells, family="binomial", data=d1)
mod.d.dimer <- lm(d.dimer ~ pregnant_pe, data=d2)
mod.angio <- glm(angio ~ pe, family="binomial", data=d1)
mod.treat <- glm(treat~ d.dimer_angio, family="binomial", data=d3)
mod.death <- glm(death ~ pe*treat, family="binomial", data=d2)
my.models <- list(mod.pe, mod.d.dimer, mod.angio, mod.treat, mod.death)
net <- HydeNetwork(~ wells
+ pe | wells
+ d.dimer | pregnant_pe
+ angio | pe
+ treat | d.dimer_angio
+ death | pe*treat)
net <- setNode(net, modelObjects = my.models)
net <- setNode(net, wells, "dnorm", mu=5, tau=1/(1.5^2))
net <- setNode(net, pregnant, "dbern", p=0.10)
**Even better:
my.models <- c(my.models, lm(wells ~ 1, data=d2), glm(pregnant ~ 1, family="binomial", data=d1))
net <- HydeNetwork(modelObjects = my.models)
The text was updated successfully, but these errors were encountered: