kmeans_learn: K-Means Learn

Description Usage Arguments

View source: R/dm_functions.R

Description

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.

Usage

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)

Arguments

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 0, then number of clusers is determined by the contract set size. Exact calculation is min(round(nrow(training_matrix)/100),200)


learnfin/learnfin documentation built on May 20, 2019, 11:29 p.m.