Four-Fitness Model Technical Documentation

Complete Mathematical and Implementation Details

Generated: 2026-02-28 | Technical reference for developers and researchers

📋 Table of Contents

  1. Parameter Estimates
  2. Mathematical Foundations
  3. Process Interactions
  4. Posterior Predictions

1. Parameter Estimates

Posterior means and 95% highest density intervals from MCMC sampling:

Parameter Mean Std HDI 2.5% HDI 97.5%
psi_a_short 0.373 0.153 0.081 0.637
psi_s_short 0.346 0.151 0.084 0.638
psi_a_long 0.663 0.150 0.397 0.933
psi_s_long 0.661 0.170 0.372 0.997
alpha_a_short 0.500 0.166 0.167 0.768
alpha_s_short 0.488 0.166 0.163 0.777
alpha_a_long 0.769 0.119 0.553 0.972
alpha_s_long 0.913 0.100 0.718 1.000
beta_a_short 0.092 0.120 -0.102 0.366
beta_s_short 0.113 0.131 -0.136 0.345
beta_a_long 0.065 0.070 -0.060 0.203
beta_s_long 0.032 0.057 -0.065 0.160
gamma_a_short -0.211 0.153 -0.528 0.028
gamma_s_short 0.106 0.135 -0.107 0.395
gamma_a_long -0.159 0.095 -0.321 0.014
gamma_s_long 0.194 0.150 -0.013 0.501
sigma_w 0.359 0.022 0.318 0.403
alpha_gp 0.801 0.238 0.381 1.266
rho_gp 0.164 0.034 0.096 0.226

1. Mathematical Foundations

1.1 Complete State-Space System

\[ \begin{align*} \text{Impulse dynamics:} & \\ I_i[t] &= \psi_i I_i[t-1] + X_i[t] \\ \\ \text{Fitness dynamics:} & \\ F_i[t] &= \alpha_i F_i[t-1] + \beta_i I_i[t-1] \\ \\ \text{Observation equation:} & \\ W[t] &= \sum_{i} \gamma_i F_i[t] + \text{GP}(t) + f_{\text{daily}}(t) + \epsilon_w[t] \end{align*} \] for $i \in \{a\_short, s\_short, a\_long, s\_long\}$.

1.2 Key Mathematical Properties

Impulse accumulation: \[ I_i[t] = \sum_{k=0}^{t} \psi_i^k X_i[t-k] \] Shows exponential decay of past intensities.
Fitness accumulation: \[ F_i[t] = \sum_{k=1}^{t} \alpha_i^{k-1} \beta_i I_i[t-k] \] Shows how impulses translate to fitness.
Complete weight prediction: \[ \hat{W}[t] = \sum_{i} \gamma_i \sum_{k=1}^{t} \alpha_i^{k-1} \beta_i \sum_{j=0}^{t-k} \psi_i^j X_i[t-k-j] \] Shows the full cascade from activity to weight.

2. Process Interactions

2.1 System Diagram

graph TD A[Aerobic Intensity] --> B[Impulse: ψ_a_short] A --> C[Impulse: ψ_a_long] B --> D[Fitness: α_a_short, β_a_short] C --> E[Fitness: α_a_long, β_a_long] F[Strength Intensity] --> G[Impulse: ψ_s_short] F --> H[Impulse: ψ_s_long] G --> I[Fitness: α_s_short, β_s_short] H --> J[Fitness: α_s_long, β_s_long] D --> K[Weight: γ_a_short] E --> L[Weight: γ_a_long] I --> M[Weight: γ_s_short] J --> N[Weight: γ_s_long] K --> O[Σ Weight Effects] L --> O M --> O N --> O P[GP Trend] --> O Q[Daily Cycle] --> O O --> R[Observed Weight] S[Observation Noise] --> R

2.2 Time Scale Separation

Short-term half-life: \[ t_{1/2}^{\text{short}} = -\frac{\log(2)}{\log(\psi_{\text{short}})} \] Typically hours to days.
Long-term half-life: \[ t_{1/2}^{\text{long}} = -\frac{\log(2)}{\log(\alpha_{\text{long}} \psi_{\text{long}})} \] Typically weeks to months.

3. Posterior Predictions

3.1 Single Workout Response

\[ \Delta W[t] = \gamma \beta \alpha^{t} \psi^{t} X[0] \] Weight change at time $t$ from single workout at time 0.

3.2 Multiple Workout Superposition

\[ \Delta W[t] = \sum_{s=0}^{t} \gamma \beta \alpha^{t-s} \psi^{t-s} X[s] \] Linear superposition of workouts at different times.

3.3 Uncertainty Propagation

\[ \text{Var}(\hat{W}[t]) = \sum_{i} \gamma_i^2 \text{Var}(F_i[t]) + \text{Var}(\text{GP}(t)) + \text{Var}(f_{\text{daily}}(t)) + \sigma_w^2 \] Shows how parameter uncertainty affects prediction uncertainty.

Four-Fitness State-Space Model Technical Walkthrough

Generated on 2026-02-27 15:00:55 | Model: weight_state_space_four_fitness.stan