Compute forward returns over a fixed horizon and align them to the decision date.
make_labels(prices, horizon = 4L, type = c("log", "simple", "sign"))A data.table with Date + symbols containing the labels.
Wide price panel (Date + symbols).
Integer >= 1, number of forward steps for the label.
Character, one of "log", "simple", "sign".
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.