fourier_vars | R Documentation |
Creates sine and cosine variables to capture intramonthly and intrayearly cycles.
fourier_vars(k = 1, l = 1, dates)
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 |
Matrix with fourier variables
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.