baggepinnen / SingularSpectrumAnalysis.jl

A package for performing Singular Spectrum Analysis (SSA) and time-series decomposition
Other
63 stars 5 forks source link

Equivalent to `fit_trend` but for seasonality? #27

Open KevinG1002 opened 3 weeks ago

KevinG1002 commented 3 weeks ago

Hello,

I noted the existence of the function fit_trend that returns a regressor matrix and polynomial coefficients of some pre-specified order n. I was wondering if a similar function existed to fit for seasonality? When using the analyze function, how are the periodic signals extracted?

Best,

Kevin

baggepinnen commented 3 weeks ago

The seasonality is captured by the autoregressive models

KevinG1002 commented 2 weeks ago

What do you exactly mean by that? I guess my question was not specific enough: I recall that when running analyze a Matrix was returned with points belonging to the seasonal component extracted from the original signal passed into analyze. I understand the autoregressive models capture these but is there a way within your framework to extract the parametric values that yield these seasonal components so that one could potentially manipulate these and/or plot seasonal components several forecasting steps ahead?

Thanks,

Kevin

baggepinnen commented 2 weeks ago

The PredictionData structure looks like this

mutable struct PredictionData
    trend_parameters
    trend_regressor
    seasonal_models
    seasonal_predictions
end

the seasonal_models contain AR models from which you can get the parameters using the function ControlSystemsBase.denvec. The AR models themselves are transfer functions from ControlSystemsBase and they are estimated using ControlSystemIdentification.jl.