Description Usage Arguments Details Value
Computes the class correlations between an asset (or any equity curve) and a predictor. The predictor can be a binary class or a real value centered about 0.
1 2 | predictor_cor(data, price_col = "prices", timer_col = "GC",
plot = TRUE)
|
data |
The xts matrix data containing the equity curve of the asset or portfolio, and the classifier's prediction column. e.g. market timer. The predictor column may be binary (-1, +1) or real-valued centered about zero. |
price_col |
The column name or column number of the equity curve under test. Default = "prices". |
timer_col |
The column name or column number of the prediction (or timer). Default is "GC". |
plot |
Logical value indicating whether or not to output a scatter plot annotated with the class correlations and a legend. |
In the real valued case, it is assumed that the sign represents the direction of the market, while the real value is a conviction level. For example, a predictor value of 0.0001 could be considered a weak conviction of an up market, whereas a predictor value of -0.1 could be construed as a strong conviction of a down market. Person linear correlations (function cor) is used to compute the correlation between the actual future market direction (internally represented as +1, -1), and the real value of the indicator
Returns the class correlations and other information as a list.
$pred_N_up:
Number of up predictions by the predictor.
$actual_N_up:
Number of actual up observations of the asset.
$up_cor:
The predictor correlation for the up class (predictor value is positive).
$pred_N_down:
Number of down predictions by the predictor.
$actual_N_down:
Number of actual down observations of the asset.
$down_cor:
The predictor correlation for the up class (predictor value is negative).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.