Skip to contents

Minimises C sum (|y_i - f(x_i)| - epsilon)_+ + |beta|^2 / 2 through the 2N-variable dual solved by the same SMO as the classifiers (ESL eqs 12.35-12.39, the libsvm epsilon-regression formulation); f(x) = sum_i coef_i K(x, x_i) + b.

Usage

morie_esl_svr(
  X,
  y,
  C = 1,
  epsilon = 0.1,
  kernel = "rbf",
  gamma = NULL,
  degree = 3,
  coef0 = 1,
  newdata = NULL,
  tol = 0.001
)

Arguments

X

Predictors, n by p.

y

Response.

C

Cost.

epsilon

Tube half-width.

kernel

"linear", "rbf", "poly" or "sigmoid".

gamma, degree, coef0

Kernel parameters.

newdata

Points to predict.

tol

SMO tolerance.

Value

Named list: coef, b, fitted, prediction, n_support, converged.

References

Smola, A. & Scholkopf, B. (2004). Statistics and Computing 14, 199-222.

Examples

X <- cbind(sin(1:40), cos(3 * (1:40)))
morie_esl_svr(X, 2 * X[, 1] - X[, 2], epsilon = 0.2, kernel = "linear")$b
#> [1] 8.410274e-05