Find optimal number of fourier variables
Searches through the model space to identify the best number of trigonometric variables, with the lowest AIC, AICc or BIC value.
find_opt( x, dates, H = NULL, AO = NULL, method = "additive", l.max = 12, k.max = 42, by = 6 )
x
: Numeric vector. Time series to seasonally adjustdates
: a vector of class "Date", containing the data datesH
: (optional) Matrix with holiday and trading day variablesAO
: (optional) Matrix with additive outlier variablesmethod
: Decomposition method: "additive" or "multiplicative". By default uses the additive methodl.max
: Maximal number of the monthly cycle variables to search for. By default is 12k.max
: Maximal number of the yearly cycle variables to search for. By default is 42by
: Step size in the search. By default is 6.list with the optimal number of (yearly and monthly) fourier variables according to AIC, AICc and BIC
data(gasoline.data) res=find_opt(x=gasoline.data$y,dates=gasoline.data$date) print(res)