Solved – dlmForecast function in dlm R package forecasting constant values for seasonal series

dlmforecastingrseasonality

I have a question regarding the use of the dlm CRAN package for forecasting values of a seasonal time series.

I've built a dlm model combining a stochastic local level model with a stochastic trigonometric (Fourier representation) seasonal component of period 96 (measurements every 15 mins with a daily cycle).

I used dlmMLE to estimate the parameters for my data and filtered and smoothed the series which all seems to be working fine.

However, when I try to use the dlmForecast function to predict out-of-sample observations, the predictions stay constant. The value of all "predictions" are equal to the sum of the filtered level and filtered seasonal components for the final observation in the series.

I have used dlmForecast with several other models including a model with a seasonal factor component but never before with a trigonometric seasonal component.

I notice in the documentation for dlmForecast it says "Currently, only constant models are allowed" so I wonder if this applies to trigonometric seasonal models.

Best Answer

I can give you two hints.

First, if you are using the standard recursive form (e.g. from Harvey) of the trigonometric seasonal components then your model is probably considered constant. Constant refers to the transition, observation matrices, not the state itself. In dlm terms, you have a constant model if you are not using the "J" components like JGG or JFF (if I remember correctly).

Second, when you say the filtering and smoothing are working out OK are you looking at the unobserved state and making sure that the periodic component (\psi) and trend (\mu) are independently sensible-looking?

Related Question