Implements a specialized version of K-Means algorithm on the data set. When creating the clusters (in-sample) the function uses pricing_error, moneyness and maturity. But when predicting, it uses only moneyness and maturity covariates. All covariates are scaled between 0-100.
1 2 3 | kmeans_learn(raw_data, CallPut = "call", randseed = 0,
moneyness_interval = c(0.9, 1.1), maturity_interval = c(4, 252),
n_cluster = 0, export_plots = FALSE)
|
raw_data |
The option data set given in the format of uslfin_ds_1. |
CallPut |
It denotes whether to use the call or put options. |
randseed |
To set the randomness seed to a known value. Good for reproducibility. |
moneyness_interval |
Minimum and maximum of moneyness values. Required for rescaling. |
maturity_interval |
Minimum and maximum of maturity values. Required for rescaling. In trading days (one year \= 252 days) |
n_cluster |
Number of clusters. If |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.