hinge
(Package: SVMMaj) :
Hinge error function of SVM-Maj
This function creates a function to compute the hinge error, given its predicted value q and its class y, according to the loss term of the Support Vector machine loss function.
SVM-Maj is an algorithm to compute a support vector machine (SVM) solution. In its most simple form, it aims at finding hyperplane that optimally separates two given classes. This objective is equivalent to finding a linear combination of k predictor variables to predict the two classes for n observations. SVM-Maj minimizes the standard support vector machine (SVM) loss function. The algorithm uses three efficient updates for three different situations: primal method which is efficient in the case of n>k, the decomposition method, used when the matrix of predictor variables is not of full rank, and a dual method, that is efficient when n<k. Apart from the standard absolute hinge error, SVM-Maj can also handle the quadratic and the Huber hinge.
This function performs a gridsearch of k-fold crossvalidations using SVM-Maj and returns the combination of input values which has the best forecasting performance.