To make sure my findings on the fourier series is not lost in some random PR I gather them here as per @veni-vidi-vici-dormivi suggestion :wink:
The fourier series is related to the fft: minimizing the least squares difference of a fourier series yields the "same" (by a scaling factor) coefficients as an fft.
The fft does not have any covariates (in contrast to our approach of the fourier series) - so we cannot use fft instead of our minimization.
However, we could use the fft to get a better first guess for the constant part of our fourier series.
We test for each order if it minimizes the BIC. However, we don't test if adding the covariates does so. I am not 100% sure how to best do that... Maybe "order 1, no covariates", "order 1, covariates", etc.. But let's say if "order 2, covariates" does not provide additional benefit - do we stop or do we test "order 3, no covariates"? No idea...
To make sure my findings on the fourier series is not lost in some random PR I gather them here as per @veni-vidi-vici-dormivi suggestion :wink:
For points 1 through 3: see https://github.com/MESMER-group/mesmer/pull/512#issuecomment-2321208656