Skip to content

Commit 93ae3ed

Browse files
committed
fixed inconsistency where transition matrix was sometimes referred to with A and sometimes with T to only being referred to using T
1 parent 5d95de9 commit 93ae3ed

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

examples/case_studies/ssm_hurricane_tracking.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"The state equation and the observation equation. \n",
2626
"\n",
2727
"$$\n",
28-
"x_{t+1} = A_{t}x_{t} + c_{t} + R_{t}\\epsilon_{t}\n",
28+
"x_{t+1} = T_{t}x_{t} + c_{t} + R_{t}\\epsilon_{t}\n",
2929
"$$ \n",
3030
"\n",
3131
"$$\n",
@@ -37,7 +37,7 @@
3737
"We have the following matrices:\n",
3838
"|State Equation variables|Definition|\n",
3939
"| --- | --- |\n",
40-
"| $A_{t}$ | The state transition matrix at time $t$ defines the kinematics of the process generating the series.\n",
40+
"| $T_{t}$ | The state transition matrix at time $t$ defines the kinematics of the process generating the series.\n",
4141
"| $x_{t}$ | The state vector at time $t$ describes the current state of the system.\n",
4242
"| $c_{t}$ | Intercept vector at time $t$ can include covariates/control/exogenous variables that are deterministically measured.\n",
4343
"| $R_{t}$ | Selection matrix at time $t$ selects which process innovations are allowed to affect the next state.\n",
@@ -64,8 +64,8 @@
6464
"The following equations define the process:\n",
6565
"|Description|Equation|\n",
6666
"| --- | --- |\n",
67-
"|Predict the next state vector| $\\hat{x}_{t+1\\|t} = A_{t}\\hat{x}_{t\\|t}$ |\n",
68-
"|Predict the next state/process covariance| $P_{t+1\\|t} = A_{t}P_{t+1\\|t}A_{t}^{T} + Q$ |\n",
67+
"|Predict the next state vector| $\\hat{x}_{t+1\\|t} = T_{t}\\hat{x}_{t\\|t}$ |\n",
68+
"|Predict the next state/process covariance| $P_{t+1\\|t} = T_{t}P_{t+1\\|t}T_{t}^{T} + Q$ |\n",
6969
"|Compute Kalman Gain | $K_{t} = P_{t\\|t-1}Z^{T}(ZP_{t\\|t-1}Z^{T} + H_{t})^{-1}$ |\n",
7070
"|Estimate current state vector| $\\hat{x}_{t\\|t} = \\hat{x}_{t\\|t-1} + K_{t}(y_{t} - Z\\hat{x}_{t\\|t-1})$ |\n",
7171
"|Estimate current state/process covariance| $P_{t\\|t} = (I - K_{t}Z_{t})P_{t\\|t-1}(I - K_{t}Z_{t})^{T} + K_{t}H_{t}K_{t}^{T}$ |\n",
@@ -913,9 +913,9 @@
913913
"Q = \\sigma_{a}^{2}\\begin{bmatrix} \\frac{\\Delta t^{4}}{4}&0&\\frac{\\Delta t^{3}}{2}&0&\\frac{\\Delta t^{2}}{2}&0 \\\\ 0&\\frac{\\Delta t^{4}}{4}&0&\\frac{\\Delta t^{3}}{2}&0&\\frac{\\Delta t^{2}}{2} \\\\ \\frac{\\Delta t^{3}}{2}&0&\\Delta t^{2}&0&\\Delta t&0 \\\\ 0&\\frac{\\Delta t^{3}}{2}&0&\\Delta t^{2}&0&\\Delta t \\\\ \\frac{\\Delta t^{2}}{2}&0&\\Delta t&0&1&0 \\\\ 0&\\frac{\\Delta t^{2}}{2}&0&\\Delta t&0&1 \\end{bmatrix}\n",
914914
"$$\n",
915915
"\n",
916-
"Let's briefly go over how we came about our $A$ and $Q$ matrices.\n",
916+
"Let's briefly go over how we came about our $T$ and $Q$ matrices.\n",
917917
"\n",
918-
"The $A$ transition matrix is built such that when we expand the observation model we end up with the Newtonian equations of motion. For example, if we expand the matrix vector multiplaction for the longitude (position) term we end up with:\n",
918+
"The $T$ transition matrix is built such that when we expand the observation model we end up with the Newtonian equations of motion. For example, if we expand the matrix vector multiplaction for the longitude (position) term we end up with:\n",
919919
"\n",
920920
"$$\n",
921921
"\\hat{y}_{longitude_{t+1}} = longitude_{t} + longitude\\_velocity_{t}\\Delta t + \\frac{longitude\\_acceleration_{t}\\Delta t^{2}}{2}\n",
@@ -1743,7 +1743,7 @@
17431743
"\n",
17441744
"Where $Z$ is our previously defined design matrix and $X_{exogenous}$ is the measured `wind_speed`, `minimum_pressure`, and `interaction_wind_pressure` exogenous data.\n",
17451745
"\n",
1746-
"We also need to make adjustments to our $A$ state transition matrix and $R$ selection matrix.\n",
1746+
"We also need to make adjustments to our $T$ state transition matrix and $R$ selection matrix.\n",
17471747
"\n",
17481748
"$$\n",
17491749
"T = \\begin{bmatrix}1&0&\\Delta t&0&\\frac{\\Delta t^{2}}{2}&0&1&0&1&0&1&0 \\\\ 0&1&0&\\Delta t&0&\\frac{\\Delta t^{2}}{2}&0&1&0&1&0&1 \\\\ 0&0&1&0&\\Delta t&0&0&0&0&0&0&0 \\\\ 0&0&0&1&0&\\Delta t&0&0&0&0&0&0 \\\\ 0&0&0&0&1&0&0&0&0&0&0&0 \\\\ 0&0&0&0&0&1&0&0&0&0&0&0 \\\\ 0&0&0&0&0&0&1&0&0&0&0&0 \\\\ 0&0&0&0&0&0&0&1&0&0&0&0 \\\\ 0&0&0&0&0&0&0&0&1&0&0&0 \\\\ 0&0&0&0&0&0&0&0&0&1&0&0 \\\\ 0&0&0&0&0&0&0&0&0&0&1&0 \\\\ 0&0&0&0&0&0&0&0&0&0&0&1 \\end{bmatrix}\n",

