Carlo Fezzi (ENV <C.Fezzi <at> uea.ac.uk> writes:

> 
> Dear all,
> 
> I am writing an R code to fit a Bayesian mixed logit (BML) via MCMC / MH
algorithms following Train (2009, ch. 12).
> 
> Unfortunately, after many draws the covariance matrix 
> of the correlated random parameters tend to become
> a matrix with almost perfect correlation, so I think
>  there is a bug in the code I wrote but I do not seem to be
> able to find it.. dull I know.
> 
> Has anybody written a code for BML with R and would like to share it with me
or even take a quick look at my code? I
> would be extremely grateful for any help.

(1) maybe better at r-sig-mixed-mod...@r-project.org
(2) are you trying this on real, or on simulated data? The collapse
of the covariance matrix in this way is a very common symptom of
overfitting/underidentification in mixed models.  I wouldn't say
it necessarily constitutes a bug in your code.  In principle you
should be able to get an uncorrelated answer if you use a big enough,
sufficiently well-behaved simulated data set, but not necessarily 
for real data ...
(3) have you tried the MCMCglmm package, which is a very fast and
flexible MCMC-based approach to GLMMs?

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to