[R-sig-ME] Cross Validation - Poisson Models - MCMCglmm package

Jarrod Hadfield j.hadfield at ed.ac.uk
Sat Aug 27 13:48:17 CEST 2011


Hi,

Quoting Denise Rocha <d.ayres at ig.com.br> on Fri, 26 Aug 2011 09:50:58 -0400:

> Hi,
>
> I am trying to do a Cross Validation of Poisson models adjusted by MCMCglmm
> package. Data were split randomly into three disjoint folds.
> Using, for example, folds 1 and 2 for training, now I would like to predict
> observations on fold 3.
> I have some doubts about MCMCglmm:
>
> First: Solutions for fixed and random effects are in the log scale, am I
> correct? How can I obtain them on the response scale?
> Solution_Response_scale = exp(Solution_log_scale) ?

This will return the posterior mode, for the mean you need to add v/2  
to the solution and then exponentiation. v is the variance of the  
(random) effects you want to average over (perhaps just the residual  
term).

>
> Second: I saw that the first level of each fixed effect does not appear on
> "model$Sol". Was this level`s solution setted to 0 and the others expressed
> as deviation of it? How can I deal with this when predicting observations?

Depending on how the contrasts are set up the intercept term usually  
relates to the first level(s) of categorical predictors.
>
> Third: When my observations have 0 as a response, how does the MCMCglmm deal
> with it when it does log(observation)?

GLMs are not logging the response, but modeling the expected value of  
the response conditional on the data/parameters. i.e E[y|X,b] =  
exp(Xb). E[y|X, b] is rarely predicted to be zero - see some of John  
Maindonalds post's on the Hauck-Donner effect for counter examples.

Chapter 2 of the CourseNotes, and many books on R and glm cover these topics.

Cheers,

Jarrod

>
>
> --
> *Denise*
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> 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