ramp.variable | R Documentation |
Ramp regressor
ramp.variable(frequency, start, length, s, range)
frequency |
Annual frequency (divisor of 12). |
start, length |
First date (array with the first year and the first period)
(for instance |
s |
time series used to get the dates for the trading days variables. If supplied the
parameters |
range |
the range of the regressor. A vector of length 2 containing the datesin the format |
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}
# 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"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.