Skip to content

Commit e44e2e7

Browse files
committed
attempt to fix latex rendering
1 parent 5bfc16b commit e44e2e7

File tree

2 files changed

+348
-122
lines changed

2 files changed

+348
-122
lines changed

examples/case_studies/ssm_hurricane_tracking.ipynb

Lines changed: 206 additions & 93 deletions
Large diffs are not rendered by default.

examples/case_studies/ssm_hurricane_tracking.myst.md

Lines changed: 142 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,14 @@ myst:
2828
In this case study we are going to forecast the paths of hurricanes by applying several State Space Models (SSM). We will begin with a simple two-dimensional constant acceleration tracking model, where we only have one parameter to estimate. Subsequently, we will progressively add complexity and parameters as we develop up our model.
2929

3030
As a brief introduction to SSMs, the general idea is that we define our system using two equations.<br>
31-
The state equation [1] and the observation equation [2]. $$x_{t+1} = A_{t}x_{t} + c_{t} + R_{t}\epsilon_{t} \quad [1]$$ $$y_{t} = Z_{t}x_{t} + d_{t} + \eta_{t} \quad [2] $$
31+
The state equation [1] and the observation equation [2].
32+
$$
33+
x_{t+1} = A_{t}x_{t} + c_{t} + R_{t}\epsilon_{t} \quad [1]
34+
$$
35+
36+
$$
37+
y_{t} = Z_{t}x_{t} + d_{t} + \eta_{t} \quad [2]
38+
$$
3239

3340
The process/state covariance is given by $\epsilon_{t} \sim N(0, Q_{t})$ where $Q_{t}$ is the process/state innovations and the observation/measurement covariance is given by $\eta_{t} \sim N(0, H_{t})$ where $H_{t}$ describes the uncertainty in the measurement device or measurement procedure.
3441

@@ -675,39 +682,81 @@ The simplest state space model for tracking an object in 2-dimensional space is
675682
Let us begin by defining our matrices/vectors.
676683

677684
As a reminder the observation equation and the state equation define our linear system.
678-
$$y_{t} = Z_{t}x_{t} + d_{t} + \eta_{t}$$
679-
$$x_{t+1} = T_{t}x_{t} + c_{t} + R_{t}\epsilon_{t}$$
685+
$$
686+
y_{t} = Z_{t}x_{t} + d_{t} + \eta_{t}
687+
$$
688+
689+
$$
690+
x_{t+1} = T_{t}x_{t} + c_{t} + R_{t}\epsilon_{t}
691+
$$
692+
680693
In this case we are assuming there is no state or observation intercepts ($c_{t} = 0$, $d_{t} = 0$). I will also drop the $t$ subscript over matrices that are fixed (do not change over time).
681694

682695
Our states are the following components derived from the Newtonian equations of motion.
683-
$$x_{t} = \begin{bmatrix}longitude_{t} \\ latitude_{t} \\ longitude\_velocity_{t} \\ latitude\_velocity_{t} \\ longitude\_acceleration_{t} \\ latitude\_acceleration_{t} \end{bmatrix}$$
696+
697+
$$
698+
x_{t} = \begin{bmatrix}longitude_{t} \\ latitude_{t} \\ longitude\_velocity_{t} \\ latitude\_velocity_{t} \\ longitude\_acceleration_{t} \\ latitude\_acceleration_{t} \end{bmatrix}
699+
$$
684700

685701
In order for our system to evolve in accordance with Newtonian motion our transitioin matrix is defined as:
686-
$$T = \begin{bmatrix}1&0&\Delta t&0&\frac{\Delta t^{2}}{2}&0 \\ 0&1&0&\Delta t&0&\frac{\Delta t^{2}}{2} \\ 0&0&1&0&\Delta t&0 \\ 0&0&0&1&0&\Delta t \\ 0&0&0&0&1&0 \\ 0&0&0&0&0&1 \end{bmatrix}$$
702+
703+
$$
704+
T = \begin{bmatrix}1&0&\Delta t&0&\frac{\Delta t^{2}}{2}&0 \\ 0&1&0&\Delta t&0&\frac{\Delta t^{2}}{2} \\ 0&0&1&0&\Delta t&0 \\ 0&0&0&1&0&\Delta t \\ 0&0&0&0&1&0 \\ 0&0&0&0&0&1 \end{bmatrix}
705+
$$
687706

