Skip to content
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

Get Node Distributions from Model Object #6

Closed
jdutch27 opened this issue Feb 15, 2015 · 1 comment
Closed

Get Node Distributions from Model Object #6

jdutch27 opened this issue Feb 15, 2015 · 1 comment

Comments

@jdutch27
Copy link
Collaborator

Within setNode(), we could have a new parameter called modelObject.


Error Checking:

Logic/error checking to ensure class(modelObject) %in% c("lm","glm","multinom",<any others?>)

Logic/error checking to ensure all variables showing up in model equation actually are parents of the node in the graph. Something like:

length(setdiff(setdiff(names(modelObject$model), node), parents("d.dimer", net$dag))) == 0

But need to be careful that modelObject$model exists for all types of allowable model classes.

A good test would be to try to do a spline model (e.g., y ~ bs(x1, df=5))


Behavior (pseudocode):

modelType <- class(modelObject)

if(modelType)=="lm" {
nodeType <- "dnorm";
nodeFormula <- [ extract fitted regression equation from modelObject ]
} else if(modelType == "glm") {
nodeType <- [logic to see which family was used for the glm]
[behavior slightly varies depending on nodeType - may or may not need to specify error distribution]
} else {
nodeType <- "dcat";
[ set multinomial logistic regression equations using the multinom object ]
}

@nutterb
Copy link
Owner

nutterb commented Feb 20, 2015

Implemented on 20 Feb 2015

@nutterb nutterb closed this as completed Feb 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants