ramp_variable | R Documentation |
Ramp regressor
ramp_variable(frequency, start, length, s, range)
frequency |
Frequency of the series, number of periods per year (12,4,3,2..) |
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\geq t_0 \\
\frac{t-t_0}{t_1-t_0}-1 & t_0< t < t_1 \\
0 & t \leq t_1
\end{cases}
# Ramp variable from January 2001 to September 2001
rp <- ramp_variable(12, c(2000, 1), length = 12 * 4, range = c(13, 21))
# Or equivalently
rp <- ramp_variable(12, c(2000, 1), length = 12 * 4, range = c("2001-01-01", "2001-09-02"))
plot.ts(rp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.