coef.bridge: Extract coefficients from a 'bridge' object

Description Usage Arguments Value Author(s) See Also Examples

View source: R/methods.R

Description

Extract coefficients from a 'bridge' object.

Usage

1
2
## S3 method for class 'bridge'
coef(object, s = c("lambda.1se", "lambda.min"), ...)

Arguments

object

A 'bridge' object.

s

Value(s) of the penalty parameter lambda at which predictions are required.

...

Additional arguments for compatibility.

Value

A vector of coefficients

Author(s)

Bahadir Yuzbasi, Mohammad Arashi and Fikri Akdeniz
Maintainer: Bahadir Yuzbasi b.yzb@hotmail.com

See Also

predict.bridge

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
set.seed(2019) 
beta <- c(3, 1.5, 0, 0, 2, 0, 0, 0)
p <- length(beta)
beta <- matrix(beta, nrow = p, ncol = 1)

n = 100
X = matrix(rnorm(n*p),n,p)
y = X%*%beta + rnorm(n) 

model1 <- bridge(X, y, q = 1)
coef(model1,s='lambda.min')

rbridge documentation built on Feb. 29, 2020, 5:07 p.m.

Related to coef.bridge in rbridge...