Learn R Programming

tsaux (version 1.0.0)

fourier_series: Fourier terms for modeling seasonality

Description

Returns a matrix containing terms from a Fourier series, up to order K

Usage

fourier_series(dates, period = NULL, K = NULL)

Value

A matrix of size N (length of dates) by 2*K.

Arguments

dates

a Date vector representing the length of the series for which the fourier terms are required.

period

frequency of the underlying series, if NULL will try to infer it from the difference in the Date vector.

K

maximum order of the Fourier terms.