print.dglars | R Documentation |
Print information about the sequence of models estimated by dgLARS method.
## S3 method for class 'dglars'
print(x, digits = max(3, getOption("digits") - 3), ...)
x |
fitted |
digits |
significant digits in printout |
... |
additional print arguments |
The call that produced the object x
is printed, followed by a
five-column data.frame
with columns “Sequence
”,
“g
”, “Dev
”, “%Dev
” and
“n. non zero
”. The column named “Sequence
”
gives information on how is changed the active set along the path. The
column “g
” shows the sequence of \gamma
values used to compute the solution curve, while the columns “Dev
”
and “%Dev
” show the corresponding deviance and the fraction
of explained deviance, respectively. Finally the “n. non zero
”
column shows the number of nonzero coefficients. The last part gives information
about the algorithm and the method used to compute the solution curve.
The code about the convergence of the used algorithm is also showed.
The data.frame
above is silently returned.
Luigi Augugliaro
Maintainer: Luigi Augugliaro luigi.augugliaro@unipa.it
dglars
function.
#############################
# y ~ Binomial
set.seed(123)
n <- 100
p <- 100
X <- matrix(rnorm(n * p), n, p)
eta <- 1 + 2 * X[,1]
mu <- binomial()$linkinv(eta)
y <- rbinom(n, 1, mu)
fit <- dglars(y ~ X, family = binomial)
fit
# adaptive dglars method
b_wght <- coef(fit)$beta[, 20]
fit <- dglars(y ~ X, family = binomial, b_wght = b_wght)
fit
# the first three coefficients are not penalized
fit <- dglars(y ~ X, family = binomial, unpenalized = 1:3)
fit
# 'probit' link function
fit <- dglars(y ~ X, family = binomial("probit"))
fit
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.