| make_labels | R Documentation |
Compute forward returns over a fixed horizon and align them to the decision date.
make_labels(prices, horizon = 4L, type = c("log", "simple", "sign"))
prices |
Wide price panel ( |
horizon |
Integer |
type |
Character, one of |
For each date t, the label is computed from prices at t and t + h.
type = "simple": p_{t+h}/p_t - 1
type = "log": \log(p_{t+h}) - \log(p_t)
type = "sign": sign(simple return)
Trailing dates that do not have horizon steps ahead are set to NA.
A data.table with Date + symbols containing the labels.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.