oemfit (formula, data = list(), lambda = NULL, nlambda = 100, lambda.min.ratio = NULL, tolerance = 1e-3, maxIter = 1000, standardized = TRUE, numGroup = 1, penalty = c("lasso", "scad", "ols", "elastic.net", "ngarrote", "mcp"), alpha = 3, evaluate = 0, condition = -1)lambda sequence. Typical usage is
to have the program compute its own lambda sequence based on
nlambda and lambda.min.ratio. Supplying a value of
lambda overrides this. WARNING: use with care. Do not supply a
single value for lambda (for predictions after CV use predict()
instead). Supply instead a decreasing sequence of lambda
values. oemfit relies on its warms starts for speed, and its
often faster to fit a whole path than compute a single fit.lambda values - default is 100.lambda, as a fraction of
lambda.max, the (data derived) entry value (i.e. the smallest
value for which all coefficients are zero). The default depends on the
sample size nobs relative to the number of variables
nvars. If nobs > nvars, the default is 0.0001,
close to zero. If nobs < nvars, the default is 0.01.
A very small value of
lambda.min.ratio will lead to a saturated fit in the nobs <
nvars case.tolerance.
Defaults value is 1E-3.standardize=TRUE.
If variables are in the same units already, you might not wish to
standardize."oemfit"
x=matrix(rnorm(100*20),100,20)
y=rnorm(100)
fit <- oemfit(y~x)
Run the code above in your browser using DataLab