Description Usage Arguments Value Author(s)
Helper function to calculate SVM.
1 | .calcSVM(mydat, fmla, mylag, best_cost)
|
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. |
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.
Roger J. Bos, roger.bos@gmail.com
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.