powered by
The cyclic basis function for modelling seasonal effects
cyclic_basis(var, order = 3, frequency)
a numeric_var object
numeric_var
the order of the basis function
frequency
cyclic_basis returns a set of sin and cosine functions for modelling seasonal effects, see basefun::Held_Paul_2012, Section 2.2.
cyclic_basis
For any choice of coefficients, the function returns the same value when evaluated at multiples of frequency.
*
### set-up basis cb <- cyclic_basis(numeric_var("x"), order = 3, frequency = 2 * pi) ### generate data + coefficients x <- data.frame(x = c(0, pi, 2 * pi)) ### f(0) = f(2 * pi) cb(x)
Run the code above in your browser using DataLab