Description Usage Arguments Value
View source: R/momentum_prediction.R
See regularized_pocket()
for a description of the
algorithm used.
Either uses the weight_elimination
constant given
or cross-validates at each trading period to choose one of
the selected.
If there is at least one cv asset,
then each stage runs once with previous weights and once from linear
regression weights, then picks whichever does best on cv error
1 2 3 4 5 6 7 8 | predict_momentum_pocket(
data,
feature_colname,
weight_elimination,
maxit,
momentum_colname = "momentum",
max_cv_window = NULL
)
|
data |
A tibble
of class |
feature_colname |
The column name of the features to use. Should be a list column, each list entry holding a double vector. |
weight_elimination |
A double vector, at each stage picks the one which has performed best in the past cv window (or all of the past, whichever is selected) |
maxit |
the maximum number of iterations |
momentum_colname |
The name of the column holding the
true momentum values (as a string),
defaults to |
max_cv_window |
If |
A tibble like data
but with a pocket_prediction
pocket_error
, and pocket_weight_elimination
,
columns holding the absolute value momentum prediction,
whether it was an error, and the elimination weight used.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.