Understanding Fourier for Seasonality
问题 I am using the auto.arima from the forecast package in R to determine the optimal K-terms for fourier series. After I do that, I want to then calculate the seasonality and plug that one seasonality variable into a multiple regression model. Using the dataset from the forecast package, I was able to extract the optimal amount of fourier terms: library(forecast) ##Public dataset from the forecast package head(gas) ##Choose Optimal Amount of K-Terms bestfit <- list(aicc=Inf) for(i in 1:6) { fit