I am working on learning state space models and am leaning heavily on this very helpful documentation. However, I’m really confused about the best way to include both a seasonal effect and dynamic regressors into the model.
Let’s further assuming that I want to use a simulation smoother to estimate the coefficients on the dynamic regressors, so I won’t be estimating the coefficients in the model
block
My initial thought was to do something like the following (with the seasonal effect specified as dummy variables that sum to 1)
y ~ normal(seasonal_effect, sigma)
y_prime = y - seasonal_effect
target += ssm_lpdf(y_prime | ...) // system matrices go here
The issue that I’m having with this specification is that:
- It doesn’t estimate any kind of seasonal effect even though my model clearly has one
- It’s estimating the dynamic linear model and the seasonal effect separately when they should seemingly be estimated together
From the available literature it seems that I should be able to code the seasonal effect directly into the system matrices, but I have no idea how.
- If I put the seasonal dummies into the
Z
(orF
, depending on the literature) design matrix, they are treated as a dynamic regressor, unless… - I restrict the state selection covariance matrix to only allow the non-seasonal dummies to evolve over time, but then the state estimates that I get from the seasonal dummies stay fixed at the values that I pass into the simulation smoother (as
a1
)
The libraries and models that I’m working with are very very clear once you have the system matrices specified, but I am lost on how to include seasonal effects into the system matrices of the dynamic linear model
Any help would be appreciated!