[R-sig-ME] effective sample size in MCMCglmm

Walid Crampton-Mawass w@||dm@w@@@10 @end|ng |rom gm@||@com
Tue Mar 23 19:41:45 CET 2021


Rechecking your model, I noticed you have set the burnin at 250000 and your
thin at 10000 which resulted in a very small sample size for your
estimates, meaning your posterior distribution is based on a very small
sample of saved iterations of the chain. The setting suggested is
burnin=2500000, thin=500000 (which means we end up with 2 million
iterations of the chain) and thin=2000 (this way we end up with a 1000
sample size which is acceptable, i.e. 2000000/2000).

Another suggestion would be to use expanded parameters for your priors to
better the convergence of the model. I can't specifically suggest to you
what prior to specify but reading the "Parameter-expanded priors" section
in the coursenotes of the MCMcglmm package by Hadfield (2010) would be a
good place to start.

Good luck
-- 
Walid Crampton-Mawass
Ph.D. candidate in Evolutionary Biology
Population Genetics Laboratory
University of Québec at Trois-Rivières
3351, boul. des Forges, C.P. 500
Trois-Rivières (Québec) G9A 5H7
Telephone: 819-376-5011 poste 3384


On Tue, Mar 23, 2021 at 12:57 PM Abraão de Barros Leite <abarrosib using gmail.com>
wrote:

