[R-sig-ME] fixed effects (co)variance matrix from MCMCglmm
Jarrod Hadfield
j.hadfield at ed.ac.uk
Mon Nov 19 16:18:43 CET 2012
Hi,
Sorry - I made a typo too:
sqrt(diag(v))/nrow(model$Sol) should read sqrt(diag(v)/nrow(model$Sol))
Cheers,
Jarrod
Quoting Jarrod Hadfield <j.hadfield at ed.ac.uk> on Mon, 19 Nov 2012
15:09:34 +0000:
> Hi,
>
> sqrt(diag(v)) should give the posterior standard deviations (akin to
> the standard errors)
>
> sqrt(diag(v))/nrow(model$Sol) gives the standard error on the
> posterior mean given independence of the stored MCMC samples. Its a
> measure of the Monte Carlo error due to finite chain length.
>
> Cheers,
>
> Jarrod.
>
>
>
>
>
> Quoting Ben Bolker <bbolker at gmail.com> on Mon, 19 Nov 2012 14:58:37
> +0000 (UTC):
>
>> Katie Colborn <benton at ...> writes:
>>
>>>
>>> Hi:
>>>
>>> How do I obtain the variances (and covariances) for the fixed effects
>>> from an MCMCglmm object? In a
>>> frequentist setting I would simply use algebra to obtain it from
>>> the confidence intervals if it was not
>>> provided; however, I'm not sure if this is equivalent in
>>> Bayesian credible intervals. Is it as simple as:
>>>
>>> coeff - 1.96*SE = lower 95% CI?
>>>
>>> Or is it sd(model$Sol)[1:3]?
>>>
>>> If you solve for SE in the equation above it is
>>> not equal to sd(model$Sol) (even after dividing by root n).
>>> Thanks for your help!
>>>
>>
>> You have to be careful to distinguish between the standard deviation
>> and the standard error in this case, and to be aware that the posterior
>> distributions may not be multivariate normal.
>>
>> *If* the posteriors are multivariate normal, then
>>
>> v <- var(model$Sol) should give the variance-covariance matrix,
>>
>> and sqrt(diag(v)/nrow(model$Sol)) should give the standard errors.
>>
>> If they're not multivariate normal (or at least if the marginal
>> posteriors aren't normal) then the credible intervals won't line
>> up with +/- 1.96*SE ...
>>
>> If in doubt, take a look at some density plots and scatterplots
>> of the posterior densities to get a better sense of what's going on.
>>
>> _______________________________________________
>> 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.
>
> _______________________________________________
> 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