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

Extract model parameters from dmod() #1

Open
DavorJ opened this issue Oct 9, 2019 · 0 comments
Open

Extract model parameters from dmod() #1

DavorJ opened this issue Oct 9, 2019 · 0 comments

Comments

@DavorJ
Copy link

DavorJ commented Oct 9, 2019

Great package Soren! And here comes the first issue:

I am mainly interested in the specification and parameters of the joint probability function of the best (gRim::stepwise.iModel) log-linear model. (I need the join probability function p(i) for later use.)

It seems impossible to get the parameters of the log-linear model from dModel returned by dmod()? As far as I see, dmod() calls fit.dModel() which in turn calls loglin().

loglin() has an argument param = FALSE. Would it be possible to set param = TRUE in fit.dModel() without breaking stuff?

Or am I seeing it wrong and is there a better way to extract the model specification?

Edit:

Parameters can be extracted from best model m.opt with the following code:
loglin(table = m.opt$datainfo$data, margin = m.opt$glist, param = TRUE)$param

Obviously it introduces extra computation, but works.

Now I am looking for a way to define log(p(i)). Would gRbase be the correct place for such a function? Input would be a dModel object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant