[R-sig-ME] MCMCglmm solutions vs quantiles
Steve Candy
burwood70 at gmail.com
Mon Mar 19 07:43:24 CET 2018
Hi All
I am trying to replicate the summary statistics for an MCMCglmm object by
using the posterior samples directly (I want to do further manipulations of
these samples so thus my reason for doing this).
I have tried all 9 "types" for the quantile function applied to the
posterior sample but cannot replicate either l-95% CI or u-95% CI from
summary(m5d.1$Sol) using quantile(x=m5d.1$Sol[, 5], probs=c(0.025,0.975),
type=i) (see below). The results for one parameter and the l-95% CI are
close but not identical, whereas the means from the summary and the means of
the posterior samples are identical. I would also like to know how the
probability (pMCMC) is calculated. I did a simple two-sided test using the
posterior sample and get close to but not identical values. I looked through
the documentation but could not find any help on these two issues.
Thanks for any help
Steve
> m5d.1 <- MCMCglmm(OthSpecies_set ~ trait - 1 + at.level(trait,1):LnHooks +
at.level(trait,1):Device_fac,
+ rcov = ~idh(trait):units, random=~idh(trait):Trip_fac,
data=data.counts.DevandNonD,
+ nitt=700000, thin=250, burnin=200000, prior = prior1, family =
"zipoisson", verbose = FALSE)
> summary(m5d.1)
.
> MCMC_Lq <- unlist(summary(m5d.1)["solutions"])[13]
> for (i in (1:9)) {
+ q25 <- quantile(x=m5d.1$Sol[, 5], probs=c(0.025), type=i)
+ qdif <- q25-MCMC_Lq
+ print(c(i,qdif,q25,MCMC_Lq)) }
2.5% 2.5% solutions13
1.000000000 0.004817471 0.128636776 0.123819305
2.5% 2.5% solutions13
2.000000000 0.006845887 0.130665191 0.123819305
2.5% 2.5% solutions13
3.000000000 0.004817471 0.128636776 0.123819305
2.5% 2.5% solutions13
4.000000000 0.004817471 0.128636776 0.123819305
2.5% 2.5% solutions13
5.000000000 0.006845887 0.130665191 0.123819305
2.5% 2.5% solutions13
6.000000000 0.004918892 0.128738197 0.123819305
2.5% 2.5% solutions13
7.000000000 0.008772881 0.132592186 0.123819305
2.5% 2.5% solutions13
8.000000000 0.006203555 0.130022860 0.123819305
2.5% 2.5% solutions13
9.000000000 0.006364138 0.130183443 0.123819305
Dr Steven G. Candy
Director/Consultant
SCANDY STATISTICAL MODELLING PTY LTD
(ABN: 83 601 268 419)
70 Burwood Drive
Blackmans Bay, TASMANIA, Australia 7052
Mobile: (61) 0439284983
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models
mailing list