cvx.lse.reg(t, z, w = NULL,...)
# S3 method for default
cvx.lse.reg(t, z, w = NULL, ...)
# S3 method for cvx.lse.reg
plot(x,...)
# S3 method for cvx.lse.reg
print(x,...)
# S3 method for cvx.lse.reg
predict(object, newdata = NULL, deriv = 0, ...)coneA function from the coneproj package to perform the constrained minimization of least squares. Currently, the code makes use of the nnls function from nnls package for the same purpose. plot function provides the scatterplot along with fitted curve; it also includes some diagnostic plots for residuals. Predict function now allows computation of the first derivative.args(cvx.lse.reg)
x <- runif(50,-1,1)
y <- x^2 + rnorm(50,0,0.3)
tmp <- cvx.lse.reg(x, y)
print(tmp)
plot(tmp)
predict(tmp, newdata = rnorm(10,0,0.1))
Run the code above in your browser using DataLab