[R-sig-ME] MCMC fitting in glmmADMB

maren maren.rebke at avitec-research.de
Mon Oct 20 10:58:33 CEST 2014


Thank you very much for your suggestion, Ben. Saving only a thinned 
sequence will of course reduce the size of the stored data file. I was 
using that option already in the analysis of my own data, but maybe I 
just have to choose larger intervals.

 From your reply I assume that it is not easily possible to store only 
the samples of the estimates for certain parameters (i.e. don’t save 
u.01-u.27 in the owl example), define a burn-in period or play around 
with the jump size. Or were my questions not clear enough?

Best wishes,

Maren


Am 18.10.2014 17:23, schrieb Ben Bolker:
>   You can use mcmcControl(mcsave=...), as illustrated below.
>
> library("glmmADMB")
>
> om <- glmmadmb(SiblingNegotiation~FoodTreatment*SexParent+
>                 (1|Nest)+offset(log(BroodSize)),
>                zeroInflation=TRUE,family="nbinom",data=Owls,
>                mcmc=TRUE,
>                mcmc.opts=mcmcControl(mcmc=200))
> nrow(om$mcmc) ## 20
>
> om2 <- glmmadmb(SiblingNegotiation~FoodTreatment*SexParent+
>                 (1|Nest)+offset(log(BroodSize)),
>                zeroInflation=TRUE,family="nbinom",data=Owls,
>                mcmc=TRUE,
>                mcmc.opts=mcmcControl(mcmc=200,mcsave=20))
> nrow(om2$mcmc)  ## 10
>
>
> On Thu, Oct 16, 2014 at 7:18 AM, maren <maren.rebke at avitec-research.de 
> <mailto:maren.rebke at avitec-research.de>> wrote:
>
>     Hi,
>
>     I fit a zero-inflated Poisson model with random effects using the
>     package glmmADMB, which worked perfectly well. Now I am trying to get
>     credible intervals by running a Markov chain using mcmc=TRUE,
>     which also
>     works fine in general.
>
>     The problem is, that I have many parameters as well as several random
>     effects in my model and it seems that I need to run long chains to get
>     proper estimates. Therefore the automatically stored file eventually
>     gets very big and my computer cannot handle it anymore. Therefore I
>     would like to store only the samples of the estimates for the fixed
>     effects (only beta) and not the rest. Is that possible somehow?
>
>     I am not sure, but would it help to specify parameters via mcmcpars? I
>     tried to include mcmcpars in the owl example in section 2.2 from the
>     vignette of the package
>     (http://glmmadmb.r-forge.r-project.org/glmmADMB.pdf):
>
>     fit_zinbinom1_bs_mcmc <-
>     glmmadmb(NCalls~(FoodTreatment+ArrivalTime)*SexParent+BroodSize+(1|Nest),data=Owls,zeroInflation=TRUE,family="nbinom1",mcmc=TRUE,mcmc.opts=mcmcControl(mcmc=10,mcmcpars="beta"))
>
>     But unfortunately, I get an error message stating "unused argument
>     (mcmcpars="beta")". As I wasn't sure if I have to state the fixed
>     effects by using "beta" or the names of the parameters directly, I
>     also
>     tried including mcmcpars="BroodSize" but got the same error.
>
>     Is it not possible to define mcmcpars in glmmADMB? Is the
>     definition of
>     mcmcpars at all what I need and if so, how do I do it correctly?
>
>     Otherwise, is it possible to state that only the samples after a
>     certain
>     burnin period should be saved? Or can I play around with the jump
>     sizes
>     to reach faster convergence? As far as I understood those are rescaled
>     depending on the acceptance rate at the moment. The automatic
>     rescaling
>     can be switched off by stating mcnoscale=TRUE, which is working. But I
>     am not sure how I can then adjust the jump size and what the
>     default is.
>
>     Thank you very much for taking the time to read this long email.
>
>     Best wishes,
>
>     Maren Rebke
>
>             [[alternative HTML version deleted]]
>
>     _______________________________________________
>     R-sig-mixed-models at r-project.org
>     <mailto:R-sig-mixed-models at r-project.org> mailing list
>     https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
>


	[[alternative HTML version deleted]]



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