coef.bsrr: Provides estimated coefficients from a fitted "bsrr" object.

Description Usage Arguments Value Author(s) See Also Examples

View source: R/coef.bsrr.R

Description

This function provides estimated coefficients from a fitted "bsrr" object.

Usage

1
2
## S3 method for class 'bsrr'
coef(object, sparse = TRUE, ...)

Arguments

object

A "bsrr" project.

sparse

Logical or NULL, specifying whether the coefficients should be presented as sparse matrix or not.

...

Other arguments.

Value

If sparse == FALSE, a vector containing the estimated coefficients from a fitted "bsrr" object is returned. If sparse == TRUE, a dgCMatrix containing the estimated coefficients is returned.

Author(s)

Liyuan Hu, Kangkang Jiang, Yanhang Zhang, Jin Zhu, Canhong Wen and Xueqin Wang.

See Also

bsrr, print.bsrr.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Generate simulated data
n <- 200
p <- 20
k <- 5
rho <- 0.4
seed <- 10
Tbeta <- rep(0, p)
Tbeta[1:k*floor(p/k):floor(p/k)] <- rep(1, k)
Data <- gen.data(n, p, k, rho, family = "gaussian", beta = Tbeta, seed = seed)
lambda.list <- exp(seq(log(5), log(0.1), length.out = 10))
lm.bsrr <- bsrr(Data$x, Data$y, method = "pgsection")
coef(lm.bsrr)

bestridge documentation built on Oct. 10, 2021, 5:06 p.m.