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

error-adding-loo-criterion-to-brms-ordinal-model-with-link-cloglog #1192

Closed
groceryheist opened this issue Jun 24, 2021 · 5 comments
Closed

Comments

@groceryheist
Copy link

https://discourse.mc-stan.org/t/error-adding-loo-criterion-to-brms-ordinal-model-with-link-cloglog/22600

The model looks fine but when I try to add loo or waic criterion I get the error
validate_ll(x) : All input values must be finite

I'm not convinced that the cloglog link is appropriate. I get fairly good results using the 'logit' link. The data are very skewed so I was hoping to check. I'm fairly confident that the sratio model is a good model of the data generating process.

df <- read.csv("test_error_validate_ll_ordinal.csv")
df[,'wp10'] <- factor(df[,'wp10'],levels=c("stub",'start','c','b','ga','fa'),ordered=T)
fam.cloglog <- sratio(link='cloglog', threshold='flexible')
formula <- brmsformula(wp10 | weights(weight) ~  Stub + Start + B + FA + GA, decomp='QR',center=TRUE)
mod <- brm(formula=formula.main.noC, data=df, family=fam.cloglog)
mod <- add_criterion(model.main.noC.cloglog,'loo')

I have uploaded my dataset (n=2000, 258kb) here: https://teblunthuis.cc/outgoing/test_error_validate_ll_ordinal.csv

  • Operating System: centos 7.6.1810
  • brms Version: 2.15.0

Thank you so much for the help!

@paul-buerkner
Copy link
Owner

I think we need to compute things on the log-scale in the post-processing as is done already on the Stan side of brms.

@paul-buerkner paul-buerkner added this to the brms 2.16.0++ milestone Aug 26, 2021
@fweber144
Copy link
Contributor

Paul asked me to take a look at this, but it seems the link for the data is dead. Could you provide a new one?

@groceryheist
Copy link
Author

I restored the original link. Thank you for looking into this!

@fweber144
Copy link
Contributor

I took a look at this, but it seems like the issue is not caused by code introduced by my PRs. Nevertheless, I have discussed possible solutions with Paul. Perhaps one of them works.

paul-buerkner added a commit that referenced this issue Apr 8, 2022
@paul-buerkner
Copy link
Owner

This should now be fixed on github :-)

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

3 participants