Closed jburos closed 7 years ago
Problem appears to occur on lines 66-67 of stanjm.R, which read:
y_eta <- lapply(1:M, function(m) linear_predictor.default(y_coefs[[m]], object$x[[m]], object$offset))
y_mu <- lapply(1:M, function(m) object$family[[m]]$linkinv(y_eta[[m]]))
At this point in the code, the value of object$x[[m]]
is NULL; thus y_eta
is a char(0)
This appears to be the same value that returns for all stan_jm
fits, including guassian family for example. But in this case the linkinv function on the 0-valued y_eta is problematic.
For now I'm planning to skip this & replace y_mu with a NULL value in order to avoid this problem.
Yeah, I think I'm just going to remove eta/mu/residuals from the stanjm object, at least for now.
I had stopped returning X and Z as part of the fitted model, since there isn't just one design matrix, since fitting the model requires the design matrices evaluated at the quadrature points as well. So, I thought for the moment it is better to avoid confusing the user by not returning any design matrices rather than returning all the design matrices.
I guess we can always choose to add them onto the model object at a later date, but for now I think it is better to keep it cleaner and simpler.
Let me know if you think otherwise!
If, later on, we choose to return X and Z as part of the fitted model, then we can easily add eta/mu/residuals back onto the returned object too.
Summary:
Running into the following error when estimating a model with binary longitudinal biomarkers:
This error occurs at the end of the MCMC sampling, and seems to occur whether or not the model samples well.
Reproducible Steps:
For example, testing on simulated data:
RStanARM Version:
Here still using my fork of rstanarm, as follows:
I will test on a clean install of
develop2
branch & post results here.R Version: