within_month_regressors: Generate within-month effect regression matrix

View source: R/within_month_regressors.r

within_month_regressorsR Documentation

Generate within-month effect regression matrix

Description

Generates a regression matrix of within month effects from Cleveland and Scott to be included in weekly modeling routines

Usage

within_month_regressors(
  this_year,
  this_month,
  this_day,
  l = 30,
  return_xts = TRUE
)

Arguments

this_year

Numeric vector; Year of each observation.

this_month

Numeric vector; Month for each observation.

this_day

Numeric vector; Day of the month for each observation.

l

Numeric scalar; Number of sin-cos terms to generate, with the total number of regressors being 2*l. Default: 30.

return_xts

Logical scalar; return matrix as an xts time series object. Default is FALSE.

Value

Generate matrix of within month effects regressors, with column names that describe the individual regressors

Examples

ic_wm_matrix_1992 <-
   within_month_regressors(ic_year, ic_month, ic_day, return_xts = FALSE)
cc_wm_matrix_xts <-
   within_month_regressors(cc_year_xts, cc_month_xts, cc_day_xts, 
                           return_xts = TRUE)

bcmonsell/airutilities documentation built on May 16, 2022, 3:23 p.m.