[R-sig-ME] Undefined R-structure MCMCglmm
Jarrod Hadfield
j.hadfield at ed.ac.uk
Mon Jul 20 10:20:11 CEST 2009
Hi Chris,
Zip models are essentially bivariate in MCMCglmm with the first
"trait" being the poisson part and the second "trait" the zero-
inflation part. An appropriate models would be something of the form:
fit1 <- MCMCglmm(sus ~ trait + trait:ethnic + trait:sped + trait:ell +
trait:risk + trait:male + trait:grade-1, random=~us(trait):id.f,
rcov~idh(trait):units, data=enroll.long.m, verbose=TRUE, DIC=TRUE,
family="zipoisson")
This model is probably the least parsimonious model. Each fixed effect
can have an effect on the zero-inflation and the poisson process
(hence the interaction with trait) and there are separate id.f random
effects for each process with the covariance estimated. Because there
is no information to estimate this covariance within a data point I
usually set it to zero using the idh(...) structure. Moreover, the
residual variance of the zero-inflation cannot be estimated as in
standard binary analyses so it should be fixed (I fix at 1 usually).
The appropriate prior in this case would be something like
prior=list(R=list(V=matrix(V=diag(c(v1, 1)), fix=2, n=2),
G=list(G1=list(V=V2, n=2)))
where v1 is the prior for the Poisson over-dispersion, and V2 is a 2x2
matrix specifying the covariance matrix for id.f.
You may also want to consider not having a random effect for the zero
inflation, but only for the Poisson part, in which case you can set
this value close to zero.
prior=list(R=list(V=matrix(V=diag(c(v1, 1)), fix=2, n=2),
G=list(G1=list(V=diag(c(v2, 1e-10)), n=2)))
where v2 is now the id.f variance component for the Poisson part.
Note, you cannot do this for the residual variance or the chain will
not mix.
You can also do the same for the fixed effects by placing strong
priors around zero for the zero-inflation coefficients.
Typically ZIP and high dimensional multinomial models are the hardest
to fit, and mixing may be a problem. Specifying pl=TRUE and looking at
the posterior traces of the latent variables can often be a better
indicator of problem than looking at the traces of the fixed effects
and variance components. I usually see problems with zip mdoels when
the mean of the Poisson process is so high that zero's are not
expected from the Poisson process alone.
I'd be interested to know how you get on.
Cheers,
Jarrod
On 19 Jul 2009, at 23:38, Christopher David Desjardins wrote:
> Hi,
> I am getting the following error when fitting a zip model in MCMCglmm.
>
> > fit1 <- MCMCglmm(sus ~ 1 + ethnic + sped + ell + risk + male +
> grade, random=~id.f, data=enroll.long.m, verbose=TRUE, DIC=TRUE,
> family="zipoisson") # Random intercept only model
> Error in MCMCglmm(sus ~ 1 + ethnic + sped + ell + risk + male +
> grade, :
> R-structure does not define unique residual for each data point
>
> I was able to run fit a poisson model but my data is zero-inflated.
>
> Thanks,
> Chris
>
> --
> Christopher David Desjardins
> Ph.D. Student
> Quantitative Methods in Education
> Department of Educational Psychology
> University of Minnesota
> http://cddesjardins.wordpress.com/
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
More information about the R-sig-mixed-models
mailing list