[R-sig-ME] glmm with correlated residuals
Joshua Wiley
jwiley.psych at gmail.com
Thu Dec 20 20:51:10 CET 2012
Hi Emilio,
Hmm, well correlated/heterogeneous residuals is relatively easy, but
the ar1 aspect turned out to be less straightforward than I thought.
I could not find an exact example (with a few quick searches), but you
can basically specify any matrix you want for the R matrix.
I have not given this much thought, but I think I would first try a
strong prior that the matrix would be ar1, but I do not know that I
would worry about enforcing that in the posterior.
Here is an example with spatial autocorrelation:
http://permalink.gmane.org/gmane.comp.lang.r.lme4.devel/8746
It will help to be facile with matrix algebra. In principle it should
be doable but may be rather tricky to specify exactly.
If you find a solution, would be great if you post back to the list
for future reference.
Cheers,
Josh
On Thu, Dec 20, 2012 at 11:39 AM, Emilio A. Laca <ealaca at ucdavis.edu> wrote:
> Josh,
> I appreciate your reply. Indeed the Course Notes by J. Hadfield are excellent.
>
> However, I have been unable to find an example to guide me in the construction/specification of the R matrix. I assume that the structure is declared in the code part that assigns the priors. I can define an ar(1) matrix, but I am not sure how to incorporate the fact that there are repeated measurements over time in >30 subjects.
>
> Should R be a nxn matrix with (identical) non-zero blocks for each individual, or a single (n/30)x(n/30) matrix with some code to indicate that it is used for each individual?
> I have searched the March 2012 course notes (for a total of ~2 hours), but I may have missed the relevant part.
> Many thanks again,
>
> Emilio
>
>
> On Dec 20, 2012, at 11:15 AM, Joshua Wiley <jwiley.psych at gmail.com> wrote:
>
> Hi Emilio,
>
> I would suggest doing it in MCMCglmm. It can handle residual
> structures too. This is a nice starting guide:
> http://cran.r-project.org/web/packages/MCMCglmm/vignettes/CourseNotes.pdf
>
> Cheers,
>
> Josh
>
> On Thu, Dec 20, 2012 at 8:37 AM, Emilio A. Laca <ealaca at ucdavis.edu> wrote:
>> Fellow R users,
>>
>> what package would you recommend for fitting a poisson glmm with one random effect and residuals that are correlated (most likely AR(1)) and have heterogeneity of variance?
>>
>> I have successfully fitted the model without addressing the structured residuals in MCMCglmm.
>>
>> I would appreciate it very much if you could point me in the direction of an example.
>>
>> Emilio A. Laca, Professor
>> Department of Plant Sciences, MS 1
>> University of California, Davis
>> One Shields Ave.
>> Davis, CA 95616
>> ealaca at ucdavis.edu (530) 754-4083
>>
>> _______________________________________________
>> R-sig-mixed-models at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
>
>
> --
> Joshua Wiley
> Ph.D. Student, Health Psychology
> Programmer Analyst II, Statistical Consulting Group
> University of California, Los Angeles
> https://joshuawiley.com/
>
--
Joshua Wiley
Ph.D. Student, Health Psychology
Programmer Analyst II, Statistical Consulting Group
University of California, Los Angeles
https://joshuawiley.com/
More information about the R-sig-mixed-models
mailing list