coef0: Extract Model Coefficients

Description Usage Arguments Examples

Description

Extract the 0 or non 0 coefficients

Usage

1
2
3
4
5
coef0(x, ...)

## S3 method for class 'plvmfit'
coef0(x, tol = 0, operator = "<=", penalized = FALSE,
  value = TRUE, ...)

Arguments

x

a penalized lvm model

...

not used

tol

the threshold below which a coefficient is considered to be null

operator

the operator used to extract the coefficients

penalized

should only the penalized coefficient be returned

value

should the value of the coefficients be returned? Otherwise their position.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
set.seed(10)
n <- 300
formula.lvm <- as.formula(paste0("Y~",paste(paste0("X",1:12), collapse = "+")))
mSim <- lvm(formula.lvm)
df.data <- sim(mSim,n)

pm <- penalize(mSim, c("Y~X1","Y~X4", "Y~X10"))
pm.fit <- estimate(pm, lambda1 = 1e5, data = df.data, control = list(constrain = TRUE))
coef0(pm.fit)
coef0(pm.fit, operator = ">")
coef0(pm.fit, operator = ">", penalized = TRUE)

bozenne/lava.penalty documentation built on May 13, 2019, 1:41 a.m.