I'm studying a time series with clear seasonality at a daily and weekly period. However, the series is aggregated in 15-min (.25-hour) timesteps, and thus the daily and weekly periods are 96 and 672, respectively. Due to the nature of this particular problem, further aggregation at a larger timescale is not desirable, so let's say we're stuck with these perhaps large periods.
Let me first mention that, ostensibly due to the large period 672, even obtaining the usual fit hangs, abort can't seem to intervene, and I end up quitting the kernel:
p=d=q=sp=sd=sq=Automatic;
modtest=TimeSeriesModelFit[ data, {"SARIMA", {{p, d, q}, {sp, sd, sq}, #}}] & /@ {96,672}
although 96 alone works fine.(* SARMA {{4,1},{0,3},96} *)
. The AIC for this 96-model is significantly lower than that of mere TimeSeriesModelFit[data];
, as well.
Therefore, both because the 672 period cannot be found with TimeSeriesModelFit
and in order to model multiple seasonality in time series generally, I would like to implement the standard technique of including Fourier terms with period 96 and with 672 as so-called external regressors, as explained here and here.
To be honest, my initial approach was to use RLink[]
to achieve this, but issues surrounding loading additional R packages on Mac stymied the operation. I'm now reaching out to see if anyone has idea on how to do this directly, within Mathematica. For example, is it possible to "force" TimeSeriesModelFit
to fit to a known process plus some additional functions, e.g., ARMA[p,q]+f1+f2
, where f1, f2
are Fourier terms analogous to external regressors in R.
Or, is it possible to somehow use ARMAProcess
as a valid argument in LinearModelFit
?
Any ideas are welcome. Thanks!
Attachments: