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

Is there a way to access individual model errors? #54

Open
jonathon-love opened this issue Feb 23, 2015 · 5 comments
Open

Is there a way to access individual model errors? #54

jonathon-love opened this issue Feb 23, 2015 · 5 comments

Comments

@jonathon-love
Copy link
Contributor

Hi,

When we run multiple models, some of them can fail. An error is produces at the console, but we would like to have access to this information as well. Take the following code for example:

library(BayesFactor)
z <- y <- c(0,0,0,1,1,1)
x <- rnorm(6)
data <- data.frame(x=x,y=y,z=z)

generalTestBF(z~x*y,data,progress=FALSE)

It produces some NaN BFs, but we would like to provide explanations to the user why these models failed. Is there a way to access this? if not, could these errors be added to the individual BF objects?

with thanks

@jonathon-love
Copy link
Contributor Author

hey,

@mmarsman1 and i have been discussing this, and i think we're going to transition to calling lmBF() directly, rather than calling generalTestBF()

so perhaps it would be simpler if lmBF() just threw an error, and we could catch that for each model.

@richarddmorey
Copy link
Owner

Well, lmBF in turn calls one of many functions, depending on the kind of model involved. I think you'll have the same issue one level deeper. I'll have a think about this.

@jonathon-love
Copy link
Contributor Author

yup,

so i gather you catch and handle errors in these underlying functions so that if one model fails, all the other models in the analysis continue to run.

wouldn't this be best if error handling happened at the level of generalTestBF()? lmBF() could throw errors, and generalTestBF() could catch them.

this way you achieve the same functionality, but allow people who call lmBF() the opportunity to access the error information.

of course, my reading of how this all works might be neive.

@richarddmorey
Copy link
Owner

I'll see what I can do.

@jonathon-love
Copy link
Contributor Author

cheers

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