Hi,
I’m trying to fit a State Space Model with (stochastic) weekly seasonality and a linear local trend.
The transition equation for the hidden state is given by theta_t=G @ theta_t-1 + w_t
with G specified as below and w_t,i ~ N(0, sigma_w_i)
for i=1,2,3 and w_t,i = 0
for i>3.
G = [1, 1, 0, 0, 0, 0, 0, 0],
[0, 1, 0, 0, 0, 0, 0, 0],
[0, 0, -1, -1, -1, -1, -1, -1],
[0, 0, 1, 0, 0, 0, 0, 0],
[0, 0, 0, 1, 0, 0, 0, 0],
[0, 0, 0, 0, 1, 0, 0, 0],
[0, 0, 0, 0, 0, 1, 0, 0],
[0, 0, 0, 0, 0, 0, 1, 0]
I’ve used a Gamma(1,0.5)
prior for all sigma_w_i
i=1,…,8 but this often results in a non-psd covariance matrix.
What is the best way to specify a transition distribution for a GaussianHMM
?
Should I use a different prior? Or is there a better way?
Kind regards
beta21