fourier_vars function

Create fourier predictors

Create fourier predictors

Creates sine and cosine variables to capture intramonthly and intrayearly cycles.

fourier_vars(k = 1, l = 1, dates)

Arguments

  • k: Number of pairs of the yearly cycle trigonometric variables
  • l: Number of pairs of the monthly cycle trigonometric variables
  • dates: Vector of dates in a date format

Returns

Matrix with fourier variables

Examples

# create a vector of dates dates=seq.Date(from=as.Date("2023-01-02"),by="weeks",length.out = 100) # Create a matrix with 20 yearly and 6 monthly pairs of sine and cosine variables X=fourier_vars(k=20,l=6,dates=dates)
  • Maintainer: Tim Ginker
  • License: MIT + file LICENSE
  • Last published: 2025-02-05