These functions have been renamed and deprecated in oem:
oemfit()
(use oem()
), cv.oemfit()
(use cv.oem()
), print.oemfit()
,
plot.oemfit()
, predict.oemfit()
, and
coef.oemfit()
.
oemfit(
formula,
data = list(),
lambda = NULL,
nlambda = 100,
lambda.min.ratio = NULL,
tolerance = 0.001,
maxIter = 1000,
standardized = TRUE,
numGroup = 1,
penalty = c("lasso", "scad", "ols", "elastic.net", "ngarrote", "mcp"),
alpha = 3,
evaluate = 0,
condition = -1
)cv.oemfit(
formula,
data = list(),
lambda = NULL,
type.measure = c("mse", "mae"),
...,
nfolds = 10,
foldid,
penalty = c("lasso", "scad", "elastic.net", "ngarrote", "mcp")
)
# S3 method for oemfit
plot(
x,
xvar = c("norm", "lambda", "loglambda", "dev"),
xlab = iname,
ylab = "Coefficients",
...
)
# S3 method for oemfit
predict(
object,
newx,
s = NULL,
type = c("response", "coefficients", "nonzero"),
...
)
# S3 method for oemfit
print(x, digits = max(3, getOption("digits") - 3), ...)
an object of 'formula' (or one that can be coerced to that class): a symbolic description of the model to be fitted. The details of model specification are given under 'Details'
an optional data frame, list or environment (or object coercible by 'as.data.frame' to a data frame) containing the variables in the model. If not found in 'data', the variables are taken from 'environment(formula)', typically the environment from which 'oemfit' is called.
A user supplied 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.
The number of lambda
values - default is 100.
Smallest value for 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.
Convergence tolerance for OEM. Each inner
OEM loop continues until the maximum change in the
objective after any coefficient update is less than tolerance
.
Defaults value is 1E-3
.
Maximum number of passes over the data for all lambda values; default is 1000.
Logical flag for x variable standardization, prior to
fitting the model sequence. The coefficients are always returned on
the original scale. Default is standardize=TRUE
.
If variables are in the same units already, you might not wish to
standardize.
Integer value for the number of groups to use for OEM fitting. Default is 1.
type in lower letters. Different types include 'lasso', 'scad', 'ols' (ordinary least square), 'elastic-net', 'ngarrote' (non-negative garrote) and 'mcp'.
alpha value for scad and mcp.
debugging argument
Debugging for different ways of calculating OEM.
type.measure measure to evaluate for cross-validation.
type.measure = "mse"
(mean squared error) or
type.measure = "mae"
(mean absolute error)
arguments to be passed to oemfit()
number of folds for cross-validation. default is 10.
an optional vector of values between 1 and nfold specifying which fold each observation belongs to.
fitted oemfit
object
what is on the X-axis. "norm" plots against the L1-norm of the coefficients, "lambda" against the log-lambda sequence, and "dev" against the percent deviance explained.
x-axis label
y-axis label
fitted oemfit
object
matrix of new values for x at which predictions are to be made. Must be a matrix.
Value(s) of the penalty parameter lambda at which predictions are required. Default is the entire sequence used to create the model.
not used.
significant digits in print out.
Bin Dai
The sequence of models implied by 'lambda' is fit by OEM algorithm.