dot-calcSVM: .calcSVM

Description Usage Arguments Value Author(s)

Description

Helper function to calculate SVM.

Usage

1
.calcSVM(mydat, fmla, mylag, best_cost)

Arguments

mydat

data.table of rawdata

fmla

model formula used to forecast recessions.

mylag

integer number of months to lag the data.

best_cost

integer best_cost or NULL, in which case the best_cost will be determined using k-fold cross-validation.

Value

list containing the following outputs: *error* the percentage of months incorrectly classified, *best_cost* integer value of th best_cost as determined by the k-fold cross validation on the first 14 years of data, and *ans* is the predictions, 1 for recession and -1 for no recession.

Author(s)

Roger J. Bos, roger.bos@gmail.com


rogerjbos/svm_recession documentation built on Feb. 23, 2020, 2:49 a.m.