Skip to content

Instantly share code, notes, and snippets.

@rBatt
Last active August 29, 2015 14:20
Show Gist options
  • Save rBatt/7ae49c0f216d430906ca to your computer and use it in GitHub Desktop.
Save rBatt/7ae49c0f216d430906ca to your computer and use it in GitHub Desktop.
Lake Metabolizer Latex Scripts
% ===============
% = Bookkeeping =
% ===============
% Equation 3: average respiration
R_{\mu} = \frac{\sum\limits_{i=1}^{n} \Delta DO_i - F_i}{n \Delta t}
NEP = \frac{NEP_t (\text{mg O}_2 \text{ L}^{\text{-}1} \Delta t)} {1}
% =======
% = OLS =
% =======
% =======
% = MLE =
% =======
% Equation 8: mle process model, expanded
% \alpha_{t} = a_t k_{t-1}^{\text{-}1} z_{t-1} + \text{-e}^{\text{-}k_{t-1} z_{t-1}^{\text{-}1}} a_t k_{t-1}^{\text{-}1} z_{t-1} + \text{e}^{\text{-}k_{t-1} z_{t-1}^{\text{-}1}} \alpha_{t-1}
\alpha_{t} = a_t \kappa_{t-1} + \text{-e}^{\text{-}\kappa_{t-1}} a_t \kappa_{t-1} + \text{e}^{\text{-}\kappa_{t-1}} \alpha_{t-1} + \epsilon_{t}
% Equation 9: mle a_t term
a_t = \iota I_{t-1} + \rho (log_{e}T_{t-1}) + \kappa_{t-1} O_{s,t-1}
% Equation 9.5: mle nll
L = \sum\limits_{t=1}^{N} \frac{1}{2} \text{log}_e(2 \pi \sigma^2) + \frac{1}{2 \sigma^2} (DO_t - \alpha_t)^2
\kappa_{t} = (k_{t} \Delta t) z^{\text{-}1}_{t}
% ==========
% = Kalman =
% ==========
%
% Equation 10: kalman observation equation
y_t = \alpha_t + \eta_t \text{; } \eta \sim \mathcal{N}(0,H)
% Equation 11: kalman process equation (simple)
\alpha_{t|t-1} = \alpha_{t-1} + \iota I_{t-1} + \rho (log_e T_{t-1}) + F^{*}_{t-1} + \epsilon_t \text{; } \epsilon \sim \mathcal{N}(0, Q)
% Equation 12: kalman filter process (expanded)
% \alpha_{t|t-1} = a_t k_{t-1}^{\text{-}1} z_{t-1} + \text{-e}^{\text{-}k_{t-1} z_{t-1}^{\text{-}1}} a_t k_{t-1}^{\text{-}1} z_{t-1} + \text{e}^{\text{-}k_{t-1} z_{t-1}^{\text{-}1}} \alpha_{t-1} + \epsilon_t
\alpha_{t|t-1} = a_t \kappa_{t-1} + \text{-e}^{\text{-}\kappa_{t-1}} a_t \kappa_{t-1} + \text{e}^{\text{-}\kappa_{t-1}} \alpha_{t-1} + \epsilon_{t}
% Equation 13: kalman a_t term: same as Equation 9, mle a_t term
% Equation 18: kalman nll
L = \sum\limits_{t=1}^{N} \frac{1}{2} \text{log}_e(2 \pi) + \frac{1}{2} \text{log}_e(E_t) + \frac{1}{2 E_t} (y_t - \alpha_{t|t-1})^2
% ============
% = Bayesian =
% ============
% Equation 23: 2-part bayes process (k or no k)
\alpha_{t}^{*} = \begin{cases} \alpha_{t-1} + a_t & \text{if } \kappa_{t} = 0 \\ a_t \kappa_{t-1}^{\text{-}1} + \text{-e}^{\text{-}\kappa_{t-1}} a_t \kappa_{t-1}^{\text{-}1} + \text{e}^{\text{-}\kappa_{t-1}} \alpha_{t-1} & \text{otherwise} \end{cases}
% Equation 24: bayesian a_t (slightly different than the others, but for no good reason)
a_t = X_{t-1} \beta + \kappa_{t-1} O_{s,t-1}
% Equation 25: bayes term for kz
\kappa_{t} = (K^{\ast}_{t} \Delta t) z^{\text{-}1}_{t}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment