Description Usage Arguments Details Value References Examples
Fits a regularization path for the kernel huber regression at a sequence of regularization parameters lambda.
1 2 |
x |
matrix of predictors, of dimension N*p; each row is an observation vector. |
y |
response variable. |
kern |
the built-in kernel classes in krome.
The
Objects can be created by calling the rbfdot, polydot, tanhdot, vanilladot, anovadot, besseldot, laplacedot, splinedot functions etc. (see example.) |
lambda |
a user supplied |
eps |
convergence threshold for majorization minimization algorithm. Each majorization descent loop continues until the relative change in any coefficient ||alpha(new)-α(old)||_2^2/||α(old)||_2^2 is less than |
maxit |
maximum number of loop iterations allowed at fixed lambda value. Default is 1e4. If models do not converge, consider increasing |
delta |
the parameter delta in the huber regression loss. The value must be positive. Default is 2. |
gamma |
a scalar number. If it is specified, the number will be added to each diagonal element of the kernel matrix as perturbation. The default is |
Note that the objective function in krome
is
Loss(y- α_0 - K * α ) + λ * α^T * K * α,
where the α_0 is the intercept, α is the solution vector, and K is the kernel matrix with K_{ij}=K(x_i,x_j). Users can specify the kernel function to use, options include Radial Basis kernel, Polynomial kernel, Linear kernel, Hyperbolic tangent kernel, Laplacian kernel, Bessel kernel, ANOVA RBF kernel, the Spline kernel. Users can also tweak the penalty by choosing different lambda.
For computing speed reason, if models are not converging or running slow, consider increasing eps
before increasing maxit
.
An object with S3 class krome
.
call |
the call that produced this object. |
alpha |
a |
lambda |
the actual sequence of |
npass |
total number of loop iterations corresponding to each lambda value. |
jerr |
error flag, for warnings and errors, 0 if no error. |
Y. Yang, T. Zhang, and H. Zou. (2017) "Flexible Expectile Regression in Reproducing Kernel Hilbert Space." Technometrics. Accepted.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # create data
N <- 200
X1 <- runif(N)
X2 <- 2*runif(N)
X3 <- 3*runif(N)
SNR <- 10 # signal-to-noise ratio
Y <- X1**1.5 + 2 * (X2**.5) + X1*X3
sigma <- sqrt(var(Y)/SNR)
Y <- Y + X2*rnorm(N,0,sigma)
X <- cbind(X1,X2,X3)
# set gaussian kernel
kern <- rbfdot(sigma=0.1)
# define lambda sequence
lambda <- exp(seq(log(0.5),log(0.01),len=10))
# run krome
m1 <- krome(x=X, y=Y, kern=kern, lambda = lambda, delta = 2)
# plot the solution paths
plot(m1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.