building hmsc step by step: single-species distribution
TRANSCRIPT
Back to basics: the linear model
π¦π = πΌ + π½π₯π + ππ
π = 1,2,3, β¦ , π
π¦
π₯
ππ~π(0, π2)
The linear model:
Index for data points:
Response (or dependent) variable:
Explanatory (or independent or predictor) variable:
Residual:π½
Intercept:
Slope:
πΌ
Several explanatory variables and the linear predictor
π¦π = πΌ + π½1π₯π1 + π½1π₯π2 + ππThe linear model with two variables:
π¦π = π½1π₯π1 + π½2π₯π2 + π½3π₯π3 + ππCan also be parameterized as:
π₯π1 = 1where for all sampling units π
ππ
Can be written more compactly as where
πΏπ =π=1
πππ½ππ₯ππ
is the linear predictor and is the number of covariates (including the intercept)
π¦π = πΏπ + ππ
Continuous versus categorical predictors
In the basic linear model
πΏπ =π=1
πππ½ππ₯ππ
π¦π = πΌ + π½π₯π + ππ
π₯ is a continuous explanatory variable (covariate)
Often π₯ is a categorical explanatory variable (factor), e.g. habitat type
classified as coniferous forest, broadleaved forest, or mixed forest.
π₯π1 = 1 for all sampling units
π₯π2 = 1 if π is in broadleaved forest, otherwise π₯π2 = 0
This can be incorporated as:
π₯π3 = 1 if π is in mixed forest, otherwise π₯π3 = 0
Generalized linear models
Presence-absence data: π¦π~Bernoulli(ππ)
Logistic regression: ππ = logitβ1(πΏπ)
Probit regression: ππ = Ξ¦(πΏπ)
πΏLinear predictor
πO
ccu
rren
ce
pro
bab
ility
Generalized linear models
Count data: π¦π~Poisson(ππ)
Poisson modelππ = exp(πΏπ)
Lognormal Poisson model
πΏLinear predictor
πEx
pec
ted
co
un
t
ππ = exp(πΏπ + ππ)
π¦ = 3,0,0,2,1
π¦ = 3,0,0,2,30,β¦
Hurdle models for zero inflated data
Assume that the data looks like π¦ = 0, 42, 39, 0, 43
We can model separately presence-absence
and abundance conditional on presence
π¦ = 0, 1, 1, 0, 1
π¦ = NA, 42, 39, NA, 43
These two parts of the hurdle-model can be fitted independently of each other, but they can be thought to jointly form one model.
The presence-absence part predicts if the species is present or not. If it is present, then the abundance (conditional on presence) part predicts how abundant the species is.
Mixed models: fixed effects and random effects
Linear model with fixed effects only:
πΏπ =π=1
πππ½ππ₯ππ
π¦π = πΏπ + ππ
ππ~π(0, π2)
iid
Hierarchical study design: Plot
Sampling unit
Mixed models: fixed effects and random effects
Linear model with fixed and random effects:
πΏπ =π=1
πππ½ππ₯ππ
π¦π = πΏπ + ππ(π) + ππ
ππ~π(0, π2)
iid
Hierarchical study design: Plot
Sampling unit
ππ~π(0, ππ2)
iid
Mixed models: fixed effects and random effects
Spatial study design:
Linear model without spatial structure:
πΏπ =π=1
πππ½ππ₯ππ
π¦π = πΏπ + ππ
ππ~π(0, π2)
iid
Mixed models: fixed effects and random effects
Spatial study design:
Linear model with spatial structure:
πΏπ =π=1
πππ½ππ₯ππ
π¦π = πΏπ + ππ + ππ
Cov ππ , ππ = ππ2 exp βπππ/πΌ
ππ~π(0, π2)
iidππ~π(0, ππ2)