Description Usage Arguments Value Note
View source: R/momentum_prediction.R
predicts next momentum for one asset
given previous prices according to LOAD
strategy (see paper mentioned in description of
backtest_LOAD
), momentu is defined in
evaluate_momentum_at_window
.
1 2 3 4 5 6 | predict_window_momentum_LOAD(
prev_prices,
regularization_factor,
momentum_threshold,
min_var = .Machine$double.eps^0.5
)
|
prev_prices |
a numeric vector of previous prices |
regularization_factor |
λ in the referenced paper, the regularization coeffecient for weight decay when regressing the prices in the recent time window. Must be non-negative |
momentum_threshold |
η in the referenced paper. If the regressed slope is greater than η we say the stock has momentum. This must be greater than 0. |
min_var |
(OPTIONAL) minimum variance to be determined non-constant |
the predicted next momentum (1 or 0)
NO TYPE CHECKING IS PERFORMED... be careful
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.