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 Yt at time t is:

Yt=β0+∑j=1kαjcos(fjt)+∑j=1kγjsin(fjt)+ϵt.

And we can code this in R as:

lm(y ~ sin(2*pi*t/P) + cos(2*pi*t/P))

Advantages