Search code examples
rtime-serieskalman-filterstate-spacestructural-equation-model

Changing seasonality over time in structural model using KFAS package in R


I have a time series for which I want to adjust a structural model (trend, seasonal and cycle) using KFAS. However, seasonality starts at a certain point in time. Say, the time series ranges monthly from january 2000 through august 2022, but seasonality starts in 2011. Is there a way to capture such behavior in the series without splitting the data at that point?

I have already tried splitting the time series, but I would like a unified model. I am using KFAS in R for the estimation, though I have used also autostm for automatic structural models. Even though they achieve an appropriate fit (even for the whole time series), I think it can be improved with this idea. I thought I could us a regressor on the seasonality but I couldn't find how.


Solution

  • Are you using SSModel with a formula input? You could try adding a seasonality term to your data and add the seasonality term to the right-hand side of ~ in the formula.