coef.msaenet: Extract Model Coefficients

View source: R/msaenet-inspect.R

coef.msaenetR Documentation

Extract Model Coefficients

Description

Extract model coefficients from the final model in msaenet model objects.

Usage

## S3 method for class 'msaenet'
coef(object, ...)

Arguments

object

An object of class msaenet produced by aenet, amnet, asnet, msaenet, msamnet, or msasnet.

...

Additional parameters for coef (not used).

Value

A numerical vector of model coefficients.

Author(s)

Nan Xiao <https://nanx.me>

Examples

dat <- msaenet.sim.gaussian(
  n = 150, p = 500, rho = 0.6,
  coef = rep(1, 5), snr = 2, p.train = 0.7,
  seed = 1001
)

msaenet.fit <- msaenet(
  dat$x.tr, dat$y.tr,
  alphas = seq(0.2, 0.8, 0.2),
  nsteps = 3L, seed = 1003
)

coef(msaenet.fit)

nanxstats/msaenet documentation built on March 8, 2024, 9:37 p.m.