class: center, middle, inverse, title-slide # Lecture 9 ## State-space models ###
WILD6900 (Spring 2021) --- ## Readings > Kéry & Schaub 115-131 --- ## Ecological state variables #### **State variables** are the ecological quantities of interest in our model that change over space or time -- #### Abundance > the number of individual organisms in a population at a particular point in time -- #### Occurrence > the spatial distribution of organisms with a particular region at a particular point in time -- #### Richness > the number of co-occurring species at a given location and a particular point in time ??? `\(^2\)` These are not the only state variables, but are among the most common in ecological studies --- ## Ecological parameters #### **Parameters** determine how the state variables change over space and time -- - Survival <br/> -- - Reproduction <br/> -- - Movement <br/> -- - Population growth rate <br/> -- - Carrying capacity <br/> -- - Colonization/extinction rate --- ## Process models <br/> `$$\Huge [z|g(\theta_p, x), \sigma^2_p]$$` <br/> - Mathematical description of our hypothesis about how the *state variables* we are interested in change over space and time <br/> -- - Represent the **true** value of our state variables at any given point in space or time <br/> -- - Deterministic <br/> -- - Abstraction --- ## Observation models - Rarely observe the true state perfectly + Animals are elusive and may hide from observers + Even plants may be cryptic and hard to find + Measurements may be taken with error + May count the same individual > 1 -- - *Observation uncertainty* `\(\large (\sigma^2_o)\)` can lead to biased estimates of model parameters, so generally requires its own model <br/> `$$\Huge [y_i|d(\Theta_o,z_i), \sigma^2_o]$$` --- class: inverse, middle, center # State-space models --- ## State-space models - Hierarchical models -- - Decompose time series into: + process variation in state process + observation error -- - Generally used for *Markovian* state process models + Population dynamics + Survival + Occupancy <img src="state_space.png" width="45%" style="display: block; margin: auto;" /> --- ## Process models ### Population dynamics `$$\Large N_{t+1} \sim Poisson(N_t \lambda)$$` `$$\Large N_{t+1} \sim Normal(N_t e^{\bigg[r_0 \bigg(1-\frac{N_t}{K}\bigg)\bigg]}, \sigma^2)$$` -- ### Survival `$$\Large z_{t+1} \sim Bernoulli\big(z_t \phi_t\big)$$` -- ### Occupancy `$$\Large z_{t+1} \sim Bernoulli\bigg(z_t (1-\epsilon_t) + (1 - z_t)\gamma_t\bigg)$$` --- ## Observation models ### Population dynamics `$$\Large C_{t} \sim Normal(N_t, \sigma_o^2)$$` `$$\Large C_{t} \sim Binomial(N_t, p)$$` -- ### Survival `$$\Large y_{t} \sim Bernoulli\big(z_t p\big)$$` -- ### Occupancy `$$\Large y_{t} \sim Bernoulli\big(z_t p_t\big)$$` --- ## Including covariates #### For any of these models, we can use GLMs to include covariates effects on parameters: `$$\Large log(\lambda_t) = \alpha + \mathbf \beta \mathbf X + \varepsilon_t$$` `$$\Large logit(\phi_t/\gamma_t/\epsilon_t/p_t) = \alpha + \mathbf \beta \mathbf X + \varepsilon_t$$` -- #### And random effect structure -- `$$\Large \varepsilon_t \sim normal\big(0, \tau_{\lambda}\big)$$` `$$\Large \tau_{\lambda} \sim gamma\big(0.25, 0.25\big)$$` --- ## Simple state-space population growth model #### Process model `$$\Large N_{t+1} = N_t \lambda_t$$` `$$\Large \lambda_t \sim normal(\mu_{\lambda}, \tau_{\lambda})$$` -- #### Observation model `$$\Large C_{t} = N_t + \epsilon_t$$` `$$\Large \epsilon_t\sim Normal(0, \sigma_o^2)$$` --- ## Simple state-space population growth model <img src="Lecture9_files/figure-html/unnamed-chunk-3-1.png" width="504" style="display: block; margin: auto;" /> --- ## Simple state-space population growth model <img src="Lecture9_files/figure-html/unnamed-chunk-4-1.png" width="504" style="display: block; margin: auto;" /> --- ## Simple state-space population growth model #### What if instead of: `$$\Large C_{t} = N_t + \epsilon_t$$` `$$\Large \epsilon_t\sim Normal(0, \sigma_o^2)$$` -- #### The observation model is: `$$\Large C_{t} \sim binomial(N_t, p)$$` #### and `$$\Large N_t = 50$$` --- ## Systematic bias in state-space models <img src="Lecture9_files/figure-html/unnamed-chunk-6-1.png" width="504" style="display: block; margin: auto;" /> --- ## Systematic bias in state-space models <img src="Lecture9_files/figure-html/unnamed-chunk-7-1.png" width="504" style="display: block; margin: auto;" /> --- ## Systematic bias in state-space models #### What if instead of: `$$\Large C_{t} \sim binomial(N_t, p)$$` -- #### The observation model is: `$$\Large C_{t} \sim binomial(N_t, p_t)$$` #### and `$$\Large logit(p_{t}) = \alpha + \beta \times year_t$$` --- ## Systematic bias in state-space models <img src="Lecture9_files/figure-html/unnamed-chunk-9-1.png" width="504" style="display: block; margin: auto;" /> --- ## Systematic bias in state-space models <img src="Lecture9_files/figure-html/unnamed-chunk-10-1.png" width="504" style="display: block; margin: auto;" /> --- ## State-space models #### Produce unbiased estimates of `\(\Large N\)` **only** when false-positives and false-negatives cancel each other out on average <br/> -- #### Produce unbiased estimates of population **indices** `\(\Large (Np)\)` if detection probability has no pattern over time <br/> -- #### Do **not** produce unbiased estimates of `\(\Large N\)` or `\(\Large Np\)` if their are temporal patterns in detection probability or false-positive rates --- ## State-space models #### Advantages - explicit decomposition of process and observation models - flexible - mechanistic "smoothing" of process model - latent state (and uncertainty) can be monitored - possible to "integrate" data on state/observation parameters #### Disadvantages - computationally intensive - usually produce biased estimates of `\(N\)`