fourier_vars: Create fourier predictors

View source: R/fourier_vars.R

fourier_varsR Documentation

Create fourier predictors

Description

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

Usage

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

Value

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)


boiwsa documentation built on April 4, 2025, 1:57 a.m.