class: center, middle, inverse, title-slide .title[ # Introduction to State-Space Models ] .subtitle[ ## Mark Scheuerell
(use the arrows keys to navigate the slide deck) ] --- # ESA status reviews ## .blue[Required every 5 years to ensure appropriate protections] ## .blue[Considerations include] > ### .gray[population trends, distribution, demographics & genetics] > ### .gray[habitat conditions] > ### .gray[past conservation measures] > ### .gray[status & trends of threats] --- class: inverse, center, middle # Surely listed species are closely monitored? --- class: frimg background-image: url(figs/no_evil.jpg) background-size: 80% --- class: center # The data are gappy <img src="intro_to_SSMs_files/figure-html/data_gappy-1.png" width="90%" height="90%" style="display: block; margin: auto;" /> --- # The data are noisy <br> ## .center.green[ Non-exhaustive surveys ] ## .center.blue[ Undetected individuals ] ## .center.orange[ Misidentified individuals ] --- # The data are disparate <br> ## .center.green[ Direct vs remotely sensed ] ## .center.blue[ Design-based vs opportunistic ] ## .center.orange[ Scientific surveys vs recreational sampling ] --- class: middle > # .blue[ How can we use this information to inform decisions? ] > # .green[ For trends over time, one option is a state-space model ] --- # Part 1: State model ## Describes the .blue[true state of nature] over time <img src="intro_to_SSMs_files/figure-html/state_diag-1.png" width="80%" height="80%" style="display: block; margin: auto;" /> --- # States of nature might be ## .center.green[ Animal location ] ## .center.blue[ Species density ] ## .center.orange[ Age structure ] ## .center.purple[ Reproductive status ] --- # Changes in the state of nature ## .blue[Generally driven by a combination of] ## .blue[• intrinsic (eg, fecundity)] ## .blue[• extrinsic factors (eg, temperature)] --- # Process errors ## .blue[Some of the extrinsic drivers may be unknown] ## .blue[We often call these unknown extrinsic factors] _process errors_ --- class: frimg, center, bottom, inverse-black background-image: url(figs/venice_carnival.jpg) background-size: 100% ## .white[Revealing the true state requires observations] <br> --- # Observation (sampling) errors ## .blue[Collecting data depends on many factors] ### • Environmental conditions (eg, cloud cover) ### • Behavior (eg, threat avoidance) ### • Demographics (age, sex, maturity) ### • Sampling design/coverage ### • Observer skill --- class: center, middle, inverse # Observing nature can be easy --- class: frimg, bottom, right background-image: url(figs/sockeye.jpg) background-size: cover # .white[How many sockeye are there?] --- class: center, middle, inverse # Observing nature can also be hard --- class: frimg, bottom, right background-image: url(figs/sockeye.jpg) background-size: cover # .white[How many mayflies are there?] --- # Part 2: Observation model <br> # .center[.purple[Data] = .blue[Truth] ± .red[Errors]] --- # Part 2: Observation model <img src="intro_to_SSMs_files/figure-html/obs_diag-1.png" width="80%" height="80%" style="display: block; margin: auto;" /> --- class: inverse, center, middle # Why bother? --- # Advantages ## 1. Can combine many different .purple[data types] ## .center.purple[ Changes in observers or sensors ] ## .center.purple[ Varying survey locations & effort ] ## .center.purple[ Direct & remote sampling ] --- # Advantages ## 2. .gray[Missing data] are easily accommodated <img src="intro_to_SSMs_files/figure-html/obs_NA-1.png" width="80%" height="80%" style="display: block; margin: auto;" /> --- class: frimg background-image: url(figs/Jonsen2016.png) background-position: 50% 70% background-size: 70% # Advantages ## 3. Improved accuracy & precision --- class: frimg background-image: url(figs/robin.jpg) background-position: 50% 80% background-size: 30% # Advantages ## 4. .gray[Data-poor] benefit from .green[data-rich] --- # State-space model | General form ## .blue[State model (autoregressive)] `\(\LARGE x_t = f(x_{t-1}, \text{process error})\)` <br> ## .purple[Observation model] `\(\LARGE y_t = g(x_t, \text{observation error})\)` --- # State-space model | Random walk ## .blue[State model] `\(\LARGE x_t = x_{t-1} + w_t ~~~~~~~~~~~ w_t \sim \text{N}(0,q)\)` <br> ## .purple[Observation model] `\(\LARGE y_t = x_t + v_t ~~~~~~~~~~~ v_t \sim \text{N}(0,r)\)` --- class: center # Examples of random walks <img src="intro_to_SSMs_files/figure-html/ex_rw-1.png" width="90%" height="90%" style="display: block; margin: auto;" /> --- # State-space model | Biased random walk ## .blue[State model] `\(\LARGE x_t = x_{t-1} + u + w_t ~~~~~~~~~~~ w_t \sim \text{N}(0,q)\)` <br> ## .purple[Observation model] `\(\LARGE y_t = x_t + v_t ~~~~~~~~~~~ v_t \sim \text{N}(0,r)\)` --- class: center # Examples of biased random walks <img src="intro_to_SSMs_files/figure-html/ex_biased_rw-1.png" width="90%" height="90%" style="display: block; margin: auto;" /> --- # State-space model | Mean-reverting ## .blue[State model] `\(\LARGE x_t = b x_{t-1} + w_t ~~~~~~~~~~ |b| < 1 ~~~~~~~~~~~ w_t \sim \text{N}(0,q)\)` <br> ## .purple[Observation model] `\(\LARGE y_t = x_t + v_t ~~~~~~~~~~~ v_t \sim \text{N}(0,r)\)` --- class: center # Examples of mean-reverting models <img src="intro_to_SSMs_files/figure-html/ex_AR1-1.png" width="90%" height="90%" style="display: block; margin: auto;" /> --- class: center # Consider these data <img src="intro_to_SSMs_files/figure-html/ex_bias_rw-1.png" width="90%" height="90%" style="display: block; margin: auto;" /> --- # Two model options ## .blue[1) Linear regression] `\(\LARGE y_t = \alpha + \beta t + e_t\)` <br> ## .green[2) Biased random walk] `\(\LARGE x_t = x_{t-1} + u + e_t\)` --- # 1) Linear regression as a state-space model ## .blue[State model] `\(\LARGE x_t = \alpha + \beta t\)` <br> ## .purple[Observation model] `\(\LARGE y_t = x_t + v_t ~~~~~~~~~~~ v_t \sim \text{N}(0,r)\)` --- class: center # Estimated state <img src="intro_to_SSMs_files/figure-html/linear_regr-1.png" width="90%" height="90%" style="display: block; margin: auto;" /> --- class: center # Observation errors <img src="intro_to_SSMs_files/figure-html/obs_errors-1.png" width="90%" height="90%" style="display: block; margin: auto;" /> --- # 2) Biased random walk as a state-space model ## .blue[State model] `\(\LARGE x_t = x_{t-1} + u + w_t ~~~~~~~~~~~ w_t \sim \text{N}(0,q)\)` <br> ## .purple[Observation model] `\(\LARGE y_t = x_t\)` --- class: center # Estimated state <img src="intro_to_SSMs_files/figure-html/biased_rw_fit-1.png" width="90%" height="90%" style="display: block; margin: auto;" /> --- class: center # Process errors <img src="intro_to_SSMs_files/figure-html/biased_rw_errors-1.png" width="90%" height="90%" style="display: block; margin: auto;" /> --- class: middle, center # What if we combined the two models? --- # Biased random walk with observation error ## .blue[State model] `\(\LARGE x_t = x_{t-1} + u + w_t ~~~~~~~~~~~ w_t \sim \text{N}(0,q)\)` <br> ## .purple[Observation model] `\(\LARGE y_t = x_t + v_t ~~~~~~~~~~~ v_t \sim \text{N}(0,r)\)` --- class: center # Estimated state <img src="intro_to_SSMs_files/figure-html/brw_sssm_fit-1.png" width="90%" height="90%" style="display: block; margin: auto;" /> --- class: center # Process errors <img src="intro_to_SSMs_files/figure-html/brw_states_obs_errors-1.png" width="90%" height="90%" style="display: block; margin: auto;" /> --- class: center # Observation errors <img src="intro_to_SSMs_files/figure-html/brw_states_obs_errors_2-1.png" width="90%" height="90%" style="display: block; margin: auto;" /> --- class: middle > # .blue[How is it possible to separate the process and observation errors?] > # .green[They have different temporal patterns] --- <img src="intro_to_SSMs_files/figure-html/ex_proc_obs_errors-1.png" width="90%" height="90%" style="display: block; margin: auto;" /> --- # Model fitting: The Kalman filter ### .blue[In the 1950s, Rudolf Kalman began developing a new algorithm for processing signals obtained from noisy sensors] -- ### .blue[In the 1960s, NASA used it for guidance & navigation computers<sup>*</sup> in Apollo missions] -- ### .blue[Now, the so-called "Kalman filter" is now widely used in statistics, aeronautics & robotics] .citation.gray[*Mark's laptop has 8 million times the RAM] --- # Kalman filter: 3 types of estimates <img src="intro_to_SSMs_files/figure-html/KF_types-1.png" width="90%" height="90%" /> --- # More information ## [.purple[Time series course at UW (FISH 550)]](https://atsa-es.github.io/atsa/) ## [.purple[eBook]](https://atsa-es.github.io/atsa-labs/) ## [.purple[YouTube channel]](https://www.youtube.com/@SAFSTimeSeries) --- class: frimg background-image: url(figs/SSM_review.png) background-position: 50% 50% background-size: 80% # More information