cvx.pen.reg(x, y, lambda, w = NULL, tol = 1e-05, maxit = 1000,...)
# S3 method for default
cvx.pen.reg(x, y, lambda, w = NULL, tol = 1e-05, maxit = 1000,...)
# S3 method for cvx.pen.reg
plot(x,...)
# S3 method for cvx.pen.reg
print(x,...)
# S3 method for cvx.pen.reg
predict(object, newdata = NULL,...)
plot
and print
functions, x
represents an object of class cvx.pen.reg
.plot
function provides the scatterplot along with fitted curve; it also includes some diagnostic plots for residuals. Predict function returns a matrix containing the inputted newdata along with the function values, derivatives and second derivatives.args(cvx.pen.reg)
x <- runif(50,-1,1)
y <- x^2 + rnorm(50,0,0.3)
tmp <- cvx.pen.reg(x, y, lambda = 0.01)
print(tmp)
plot(tmp)
predict(tmp, newdata = rnorm(10,0,0.1))
Run the code above in your browser using DataLab