Open config-i1 opened 4 years ago
Don't rewrite the existing function, but see if an alternative can be developed based on that.
This involves a different state space structure: the function should look at the index of current observation and use the same index from the past in order to get the previous state. This will allow dealing with non-constant seasonalities.
This is relevant to m=24 because of the daylight saving and m=365 because of the leap years. The question is how to detect the change of indices in the data. Take from the y (e.g. zoo or POSIXct)? Or accept in lags somehow?
Potentially, this means that internally, instead of the vector of lags, we need to have a matrix, something like:
1 1 24 1 1 24 1 1 23 1 1 23 ... 1 1 24
What to do:
Is it possible not to have a matrix for lagrows? Maybe have two variables: vector of lags and the matrix of lags. If the latter is not provided, then use the first one? This way we will save some space for cases, when the matrix is not needed.
Work in progress. Things to do:
An alternative approach - abandon lags and use the seasonal profiles:
In order to do this, the following things need to be updated in the code:
Things to add / change:
All done for the basic time series without the time stamps.
An example. When lags=c(7,365), instead of having two components with respective lags, it should be done as one component with lags=7 and another with lags = 365/7...
In the ideal world a model should have "monthly", "weekly" and "daily" components for this situation. Not clear, how to get there from lags=c(7,365)...