> Unfortunately, I am able to have convergence in my model just with sample
> size = 200. This sample size is so bad?
>
> Thanks,
> Abraão
>
> Em ter, 23 de mar de 2021 13:21, Abraão de Barros Leite <
> abarrosib using gmail.com> escreveu:
>
>> Thanks, I will make these changes and monitor how the models will
>> converge.
>>
>> All the best,
>> Abraão
>>
>> Em ter, 23 de mar de 2021 12:42, Walid Crampton-Mawass <
>> walidmawass10 using gmail.com> escreveu:
>>
>>> Hello,
>>>
>>> Indeed there is very high autocorrelation in your animal term. And your
>>> scale seems to be quite large given the estimates and HPDs. A good step
>>> would be to scale down your continuous variables to see if that helps with
>>> convergence in any way. Another possible practice is to drop one of the
>>> random terms in your model to see how that changes the behavior of your
>>> model. A side note, in your prior, there is no need to add n=0.002 to your
>>> residual term since you already fixed it to 1.
>>>
>>> Good luck
>>> --
>>> Walid Crampton-Mawass
>>> Ph.D. candidate in Evolutionary Biology
>>> Population Genetics Laboratory
>>> University of Québec at Trois-Rivières
>>> 3351, boul. des Forges, C.P. 500
>>> Trois-Rivières (Québec) G9A 5H7
>>> Telephone: 819-376-5011 poste 3384
>>>
>>>
>>> On Mon, Mar 22, 2021 at 3:09 PM Abraão de Barros Leite <
>>> abarrosib using gmail.com> wrote:
>>>
>>>> Hello,  this is my script, and my dataset has 235 species.
>>>>
>>>> prior3.1 <- list(G = list(G1 = list(nu=0.002, V=1),G2 = list(nu=0.002,
>>>> V=1)),#fatores de variâncias a priori#
>>>>                  R = list( V=1,nu=0.002, fix=1))
>>>> m1<-MCMCglmm(progofic~1+Dieta+trafic+log(massakg)+endg,data=databird,
>>>> family="categorical",pedigree=contree,random=~animal+measureID,verbose = F,
>>>>          nitt=2500000,burnin=250000,thin=10000,prior =prior3.1)
>>>> summary(m1)
>>>> acf(m1$Sol[,1],lag.max =100)
>>>>
>>>> *Results:*
>>>>   Iterations = 250001:2490001
>>>>  Thinning interval  = 10000
>>>>  Sample size  = 225
>>>>
>>>>  DIC: 6.619977
>>>>
>>>>  G-structure:  ~animal
>>>>
>>>>        post.mean l-95% CI u-95% CI eff.samp
>>>> animal      7713    999.2    15303    10.58
>>>>
>>>>                ~measureID
>>>>
>>>>           post.mean  l-95% CI u-95% CI eff.samp
>>>> measureID     319.5 0.0005769     1505    81.04
>>>>
>>>>  R-structure:  ~units
>>>>
>>>>       post.mean l-95% CI u-95% CI eff.samp
>>>> units         1        1        1        0
>>>>
>>>>  Location effects: progofic ~ 1 + Dieta + trafic + log(massakg) + endg
>>>>
>>>>                    post.mean l-95% CI u-95% CI eff.samp  pMCMC
>>>> (Intercept)          -32.757 -127.914   59.857  152.759 0.4889
>>>> DietaInvertebrate    -73.571 -153.500   -4.571    9.841 0.0356 *
>>>> DietaNectarivorous  -156.649 -527.852  191.174    4.441 0.6489
>>>> DietaOmnivore         -6.580  -43.869   33.693   83.293 0.7644
>>>> DietaVert            -13.890  -87.780   73.738   62.163 0.8000
>>>> traficyes             -1.761  -30.506   31.131  102.410 0.8711
>>>> log(massakg)          25.917    6.443   43.469   18.590 <0.004 **
>>>> endgEN                -3.139  -42.611   37.907   25.394 0.8889
>>>> endgVU               -35.510  -73.109    1.471   24.992 0.0444 *
>>>> ---
>>>> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>>>> > acf(m1$Sol[,1],lag.max =100)
>>>> > autocorr(m1$VCV)
>>>> ,* , animal*
>>>>                animal    measureID units
>>>> Lag 0      1.00000000 -0.022820572   NaN
>>>> Lag 10000  0.80567811 -0.045602281   NaN
>>>> Lag 50000  0.58800623  0.037466483   NaN
>>>> Lag 1e+05  0.37539889  0.221289380   NaN
>>>> Lag 5e+05 -0.08870539 -0.005622699   NaN
>>>> ,* , measureID*
>>>>                 animal    measureID units
>>>> Lag 0     -0.022820572  1.000000000   NaN
>>>> Lag 10000 -0.004848064  0.369835208   NaN
>>>> Lag 50000 -0.052249906  0.006497318   NaN
>>>> Lag 1e+05 -0.053667796 -0.001787120   NaN
>>>> Lag 5e+05 -0.015126358 -0.027780522   NaN
>>>> ,* , units*
>>>>           animal measureID units
>>>> Lag 0        NaN       NaN   NaN
>>>> Lag 10000    NaN       NaN   NaN
>>>> Lag 50000    NaN       NaN   NaN
>>>> Lag 1e+05    NaN       NaN   NaN
>>>> Lag 5e+05    NaN       NaN   NaN
>>>>
>>>> Thanks,
>>>> Abraão
>>>> On Mon, Mar 22, 2021 at 3:32 PM Walid Crampton-Mawass <
>>>> walidmawass10 using gmail.com> wrote:
>>>>
>>>>> Yes possibly, or the sample size is too small for the model structure
>>>>> you are attempting. It would help if you share your model structure and
>>>>> results of autocorr() to check if autocorrelation between chain iterations
>>>>> is high.
>>>>>
>>>>> Additionally, when replying in this thread, use the reply all option
>>>>> so our thread and discussion is included in the r-sig archives.
>>>>> --
>>>>> Walid Crampton-Mawass
>>>>> Ph.D. candidate in Evolutionary Biology
>>>>> Population Genetics Laboratory
>>>>> University of Québec at Trois-Rivières
>>>>> 3351, boul. des Forges, C.P. 500
>>>>> Trois-Rivières (Québec) G9A 5H7
>>>>> Telephone: 819-376-5011 poste 3384
>>>>>
>>>>>
>>>>> On Mon, Mar 22, 2021 at 2:14 PM Abraão de Barros Leite <
>>>>> abarrosib using gmail.com> wrote:
>>>>>
>>>>>> Hello Walid, I used your thin, burnin, nitt values, the model arrived
>>>>>> sample size=1000, and there wasn't convergence still.
>>>>>> Do think if the problem is the priori values?
>>>>>>
>>>>>> Thanks,
>>>>>> Abraão
>>>>>>
>>>>>>
>>>>>> Em seg, 22 de mar de 2021 14:30, Walid Crampton-Mawass <
>>>>>> walidmawass10 using gmail.com> escreveu:
>>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>> One way to improve the convergence of your phylogenetic model would
>>>>>>> be to increase the burn in iterations of the chain and take it into account
>>>>>>> in your total number of iterations. So in your case, I would set
>>>>>>> nitt=2500000, burnin= 500000 and nitt=2000, that way you would have a
>>>>>>> sample of 1000 iterations saved from the total chain iterations (of course
>>>>>>> you can increase the thin interval based on the sample size of saved
>>>>>>> iterations you want).
>>>>>>>
>>>>>>> Good luck
>>>>>>> --
>>>>>>> Walid Crampton-Mawass
>>>>>>> Ph.D. candidate in Evolutionary Biology
>>>>>>> Population Genetics Laboratory
>>>>>>> University of Québec at Trois-Rivières
>>>>>>> 3351, boul. des Forges, C.P. 500
>>>>>>> Trois-Rivières (Québec) G9A 5H7
>>>>>>> Telephone: 819-376-5011 poste 3384
>>>>>>>
>>>>>>>
>>>>>>> On Mon, Mar 22, 2021 at 11:24 AM Abraão de Barros Leite <
>>>>>>> abarrosib using gmail.com> wrote:
>>>>>>>
>>>>>>>> Hello Mathew
>>>>>>>>  My name is Abraão, I saw your answer aboute MCMCGLMM sample size.
>>>>>>>> So, please can you help me?
>>>>>>>> I am working with relation between brain mass and nest birds in my
>>>>>>>> doctorate.
>>>>>>>> My dataset has 250 species, but in my analysis MCMCGLMM with
>>>>>>>> phylogenetic
>>>>>>>> control, I haven't convergence, with nitt=2000000, thin=3500,
>>>>>>>> burnin=4000.
>>>>>>>> Please, can you help me?
>>>>>>>> How I can to improve my convergence?
>>>>>>>> Sample size=100 in the end it's ok?
>>>>>>>> Thanks!
>>>>>>>>
>>>>>>>>         [[alternative HTML version deleted]]
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> R-sig-mixed-models using r-project.org mailing list
>>>>>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>>>>>>>>
>>>>>>>
>>>>
>>>> --
>>>> Abraão de Barros Leite
>>>> Universidade Federal de São Carlos (UFSCAR)
>>>> Programa de Pós-Graduação em Ecologia e Recursos Naturais- São Carlos
>>>> (PPGERN)
>>>>
>>>

	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list