Bayesian longitudinal models using additive GPs including uncertainty in disease effect times and heterogeneous effects by @jtimonen, Henrik Mannerström, I and Harri Lähdesmäki.
A nice example of a R package created with the new version of rstantools. I would have liked to see unit tests of the Stan functions with rstan::expose_stan_functions. We do it in rstanarm at
Thanks for pointing out the tests of rstanarm @bgoodri. At some point I actually tried to include some stan functions into parts of the postprocessing functionality using rstan::expose_stan_functions, so that I could avoid code duplication (same function coded both in r and stan). However, I couldn’t get that to work without R CMD check warnings/notes, if I remember correctly. But I could try adding some unit tests following the rstanarm example.
I have a branch for rstantools that somewhat facilitates having the user-defined Stan functions be C++ functions that are exported into the package’s namespace by the usual Rcpp mechanism. Except the usual Rcpp mechanism does not quite work so it requires some manual editing.
Do you know what is causing this installation issue on Windows? I think the package has the default Makevars created by rstantools, so is the problem in the user’s personal toolchain?
Hi,
Do you think I can adapt his for longitudinal data for an ordinal response?
This is the model and I uploaded a simulated data. I want to estimate the effect of sev_h on bod for each individual over time(age). Similar to your paper, not every one experience the disease effect. I am not sure what family is suitable her. I was using cumulative. Thanks
phear<-get_prior( bodn~ sev_h+sex+age+sex*age+sev_h*age+sev_h*id,,family=???(),
data =test_lgpr)
fit_hearing1<-brm(
formula = bodn~ sev_h+sex+age+sex*age+sev_h*age+sev_h*id,family=???(),
data =test_lgpr,prior=phear, chains=5,cores=future::availableCores())
````[test_lgpr.csv|attachment](upload://jXQHtXMhAX03aeOcv8HizWSTjZj.csv) (3.0 KB)
It would probably need some modifications. At least the thresholds would need to be added as additional parameters. But I don’t know what kind of likelihood to use for ordinal response. If you can explain the model that you want exactly, then I can possibly implement it.
I did follow the instruction. This is not lgpr package, I had the same issue with brms. I uninstalled Rtools, and when ran the program asked me to install the required packages and I clicked “yes”. But, every time it keeps asking that even after installing Rtool3.5. I have not been able to resolve this on windows, so far!
I created a branch where I implemented the ordinal observation model using ordered_probit_lpmf. It is a quick initial version and I am not sure if is correct and at least needs some way of determining the noise proportion before it can be merged to master. Here is an example notebook how to use it with the current version:
And if this is correct, then yes you could use also the disease effect modeling for ordinal response. I can help better if you describe your data and the model that you want to have.
Awsome! Thanks a lot. I use it and let you know . I tried to download lgpr but still because of Rtools have issues on my computer. I try to get it downloaded on virtual machine on Monday and will let you know the results. I want to be able to know in which individuals the disease levels does not affect the response (outcome). If I can distinguish this, it would be great.
I let you know. Thanks again.