[R-sig-ME] INterpretation and use of parameters from beta glmmadmb - apology

Biuw, Martin Martin.Biuw at nina.no
Wed Nov 21 10:34:47 CET 2012

Thanks very much Ben. That makes a lot of sense.
(And apologies again. I now know the R-sig-ME mailing list system doesn't like single quotes..)

-----Original Message-----
From: r-sig-mixed-models-bounces at r-project.org [mailto:r-sig-mixed-models-bounces at r-project.org] On Behalf Of Ben Bolker
Sent: 21 November 2012 04:55
To: r-sig-mixed-models at r-project.org
Subject: Re: [R-sig-ME] INterpretation and use of parameters from beta glmmadmb - apology

Biuw, Martin <Martin.Biuw at ...> writes:

> Hi all, I¡¯m using glmmADMB to fit a mixed model with a beta famiily, 
> and I would like some clarification on how to interpret the parameter 
> estimates. Specifically, I would like to use the results as input into 
> the R function ¡®dbeta¡¯, but I¡¯m not sure what in the glmmadmb 
> output corresponds to the shape1 and shape2 parameters of dbeta. I¡¯m 
> assuming the ¡®alpha¡¯, ¡®b¡¯ and ¡®stdbeta¡¯ components are the ones 
> to go for. But which is which?

> According to the dbeta help page, shape1 and shape2 corresponds to 
> alpha and beta respectively in the beta density function:
> gamma(alpha+beta)/(gamma(alpha)gamma(beta))x^(alpha-1)(1-x)^(beta-1)
> But how do these correspond to the ¡®alpha¡¯ (dispersion parameter) 
> and ¡®b¡¯ in the glmmadmb output? I get the most realistic results 
> (when comparing to the distribution of my data) if I let the the 
> ¡®alpha¡¯ corresponds to shape2 (i.e. ¥â in the above expression) and 
> ¡®b¡¯ to shape1 (¥á in the expression). Maybe I¡¯m only being confused 
> by the nomenclature? But if I¡¯ve understood the maths behind the beta 
> distribution properly, when shape1 is greater than
> shape2 the distribution is left-skewed, and the dispersion is 
> determined by the ratio shape2/shape1. And vice versa for a 
> right-skewed distribution. So how can I determine which goes in as
> shape1 and shape2 when calculating my beta densities?

We need a parameterization that separates the mean and the variance, for example as in the parameterization underlying the beta-binomial in Morris (1997), American Naturalist 150:299-327 (not quite the same thing but a parallel situation).

Looking at the guts of the TPL (model definition) file we find:


  df1b2variable ln_beta_density(double y,const df1b2variable & mu,
    const df1b2variable& phi)
    df1b2variable omega=mu*phi;
    df1b2variable tau=phi-mu*phi;
    df1b2variable lb=betaln(omega,tau);
    df1b2variable d=(omega-1)*log(y)+(tau-1)*log(1.0-y)-lb;
    return d;

Where mu is the mean (as determined from a logit-linked linear model) and phi is the dispersion parameter.  Thus omega and tau are the shape parameters ...

R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

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