informative priorParam in random slope
Posted: Mon Jun 13, 2022 10:06 am
I'm trying to run a random slope model with MCMC estimation:
However, the model won't converge because the 'prior variance matrix is not positive definite'. This is because variance and covariance in the matrix from the IGLS is 0.0000. While I'm not expecting variance at this level, I would still like to run the MCMC estimation and get the results from the MCMC estimation model. This is for the sake of reporting comparable results rather than reporting non-convergence or just the IGLS estimation results (I'm running a series of related models with some converging and getting very low variance (<0.1) and others failing because of the 0 variance in IGLS).
To achieve this I believe I can set some informative prior (say variance = 0.001) to get the chains going in the first place.
My best shot was:
How does the code look setting the priorParam estimate option?
Many thanks
Code: Select all
runMLwiN(outcome ~ 1 + lev1_var + (1 + lev1_var | group_ID) + (1 | individual_ID), data = data, estoptions = list(EstM = 1, mcmcMeth = list(burnin = 500))
To achieve this I believe I can set some informative prior (say variance = 0.001) to get the chains going in the first place.
My best shot was:
Code: Select all
estoptions = list(EstM = 1, mcmcMeth = list(burnin = 500, priorParam = list(rp2 = list("RP2_cov_Intercept_lev1_var" = c(estimate = 0.001, size = 500), "RP2_var_lev1_var" = c(estimate = 0.001, size = 500) ) )
Many thanks