Learn R Programming

SLOPE (version 0.5.1)

coef.SLOPE: Obtain coefficients

Description

This function returns coefficients from a model fit by SLOPE().

Usage

# S3 method for SLOPE
coef(object, alpha = NULL, exact = FALSE, simplify = TRUE, sigma, ...)

Value

Coefficients from the model.

Arguments

object

an object of class 'SLOPE'.

alpha

penalty parameter for SLOPE models; if NULL, the values used in the original fit will be used

exact

if TRUE and the given parameter values differ from those in the original fit, the model will be refit by calling stats::update() on the object with the new parameters. If FALSE, the predicted values will be based on interpolated coefficients from the original penalty path.

simplify

if TRUE, base::drop() will be called before returning the coefficients to drop extraneous dimensions

sigma

deprecated. Please use alpha instead.

...

arguments that are passed on to stats::update() (and therefore also to SLOPE()) if exact = TRUE and the given penalty is not in object

Details

If exact = FALSE and alpha is not in object, then the returned coefficients will be approximated by linear interpolation. If coefficients from another type of penalty sequence (with a different lambda) are required, however, please use SLOPE() to refit the model.

See Also

predict.SLOPE(), SLOPE()

Other SLOPE-methods: deviance.SLOPE(), plot.SLOPE(), predict.SLOPE(), print.SLOPE(), score()

Examples

Run this code
fit <- SLOPE(mtcars$mpg, mtcars$vs, path_length = 1)
coef(fit)

Run the code above in your browser using DataLab