Likelihood function

Likelihood function #

The likelihood statement specifies the probability distribution that will be used to describe the response variable. The available options depend on your data, so knowing what type of variable you’re working with is essential.

Syntax #

# Likelihood. For counts, one or both of: poisson, negative-binomial.
likelihood:
    - poisson
    - negative-binomial

Usage #

In some cases – a model for soil stability observations – there is only one plausible, implemented likelihood function (ordinal-latent-normal). In other cases – species richness – there might be several available options (poisson, negative-binomial, and their zero-inflated counterparts). In cases where you specify multiple likelihoods, the model API will create a separate analysis for each, and the relative performance of each can be evaluated using model diagnostics, posterior predictive checks, and information criteria.

Options #

OptionDescriptionExample
betaContinuous variables with values between 0 and 1Ocular cover
beta-binomial1Overdispersed binomial data
binomial“Successes” in a given number of trailsThe number of “hits” of invasive species in \(n\) point intercepts along a transect
gamma2Continuous, non-negative quantities
gen-poisUnderdispersed count data
hurdle-ordinal-latent-betaOrdinal data arising from a beta distributed latent variablePlant cover measured using Daubenmire cover classes
lognormal3Continuous, non-negative quantities
negative-binomialOverdispersed counts (with support for either fixed stratum-level or hierarchical site-level variances modeled using a moment match for \(\kappa\) )
negative-binomial-simpleOverdispersed counts (with fixed stratum-level dispersion modeled directly using \(\kappa\) )
ordinal-latent-normalOrdinal data arising from a normally distributed latent variableSoil stability
poissonCountsRichness or shrub density
zero-inflated-beta-binomialBinomial data that exhibit overdispersion and excess zeros
zero-inflated-binomialBinomial data with an excess of zero counts
zero-inflated-negative-binomialCount data that exhibit overdispersion and excess zeros
zero-inflated-poissonCount data with an excess of zero counts

  1. A misnomer. We don’t use the canonical beta-binomial parameterization. It was too slow / unwieldy. Instead, we use a binomial model with an extra epsilon term in the model for the mean. ↩︎

  2. “The log of a lognormal random variable is… normal. It’s symmetric.” See Glen_b’s answer here↩︎

  3. “The log of a gamma distributed random variable is left-skew. Depending on the value of the shape parameter, it may be quite skew or nearly symmetric.” See again Glen_b’s answer here↩︎