sharm: Compute seasonal harmonic functions

Description Usage Arguments Details Value

View source: R/utils.R

Description

Returns orthogonal harmonic functions from degree 1 to 'degree' over a specified set of dates, such that all have a common period of 1 year. Based on the 'stats::poly' function.

Usage

1
sharm(t, degree = 1)

Arguments

t

a Date or POSIXt vector at which to evaluate the harmonic series.

degree

the degree of the highest-degree harmonic function

Details

returns a matrix with (2 * degree) columns, representing the powers-of-2 multiples of sin and cosine functions with 1-year period.

Useful for adding seasonal harmonic terms in regression functions. Uses 1 January as origin. Incorporates leap days exactly as 'lubridate::leap_year()'

Value

An object of class "sharm", which is a matrix with a 'degree' attribute corresponding to the maximum degree of the harmonic series.


markwh/rcmodel documentation built on May 21, 2019, 12:26 p.m.