td: Usual trading days variables

View source: R/calendars.R

tdR Documentation

Usual trading days variables

Description

Usual trading days variables

Usage

td(
  frequency,
  start,
  length,
  s,
  groups = c(1, 2, 3, 4, 5, 6, 0),
  contrasts = TRUE
)

Arguments

frequency

Annual frequency (divisor of 12).

start, length

First date (array with the first year and the first period) (for instance c(1980, 1)) and number of periods of the output variables. Can also be provided with the s argument

s

time series used to get the dates for the trading days variables. If supplied the parameters frequency, start and length are ignored.

groups

Groups of days. The length of the array must be 7. It indicates to what group each week day belongs. The first item corresponds to Mondays and the last one to Sundays. The group used for contrasts (usually Sundays) is identified by 0. The other groups are identified by 1, 2,... n (<= 6). For instance, usual trading days are defined by c(1,2,3,4,5,6,0), week days by c(1,1,1,1,1,0,0), week days, Saturdays, Sundays by c(1,1,1,1,1,2,0) etc...

contrasts

If true, the variables are defined by contrasts with the 0-group. Otherwise, raw number of days are provided

Value

The variables corresponding to each group, starting with the 0-group (contrasts = FALSE) or the 1-group (contrasts = TRUE).


palatej/rjd3modelling documentation built on Jan. 3, 2023, 10:19 p.m.