ramp.variable: Ramp regressor

View source: R/variables.R

ramp.variableR Documentation

Ramp regressor

Description

Ramp regressor

Usage

ramp.variable(frequency, start, length, s, range)

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.

range

the range of the regressor. A vector of length 2 containing the datesin the format "YYYY-MM-DD" or the position in period compared to the first date.

Details

A ramp between two dates t_0 and t_1 is defined as:

RP_t= \begin{cases} -1 & \text{if }t≥q t_0 \newline \frac{t-t_0}{t_1-t_0}-1 & t_0< t < t_1 \newlin 0 & t ≤q t_1 \end{cases}

Examples

# Ramp variable from January 2001 to September 2001
ramp.variable(12, c(2000,1), length = 12*4, range = c(13, 21))
# Or equivalently
ramp.variable(12, c(2000,1), length = 12*4, range = c("2001-01-01", "2001-09-02"))

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