examples/case_studies/ssm_hurricane_tracking.myst.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ As a brief introduction to SSMs, the general idea is that we define our system u
3131
The state equation and the observation equation.
3232

3333
$$
34-
x_{t+1} = A_{t}x_{t} + c_{t} + R_{t}\epsilon_{t}
34+
x_{t+1} = T_{t}x_{t} + c_{t} + R_{t}\epsilon_{t}
3535
$$
3636

3737
$$
@@ -43,7 +43,7 @@ The process/state covariance is given by $\epsilon_{t} \sim N(0, Q_{t})$ where $
4343
We have the following matrices:
4444
|State Equation variables|Definition|
4545
| --- | --- |
46-
| $A_{t}$ | The state transition matrix at time $t$ defines the kinematics of the process generating the series.
46+
| $T_{t}$ | The state transition matrix at time $t$ defines the kinematics of the process generating the series.
4747
| $x_{t}$ | The state vector at time $t$ describes the current state of the system.
4848
| $c_{t}$ | Intercept vector at time $t$ can include covariates/control/exogenous variables that are deterministically measured.
4949
| $R_{t}$ | Selection matrix at time $t$ selects which process innovations are allowed to affect the next state.
@@ -70,8 +70,8 @@ The general idea is that we make predictions based on our current state vector a
7070
The following equations define the process:
7171
|Description|Equation|
7272
| --- | --- |
73-
|Predict the next state vector| $\hat{x}_{t+1\|t} = A_{t}\hat{x}_{t\|t}$ |
74-
|Predict the next state/process covariance| $P_{t+1\|t} = A_{t}P_{t+1\|t}A_{t}^{T} + Q$ |
73+
|Predict the next state vector| $\hat{x}_{t+1\|t} = T_{t}\hat{x}_{t\|t}$ |
74+
|Predict the next state/process covariance| $P_{t+1\|t} = T_{t}P_{t+1\|t}T_{t}^{T} + Q$ |
7575
|Compute Kalman Gain | $K_{t} = P_{t\|t-1}Z^{T}(ZP_{t\|t-1}Z^{T} + H_{t})^{-1}$ |
7676
|Estimate current state vector| $\hat{x}_{t\|t} = \hat{x}_{t\|t-1} + K_{t}(y_{t} - Z\hat{x}_{t\|t-1})$ |
7777
|Estimate current state/process covariance| $P_{t\|t} = (I - K_{t}Z_{t})P_{t\|t-1}(I - K_{t}Z_{t})^{T} + K_{t}H_{t}K_{t}^{T}$ |
@@ -740,9 +740,9 @@ $$
740740
Q = \sigma_{a}^{2}\begin{bmatrix} \frac{\Delta t^{4}}{4}&0&\frac{\Delta t^{3}}{2}&0&\frac{\Delta t^{2}}{2}&0 \\ 0&\frac{\Delta t^{4}}{4}&0&\frac{\Delta t^{3}}{2}&0&\frac{\Delta t^{2}}{2} \\ \frac{\Delta t^{3}}{2}&0&\Delta t^{2}&0&\Delta t&0 \\ 0&\frac{\Delta t^{3}}{2}&0&\Delta t^{2}&0&\Delta t \\ \frac{\Delta t^{2}}{2}&0&\Delta t&0&1&0 \\ 0&\frac{\Delta t^{2}}{2}&0&\Delta t&0&1 \end{bmatrix}
741741
$$
742742

