Learn R Programming

sparsestep (version 1.0.1)

coef.sparsestep: Get the coefficients of a fitted SparseStep model

Description

Returns the coefficients of the SparseStep model.

Usage

# S3 method for sparsestep
coef(object, ...)

Arguments

object

a sparsestep object

further argument are ignored

Value

The coefficients of the SparseStep model (i.e. the betas) as a dgCMatrix. If the model was fitted with an intercept this will be the first row in the resulting matrix.

References

Van den Burg, G.J.J., Groenen, P.J.F. and Alfons, A. (2017). SparseStep: Approximating the Counting Norm for Sparse Regularization, arXiv preprint arXiv:1701.06967 [stat.ME]. URL https://arxiv.org/abs/1701.06967.

Examples

Run this code
# NOT RUN {
x <- matrix(rnorm(100*20), 100, 20)
y <- rnorm(100)
fit <- sparsestep(x, y)
coef(fit)

# }

Run the code above in your browser using DataLab