## 13.3 Random walk model

All of the previous three models can be interpreted as observation error models. Switching gears, we can alternatively model error in the state of nature, creating process error models. A simple process error model that many of you may have seen before is the random walk model. In this model, the assumption is that the true state of nature (or latent states) are measured perfectly. Thus, all uncertainty is originating from process variation (for ecological problems, this is often interpreted as environmental variation). For this simple model, we’ll assume that our process of interest (in this case, daily wind speed) exhibits no daily trend, but behaves as a random walk.

$y_t = y_{t-1} + e_{t}$

And the $${e}_{t} \sim N(0, \sigma)$$. Remember back to the autocorrelated model (or MA(1) models) that we assumed that the errors $$e_t$$ followed a random walk. In contrast, this model assumes that the errors are independent, but that the state of nature follows a random walk. Note also that this model as written doesn’t include a drift term (this can be turned on / off using the est_drift argument).

We can fit the random walk model using argument model_name = 'rw' passed to the fit_stan() function.

rw <- atsar::fit_stan(y = Temp, est_drift = FALSE, model_name = "rw")