Learn R Programming

oem (version 2.0.12)

oemfit: Deprecated functions

Description

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().

Usage

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), ...)

Arguments

formula

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'

data

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.

lambda

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.

nlambda

The number of lambda values - default is 100.

lambda.min.ratio

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.

tolerance

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.

maxIter

Maximum number of passes over the data for all lambda values; default is 1000.

standardized

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.

numGroup

Integer value for the number of groups to use for OEM fitting. Default is 1.

penalty

type in lower letters. Different types include 'lasso', 'scad', 'ols' (ordinary least square), 'elastic-net', 'ngarrote' (non-negative garrote) and 'mcp'.

alpha

alpha value for scad and mcp.

evaluate

debugging argument

condition

Debugging for different ways of calculating OEM.

type.measure

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()

nfolds

number of folds for cross-validation. default is 10.

foldid

an optional vector of values between 1 and nfold specifying which fold each observation belongs to.

x

fitted oemfit object

xvar

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.

xlab

x-axis label

ylab

y-axis label

object

fitted oemfit object

newx

matrix of new values for x at which predictions are to be made. Must be a matrix.

s

Value(s) of the penalty parameter lambda at which predictions are required. Default is the entire sequence used to create the model.

type

not used.

digits

significant digits in print out.

Author

Bin Dai

Details

The sequence of models implied by 'lambda' is fit by OEM algorithm.