coef.Owl: Obtain coefficients

Description Usage Arguments Details Value Examples

View source: R/coef.R

Description

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

Usage

1
2
## S3 method for class 'Owl'
coef(object, sigma = NULL, exact = FALSE, simplify = TRUE, ...)

Arguments

object

an object of class 'Owl'.

sigma

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

...

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

Details

If exact == FALSE and sigma 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 owl() to refit the model.

Value

Coefficients from the model.

Examples

1
2
fit <- owl(mtcars$mpg, mtcars$vs, n_sigma = 1)
coef(fit)

jolars/golem documentation built on March 5, 2020, 12:42 p.m.