From 441359403f141d1e583a76b6c5a4957975eb8679 Mon Sep 17 00:00:00 2001 From: Ethan White Date: Thu, 17 Sep 2026 08:46:35 -0400 Subject: [PATCH] Update remaining non-LaTeX math to LaTeX math --- .../R-time-series-modeling-2/r_tutorial.qmd | 18 +++++++++--------- lessons/R-time-series-modeling/r_tutorial.qmd | 10 +++++----- .../instructor_notes.qmd | 2 +- lessons/uncertainty/instructor_notes.qmd | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lessons/R-time-series-modeling-2/r_tutorial.qmd b/lessons/R-time-series-modeling-2/r_tutorial.qmd index 1d3eda8..ff39024 100644 --- a/lessons/R-time-series-modeling-2/r_tutorial.qmd +++ b/lessons/R-time-series-modeling-2/r_tutorial.qmd @@ -36,11 +36,11 @@ data_ts * Note that this is not using a moving average like you did when decomposing time-series * MA models are like AR models in that they use past observations to predict the next step * But instead of using the values themselves they use the past errors -* So a 1st order MA model looks like this +* So a 1st order MA model looks like this -> `y_t = c + theta_1 * e_t-1 + error_t` +> $y_t = c + \theta_1 e_{t-1} + \epsilon_t$ -* So if `theta_1` > 0 then if the observation has greater than the mean at the previous time step it is like to be greater than the mean at the current time step +* So if $\theta_1$ > 0 then if the observation has greater than the mean at the previous time step it is like to be greater than the mean at the current time step * Positive MA components say that if the previous observation was an outlier then the next observation is expected to be an outlier in the same direction * This makes sense for NDVI * Greenness isn't really driven by greenness in the same way a populations abundance is @@ -49,7 +49,7 @@ data_ts * Both AR and MA structures can be present in time-series * We can combine them in an ARMA model -> `y_t = c + b_1 * y_t-1 + theta_1 * error_t-1 + error_t` +> $y_t = c + b_1 y_{t-1} + \theta_1 \epsilon_{t-1} + \epsilon_t$ ### Accounting for trends @@ -59,7 +59,7 @@ data_ts * To take out the trend before model fitting the data is differenced * Typically by subtracting the previous value -> `y_t' = y_t - y_t-1` +> $y_t' = y_t - y_{t-1}$ * So, if we difference the data we are now modeling the change from time-step to time-step, not the actual values @@ -87,7 +87,7 @@ report(arima_model) * `p` is the AR order, `d` is the degree of differencing, and `q` is the MA order * So this model is a 3rd order MA model, with no differencing, and no autoregressive terms -> `y_t = c + theta_1 * e_t-1 + theta_2 * e_t-2 + theta_3 * e_t-3 + e_t` +> $y_t = c + \theta_1 \epsilon_{t-1} + \theta_2 \epsilon_{t-2} + \theta_3 \epsilon_{t-3} + \epsilon_t$ * This is also shown in the `Coefficients` table by the `ma1`, `ma2`, and `ma3` terms * So, if NDVI was above average over the last 3 months we expect it to be above average now @@ -99,9 +99,9 @@ report(arima_model) * The seasonal component is also shown in PDQ notation in the second set of parentheses * We model season components with lags of the length of a full seasonal cycle * In this case a full cycle is 1 year -* So the SAR1 part of the model as +* So the SAR1 part of the model is -> `y_t = c + b_12 * y_t-12` +> $y_t = c + b_{12} y_{t-12}$ * The value in the current month is related to the value observed 1 year ago * This makes a lot of sense for NDVI @@ -109,7 +109,7 @@ report(arima_model) * So a good piece of information is how green the ecosystem was at this time last year * Our full model would therefore be -> `y_t = c + theta_1 * e_t-1 + theta_2 * e_t-2 + theta_3 * e_t-3 + b_12 * y_t-12 + e_t` +> $y_t = c + \theta_1 e_{t-1} + \theta_2 e_{t-2} + \theta_3 e_{t-3} + b_{12} y_{t-12} + \epsilon_t$ * What does this look like? diff --git a/lessons/R-time-series-modeling/r_tutorial.qmd b/lessons/R-time-series-modeling/r_tutorial.qmd index a4bdb22..a655b53 100644 --- a/lessons/R-time-series-modeling/r_tutorial.qmd +++ b/lessons/R-time-series-modeling/r_tutorial.qmd @@ -85,7 +85,7 @@ gg_tsdisplay(data_ts, NDVI) * The data is normally distributed with a fixed mean and variance * It takes the form - > `y_t = c + e_t, where e_t ~ N(0, sigma)` + > $y_t = c + \epsilon_t$, where $\epsilon_t \sim N(0, \sigma)$ * So each time step in our model is a random draw from a normal distribution with a mean of `c` * We fit time-series models using the `fable` package @@ -155,9 +155,9 @@ gg_tsdisplay(data_ts, NDVI) * Current value depends on past values * The simplest version of this type of model is an AR1 model -> *leave room to add y_t-2* +> *leave room to add $y_{t-2}$* -> `y_t = c + b_1 * y_t-1 + e_t, where e_t ~ N(0, sigma)` +> $y_t = c + b_1 y_{t-1} + \epsilon_t$, where $\epsilon_t \sim N(0, \sigma)$ * c is a constant, like the intercept in regression * b_1 is a coefficient determining how y_t is related to y at a 1 time-step lag, i.e., the previous time step @@ -170,9 +170,9 @@ gg_tsdisplay(data_ts, NDVI) * Since we have also have lag 2 autocorrelation we add a term for two time steps back -> `y_t = c + b1 * y_t-1 + b2 * y_t-2 + e_t, where e_t ~ N(0, sigma)` +> $y_t = c + b_1 y_{t-1} + b_2 y_{t-2} + \epsilon_t$, where $\epsilon_t \sim N(0, \sigma)$ -> Instructors note: Actually `y_t = (1 - b1 - b2) * c + b1 * y_t-1 + b2 * y_t-2 + e_t` due to non-zero mean +> Instructors note: Actually $y_t = (1 - b_1 - b_2) c + b_1 y_{t-1} + b_2 y_{t-2} + \epsilon_t$ due to non-zero mean * This type of model structure is available in `fable`'s `AR()` model * If we want to specify how many autoregressive terms to include we specify the model as an R formula diff --git a/lessons/uncertainty-dietze-ch-2/instructor_notes.qmd b/lessons/uncertainty-dietze-ch-2/instructor_notes.qmd index 48d47ee..fd29499 100644 --- a/lessons/uncertainty-dietze-ch-2/instructor_notes.qmd +++ b/lessons/uncertainty-dietze-ch-2/instructor_notes.qmd @@ -13,7 +13,7 @@ order: 4 ## Adding sources of uncertainty -* So far we've talked about uncertainty as a single thing: epilson ~ N(0, sigma) +* So far we've talked about uncertainty as a single thing: $\epsilon \sim N(0, \sigma)$ * What are the different sources of uncertainty? ***list on board and discuss what each is as students name them*** * observation error * parameter uncertainty diff --git a/lessons/uncertainty/instructor_notes.qmd b/lessons/uncertainty/instructor_notes.qmd index 81b0c5c..f0af35c 100644 --- a/lessons/uncertainty/instructor_notes.qmd +++ b/lessons/uncertainty/instructor_notes.qmd @@ -5,7 +5,7 @@ order: 4 ## Sources of uncertainty -- So far we've talked about uncertainty as a single thing: epilson ~ N(0, sigma) +- So far we've talked about uncertainty as a single thing: $\epsilon \sim N(0, \sigma)$ - Different sources of uncertainty - process uncertainty - parameter uncertainty