743-
Let's briefly go over how we came about our $A$ and $Q$ matrices.
743+
Let's briefly go over how we came about our $T$ and $Q$ matrices.
744744

745-
The $A$ transition matrix is built such that when we expand the observation model we end up with the Newtonian equations of motion. For example, if we expand the matrix vector multiplaction for the longitude (position) term we end up with:
745+
The $T$ transition matrix is built such that when we expand the observation model we end up with the Newtonian equations of motion. For example, if we expand the matrix vector multiplaction for the longitude (position) term we end up with:
746746

747747
$$
748748
\hat{y}_{longitude_{t+1}} = longitude_{t} + longitude\_velocity_{t}\Delta t + \frac{longitude\_acceleration_{t}\Delta t^{2}}{2}
@@ -1067,7 +1067,7 @@ $$
10671067

10681068
Where $Z$ is our previously defined design matrix and $X_{exogenous}$ is the measured `wind_speed`, `minimum_pressure`, and `interaction_wind_pressure` exogenous data.
10691069

1070-
We also need to make adjustments to our $A$ state transition matrix and $R$ selection matrix.
1070+
We also need to make adjustments to our $T$ state transition matrix and $R$ selection matrix.
10711071

10721072
$$
10731073
T = \begin{bmatrix}1&0&\Delta t&0&\frac{\Delta t^{2}}{2}&0&1&0&1&0&1&0 \\ 0&1&0&\Delta t&0&\frac{\Delta t^{2}}{2}&0&1&0&1&0&1 \\ 0&0&1&0&\Delta t&0&0&0&0&0&0&0 \\ 0&0&0&1&0&\Delta t&0&0&0&0&0&0 \\ 0&0&0&0&1&0&0&0&0&0&0&0 \\ 0&0&0&0&0&1&0&0&0&0&0&0 \\ 0&0&0&0&0&0&1&0&0&0&0&0 \\ 0&0&0&0&0&0&0&1&0&0&0&0 \\ 0&0&0&0&0&0&0&0&1&0&0&0 \\ 0&0&0&0&0&0&0&0&0&1&0&0 \\ 0&0&0&0&0&0&0&0&0&0&1&0 \\ 0&0&0&0&0&0&0&0&0&0&0&1 \end{bmatrix}

0 commit comments

Comments
 (0)