Skip to content

Commit c1937b4

Browse files
committed
Correct documentation
1 parent 639aa14 commit c1937b4

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

pymc_extras/statespace/models/structural.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,22 +1104,22 @@ class TimeSeasonality(Component):
11041104
In this model, the state vector is defined as:
11051105
11061106
.. math::
1107-
\alpha_t :=(\gamma_t, \ldots, \gamma_{t-d(s-1)+1}), \quad t \ge 1.
1107+
\alpha_t :=(\gamma_t, \ldots, \gamma_{t-d(s-1)+1}), \quad t \ge 0.
11081108
11091109
This vector has length :math:`d(s-1)`, where:
11101110
11111111
- :math:`s` is the ``seasonal_length`` parameter, and
11121112
- :math:`d` is the ``duration`` parameter.
11131113
1114-
The components of the initial vector :math:`\alpha_{1}` are given by
1114+
The components of the initial vector :math:`\alpha_{0}` are given by
11151115
11161116
.. math::
1117-
\gamma_{1-l} := \tilde{\gamma}_{1+k_l}, \quad \text{where} \quad k_l := \left\lfloor \frac{l}{d} \right\rfloor \bmod s \quad \text{and} \quad l=0,\ldots, d(s-1)-1.
1117+
\gamma_{-l} := \tilde{\gamma}_{k_l}, \quad \text{where} \quad k_l := \left\lfloor \frac{l}{d} \right\rfloor \bmod s \quad \text{and} \quad l=0,\ldots, d(s-1)-1.
11181118
11191119
Here, the values
11201120
11211121
.. math::
1122-
\tilde{\gamma}_{1}, \ldots, \tilde{\gamma}_{s-1},
1122+
\tilde{\gamma}_{0}, \ldots, \tilde{\gamma}_{s-2},
11231123
11241124
represent the initial seasonal states. The transition matrix of this model is the :math:`d(s-1) \times d(s-1)` matrix
11251125
@@ -1139,17 +1139,17 @@ class TimeSeasonality(Component):
11391139
In contrast, the state vector in the second model is defined as:
11401140
11411141
.. math::
1142-
\alpha_t=(\gamma_t, \ldots, \gamma_{t-ds+1}), \quad t \ge 1.
1142+
\alpha_t=(\gamma_t, \ldots, \gamma_{t-ds+1}), \quad t \ge 0.
11431143
1144-
This vector has length :math:`ds`. The components of the initial state vector :math:`\alpha_{1}` are defined similarly:
1144+
This vector has length :math:`ds`. The components of the initial state vector :math:`\alpha_{0}` are defined similarly:
11451145
11461146
.. math::
1147-
\gamma_{1-l} := \tilde{\gamma}_{1+k_l}, \quad \text{where} \quad k_l := \left\lfloor \frac{l}{d} \right\rfloor \bmod s \quad \text{and} \quad l=0,\ldots, ds-1.
1147+
\gamma_{-l} := \tilde{\gamma}_{k_l}, \quad \text{where} \quad k_l := \left\lfloor \frac{l}{d} \right\rfloor \bmod s \quad \text{and} \quad l=0,\ldots, ds-1.
11481148
1149-
In this case, the initial seasonal states are required to satisfy the following condition:
1149+
In this case, the initial seasonal states :math:`\tilde{\gamma}_{0}, \ldots, \tilde{\gamma}_{s-1}` are required to satisfy the following condition:
11501150
11511151
.. math::
1152-
\sum_{i=1}^{s} \tilde{\gamma}_{i} = 0.
1152+
\sum_{i=0}^{s-1} \tilde{\gamma}_{i} = 0.
11531153
11541154
The transition matrix of this model is the following :math:`ds \times ds` circulant matrix:
11551155
@@ -1163,8 +1163,9 @@ class TimeSeasonality(Component):
11631163
\end{bmatrix}
11641164
11651165
To give interpretation to the :math:`\gamma` terms, it is helpful to work through the algebra for a simple
1166-
example. Let :math:`s=4`, :math:`d=1`, and omit the shock term. Define initial conditions :math:`\tilde{\gamma}_0, \tilde{\gamma}_{1},
1167-
\tilde{\gamma}_{2}`. The value of the seasonal component for the first 5 timesteps will be:
1166+
example. Let :math:`s=4`, :math:`d=1`, ``remove_first_state=True``, and omit the shock term. Then, we have
1167+
:math:`\gamma_{-i} = \tilde{\gamma}_{-i}`, for :math:`i=-2,\ldots, 0` and the value of the seasonal component
1168+
for the first 5 timesteps will be:
11681169
11691170
.. math::
11701171
\begin{align}

0 commit comments

Comments
 (0)