688707
The following design matrix tells us that only the positions ($longitude_{t}$ and $latitude_{t}$) are observed states
689-
$$Z = \begin{bmatrix}1&0&0&0&0&0 \\ 0&1&0&0&0&0 \end{bmatrix}$$
708+
709+
$$
710+
Z = \begin{bmatrix}1&0&0&0&0&0 \\ 0&1&0&0&0&0 \end{bmatrix}
711+
$$
690712

691713
The selection matrix is defined as the identity allowing the process/state covariance to affect all of our states.
692-
$$R = I$$
714+
715+
$$
716+
R = I
717+
$$
718+
693719
Where
694-
$$\epsilon_{t} \sim N(0, Q)$$
695-
$$\eta_{t} \sim N(0, H)$$
720+
721+
$$
722+
\epsilon_{t} \sim N(0, Q)
723+
$$
724+
725+
$$
726+
\eta_{t} \sim N(0, H)
727+
$$
696728

697729
In this example we fix our observation/measurement error to a small value (0.5) reflecting our confidence in the measurements. Here we are assuming that our measuring instrument is fairly accurate and that it may be off by $\sqrt{0.5} \approx 0.7$ degrees.
698-
$$H = \begin{bmatrix} 0.5&0 \\ 0&0.5\end{bmatrix}$$
730+
731+
$$
732+
H = \begin{bmatrix} 0.5&0 \\ 0&0.5\end{bmatrix}
733+
$$
699734

700735
and finally, the state/process covariance matrix that is derived from using Newtonian motion is as follows:
701736

702-
$$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}$$
737+
$$
738+
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}
739+
$$
703740

704741
Let's briefly go over how we came about our $A$ and $Q$ matrices.
705742

706743
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:
707-
$$\hat{y}_{longitude_{t+1}} = longitude_{t} + longitude\_velocity_{t}\Delta t + \frac{longitude\_acceleration_{t}\Delta t^{2}}{2} $$
744+
745+
$$
746+
\hat{y}_{longitude_{t+1}} = longitude_{t} + longitude\_velocity_{t}\Delta t + \frac{longitude\_acceleration_{t}\Delta t^{2}}{2}
747+
$$
748+
708749
This is the Newtonian motion equation of position. Where the new position is the old position plus the change in velocity plus the change in acceleration. The rest of the equations can be derived by completing all the entries of the matrix vector multiplication of the observation equation.
709750

710-
The process/state covariance matrix $Q$ is just the variance (diagonals) covariance (off-diagonals) of the Newtonian equations. For example, the variance of the longitudinal position entry is: $$Var(longitude_{t}) = Var(longitude_{t} + longitude\_velocity_{t}\Delta t + \frac{longitude\_acceleration_{t}\Delta t^{2}}{2}) = Var(\frac{longitude\_acceleration_{t}\Delta t^{2}}{2}) $$ $$= \frac{\Delta t^{4}}{4}Var(longitude\_acceleration_{t}) = \frac{\Delta t^{4}}{4}\sigma_{a}^{2} $$
751+
The process/state covariance matrix $Q$ is just the variance (diagonals) covariance (off-diagonals) of the Newtonian equations. For example, the variance of the longitudinal position entry is:
752+
753+
$$
754+
Var(longitude_{t}) = Var(longitude_{t} + longitude\_velocity_{t}\Delta t + \frac{longitude\_acceleration_{t}\Delta t^{2}}{2}) = Var(\frac{longitude\_acceleration_{t}\Delta t^{2}}{2})
755+
$$
756+
757+
$$
758+
= \frac{\Delta t^{4}}{4}Var(longitude\_acceleration_{t}) = \frac{\Delta t^{4}}{4}\sigma_{a}^{2}
759+
$$
711760

712761
Where in this case we assume the same stochastic innovations on the acceleration term in both dimensions. You can derive the rest of the entries in $Q$ by taking the variance or covariance of the Newtonian equations.
713762

@@ -718,11 +767,33 @@ We can also derive the Newtonian equations of motion from a system of ordinary d
718767
2. $\dot{v}(t) = a(t)$
719768
3. $\dot{a}(t) = 0$
720769

721-
our state vector (in one dimension) $$x_{t} = \begin{bmatrix}p(t) \\ v(t) \\ a(t) \end{bmatrix} $$ and our ODE system becomes $$\frac{d}{dt} \begin{bmatrix}p(t) \\ v(t) \\a(t) \end{bmatrix} = \begin{bmatrix}v(t) \\ a(t) \\ 0 \end{bmatrix} $$
770+
our state vector (in one dimension)
771+
772+
$$
773+
x_{t} = \begin{bmatrix}p(t) \\ v(t) \\ a(t) \end{bmatrix} $$ and our ODE system becomes $$\frac{d}{dt} \begin{bmatrix}p(t) \\ v(t) \\a(t) \end{bmatrix} = \begin{bmatrix}v(t) \\ a(t) \\ 0 \end{bmatrix}
774+
$$
722775

723-
Now we integrate our system over $\Delta{t}$ and we have $$p(t + \Delta{t}) = p(t) + \int_{t}^{t + \Delta{t}}v(t')dt'$$ assuming that the change in time is small and that the change in velocity is negligible we can approximate the integrals using the forward Euler method and get $$p(t + \Delta{t}) \approx p(t) + v(t)\Delta{t} $$ integrating the rest of our system equations using the same methodology we find that $$ v(t + \Delta{t}) \approx v(t) + a(t)\Delta{t} $$ $$ a(t + \Delta{t}) = a(t) $$
776+
Now we integrate our system over $\Delta{t}$ and we have $$p(t + \Delta{t}) = p(t) + \int_{t}^{t + \Delta{t}}v(t')dt'$$ assuming that the change in time is small and that the change in velocity is negligible we can approximate the integrals using the forward Euler method and get
724777

725-
We can now express our system of equations over a time interval $\Delta{t}$ as $$ \begin{bmatrix}p(t + \Delta{t}) \\ v(t + \Delta{t}) \\ a(t + \Delta{t}) \end{bmatrix} = \begin{bmatrix}p(t) \\ v(t) \\ a(t) \end{bmatrix} + \Delta{t} \begin{bmatrix}v(t) \\ a(t) \\ 0 \end{bmatrix} $$
778+
$$
779+
p(t + \Delta{t}) \approx p(t) + v(t)\Delta{t}
780+
$$
781+
782+
integrating the rest of our system equations using the same methodology we find that
783+
784+
$$
785+
v(t + \Delta{t}) \approx v(t) + a(t)\Delta{t}
786+
$$
787+
788+
$$
789+
a(t + \Delta{t}) = a(t)
790+
$$
791+
792+
We can now express our system of equations over a time interval $\Delta{t}$ as
793+
794+
$$
795+
\begin{bmatrix}p(t + \Delta{t}) \\ v(t + \Delta{t}) \\ a(t + \Delta{t}) \end{bmatrix} = \begin{bmatrix}p(t) \\ v(t) \\ a(t) \end{bmatrix} + \Delta{t} \begin{bmatrix}v(t) \\ a(t) \\ 0 \end{bmatrix}
796+
$$
726797

727798
Which when you write out the matrix vector multiplications will yield the Newtonian equations of motion.
728799

@@ -953,27 +1024,45 @@ plot_model_evaluations(
9531024

9541025
# Adding Deterministic Covariates/Exogenous Variables
9551026
In our dataset we have variables that aren't a part of the Newtonian system process, but may carry information that we can leverage to better track the path of the hurricane. We have two options when introducing these exogenous variables into our model. We can add them in as time invariant or time-varying variables. In our case, we are going to add exogenous variables as time invariant. Our aim then is to model our observations as:
956-
$$\hat{y}_{longitude_{t+1}} = longitude_{t} + longitude\_velocity_{t}\Delta t + \frac{longitude\_acceleration_{t}\Delta t^{2}}{2} + \beta_{exogenous_{longitude}} exogenous\_data$$
9571027

958-
$$\hat{y}_{latitude_{t+1}} = latitude_{t} + latitude\_velocity_{t}\Delta t + \frac{latitude\_acceleration_{t}\Delta t^{2}}{2} + \beta_{exogenous_{latitude}} exogenous\_data$$
1028+
$$
1029+
\hat{y}_{longitude_{t+1}} = longitude_{t} + longitude\_velocity_{t}\Delta t + \frac{longitude\_acceleration_{t}\Delta t^{2}}{2} + \beta_{exogenous_{longitude}} exogenous\_data
1030+
$$
1031+
1032+
$$
1033+
\hat{y}_{latitude_{t+1}} = latitude_{t} + latitude\_velocity_{t}\Delta t + \frac{latitude\_acceleration_{t}\Delta t^{2}}{2} + \beta_{exogenous_{latitude}} exogenous\_data
1034+
$$
9591035

9601036
The `max_wind` variable measures the maximum sustained surface wind at 10 meter elevations and is a uni-dimensional measure (i.e not measured in terms of longitude and latitude). Therefore, we are going to use the same data to estimate two-parameters $\beta_{wind_{longitude}}$ and $\beta_{wind_{latitude}}$. This is less than ideal but demonstrates how to add exogenous variables to a `StateSpace` model.
9611037

9621038
The `min_pressure` variable measures the minumum central pressure. The lower the central pressure, typically, the more intense the hurricane. This variable again is only measured in one dimension, so we will handle that the same way we are handling it for `max_wind`.
9631039

9641040
Finally, we will also include the interaction between the maximum sustained surface wind and the minimum central pressure.
9651041

966-
In order to put this in matrix form, we are going to add the newly added $\beta$ parameters to our state vector and we will add the corresponding measured `wind_speed`, `min_pressure`, and `interaction_wind_pressure` data into the design matrix. So our new state vector will be: $$x_{t} = \begin{bmatrix}longitude_{t} \\ latitude_{t} \\ longitude\_velocity_{t} \\ latitude\_velocity_{t} \\ longitude\_acceleration_{t} \\ latitude\_acceleration_{t} \\ \beta_{wind_{longitude}} \\ \beta_{wind_{latitude}} \\ \beta_{pressure_{longitude}} \\ \beta_{pressure_{latitude}} \\ \beta_{wind\_pressure_{longitude}} \\ \beta_{wind\_pressure_{latitude}} \end{bmatrix} $$
1042+
In order to put this in matrix form, we are going to add the newly added $\beta$ parameters to our state vector and we will add the corresponding measured `wind_speed`, `min_pressure`, and `interaction_wind_pressure` data into the design matrix. So our new state vector will be:
1043+
1044+
$$
1045+
x_{t} = \begin{bmatrix}longitude_{t} \\ latitude_{t} \\ longitude\_velocity_{t} \\ latitude\_velocity_{t} \\ longitude\_acceleration_{t} \\ latitude\_acceleration_{t} \\ \beta_{wind_{longitude}} \\ \beta_{wind_{latitude}} \\ \beta_{pressure_{longitude}} \\ \beta_{pressure_{latitude}} \\ \beta_{wind\_pressure_{longitude}} \\ \beta_{wind\_pressure_{latitude}} \end{bmatrix}
1046+
$$
1047+
1048+
and our design matrix will be:
9671049

968-
and our design matrix will be: $$ Z' = \begin{bmatrix} Z & X_{exogenous\_data} \end{bmatrix} $$ Where $Z$ is our previously defined design matrix and $X_{exogenous}$ is the measured `wind_speed`, `minimum_pressure`, and `interaction_wind_pressure` exogenous data.
1050+
$$
1051+
Z' = \begin{bmatrix} Z & X_{exogenous\_data} \end{bmatrix}
1052+
$$
1053+
1054+
Where $Z$ is our previously defined design matrix and $X_{exogenous}$ is the measured `wind_speed`, `minimum_pressure`, and `interaction_wind_pressure` exogenous data.
9691055

9701056
We also need to make adjustments to our $A$ state transition matrix and $R$ selection matrix.
9711057

972-
$$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}$$
1058+
$$
1059+
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}
1060+
$$
9731061

9741062
The last 2 columns we added indicates what states our exogenous variables affect, and the last 2 rows indicate that the processes of our exogenous parameters are constant.
9751063

976-
$$R = \begin{bmatrix} 1&0&0&0&0&0 \\
1064+
$$
1065+
R = \begin{bmatrix} 1&0&0&0&0&0 \\
9771066
0&1&0&0&0&0 \\
9781067
0&0&1&0&0&0 \\
9791068
0&0&0&1&0&0 \\
@@ -985,7 +1074,8 @@ $$R = \begin{bmatrix} 1&0&0&0&0&0 \\
9851074
0&0&0&0&0&0 \\
9861075
0&0&0&0&0&0 \\
9871076
0&0&0&0&0&0
988-
\end{bmatrix}$$
1077+
\end{bmatrix}
1078+
$$
9891079

9901080
The additions to the R matrix imply that the exogenous parameters do not exhibit any process innovations.
9911081

@@ -1435,19 +1525,42 @@ exog_data = np.column_stack((np.asarray(B_longitude, order="F"), np.asarray(B_la
14351525

14361526
Our new models' structure is going to be similar to our last model that had exogenous variables. However, in this case our data are going to be the basis functions we created earlier. These will be inserted into our design matrix ($Z$) and the beta parameters corresponding to each spline will be added to our state vector ($x_{t}$). Again, these parameters will be constant (non-time varying). We will also have to adjust our transition matrix ($T$) and selection matrix ($R$) similar to how we did previously. We will now have:
14371527

1438-
$$\hat{y}_{longitude_{t+1}} = longitude_{t} + longitude\_velocity_{t}\Delta t + \frac{longitude\_acceleration_{t}\Delta t^{2}}{2} + \beta_{spline\_params_{longitude}} longitude\_spline\_basis\_functions$$
1528+
$$
1529+
\hat{y}_{longitude_{t+1}} = longitude_{t} + longitude\_velocity_{t}\Delta t + \frac{longitude\_acceleration_{t}\Delta t^{2}}{2} + \beta_{spline\_params_{longitude}} longitude\_spline\_basis\_functions
1530+
$$
1531+
1532+
$$
1533+
\hat{y}_{latitude_{t+1}} = latitude_{t} + latitude\_velocity_{t}\Delta t + \frac{latitude\_acceleration_{t}\Delta t^{2}}{2} + \beta_{spline\_params_{latitude}} latitude\_spline\_basis\_functions
1534+
$$
1535+
1536+
our design matrix will be:
1537+
1538+
$$
1539+
Z' = \begin{bmatrix} Z & X_{basis\_functions} \end{bmatrix}
1540+
$$
14391541

1440-
$$\hat{y}_{latitude_{t+1}} = latitude_{t} + latitude\_velocity_{t}\Delta t + \frac{latitude\_acceleration_{t}\Delta t^{2}}{2} + \beta_{spline\_params_{latitude}} latitude\_spline\_basis\_functions$$
1542+
Where $Z$ is our previously defined design matrix and $X_{exogenous}$ are the basis functions we defined earlier.
14411543

1442-
our design matrix will be: $$ Z' = \begin{bmatrix} Z & X_{basis\_functions} \end{bmatrix} $$ Where $Z$ is our previously defined design matrix and $X_{exogenous}$ are the basis functions we defined earlier.
1544+
Our transition matrix will be
14431545

1444-
Our transition matrix will be $$T' = \begin{bmatrix} T & F \\ 0 & I_{n\_spline\_params} \end{bmatrix} $$
1546+
$$
1547+
T' = \begin{bmatrix} T & F \\ 0 & I_{n\_spline\_params} \end{bmatrix}
1548+
$$
14451549

14461550
Where $T$ is the transition matrix defined for the Newtonian kinematics (the top-left 6x6 block in our previous model)
1447-
and $$ F = \begin{bmatrix} 1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0 \\ 0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1 \\ 0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0 \\ 0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0 \\ 0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0 \\ 0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0 \end{bmatrix} $$
1551+
and
1552+
1553+
$$
1554+
F = \begin{bmatrix} 1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0 \\ 0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1&0&1 \\ 0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0 \\ 0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0 \\ 0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0 \\ 0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0 \end{bmatrix}
1555+
$$
1556+
14481557
and the 0 in the matrix above is a matrix of 0s of shape (number of spline parameters by number of spline parameters)
14491558

1450-
Finally, we have $$R' = \begin{bmatrix} R \\ 0 \end{bmatrix} $$
1559+
Finally, we have
1560+
1561+
$$
1562+
R' = \begin{bmatrix} R \\ 0 \end{bmatrix}
1563+
$$
14511564

14521565
Where R is the selection matrix over our endogenous states (identity matrix of shape (number of states))
14531566
and again the 0 in the matrix is a matrix of 0s with shape (number of spline parameters by number of states)

0 commit comments

Comments
 (0)