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
Difficulty with specification of random (linear) effects in nonlinear models. #46
Comments
The last error you encountered appears to be a bug in the formula parsing. I will try to fix this later on today. The moment you use the My suggestion would be to write the model as follows: formula = log(Duree) ~ b0 + b1*Classe + b2*Arcade + b3*ReTt + b4*NoTf + b5*NoWO + log(km+(1-km)*exp(-betaExp*Exp))
nonlinear = list(b0 ~ (1|Etudiant), b1 ~ 1, b2 ~ 1, b3 ~ 1, b4 ~ 1, b5 ~ 1, km ~ 1, betaExp ~ 1) Don't forget to set priors on all non-linear parameters. However, this won't work until I fixed the formula parsing. I will write again as soon as I have fixed it |
Le dimanche 21 février 2016 à 06:34 -0800, Paul-Christian Bürkner a
|
You are right, the documentation needs some improvements here. All formulas in The way I wouldn't call it a mini-language, but rather an explicit way of writing a model. You cannot treat parts of the formula as usual and the other as "non-linear". If you look at the Stan code via Currently, a 3-level factor will not be allowed in a non-linear formula (you will recieve an error message before the model is compiled), but it's allowed to put it in In fact, as I think about it, you can greatly simplify your model by writing: formula = log(Duree) ~ b + log(km+(1-km)*exp(-betaExp*Exp))
nonlinear = list(b ~ Classe+Arcade+ReTt+NoTf+NoWO+(1|Etudiant), km ~ 1, betaExp ~ 1) Your linear predictor will be plugged in for |
The fix for the formula parsing issue is now on github. You can install the latest dev version of brms via library(devtools)
install_github("paul-buerkner/brms") Hopefully, this will allow your model to be fitted. |
[ Sorry for tjhe (non-maskable) interruption : RealLife(TM) happens... Again, thank you very much !Emmanuel Charpentier
|
Ok great! The documentation will be improved with the next version. Also, I am currently writing a vignette about non-linear models (see #37). Thanks for opening this issue and helping me to improve brms! |
I have trouble unterstanding how to add a nonlinear effect to an (already working) mixed linear model.
Working example : this compiles and gives sensible results :
First attempt :
Well... second attempt :
Ah.
Added an "Intercept" column of ones to the dataset. Then :
And I'm stuck... The error seems unrelated to the previous errors, but I'm not sure.
Any ideas ?
The text was updated successfully, but these errors were encountered: