Harmonic regression
Gist
You got some seasonal curves (aka Disease- RSV), then harmonic regression could be one method. It’s also called dynamic harmonic regression.
Definition
We know from Fourier Transformation that any curve can be explained by a sum of sine and cosine waves. Therefore, the harmonic regression for the dependent variable
And we can code this in R as:
lm(y ~ sin(2*pi*t/P) + cos(2*pi*t/P))
Advantages
- It allows any length seasonality
- For data with more than one seasonal period, Fourier terms of different frequencies can be included;
- The smoothness of the seasonal pattern can be controlled by K, the number of Fourier sin and cos pairs – the seasonal pattern is smoother for smaller values of K;
- The short-term dynamics are easily handled with a simple ARMA error.