Learn R Programming

dglars (version 2.1.7)

plot.dglars: Plot from a dglars Object

Description

Produces plots to study the sequence of models identified by dgLARS method.

Usage

# S3 method for dglars
plot(x, type = c("both", "AIC", "BIC"), ...)

Arguments

x

fitted dglars object.

type

a description of the measure of goodness-of-fit used to compare the sequence of models fitted by dglars or dglars.fit. See below for a more details.

...

further arguments passed to the functions AIC.dglars or BIC.dglars.

Author

Luigi Augugliaro and Hassan Pazira
Maintainer: Luigi Augugliaro luigi.augugliaro@unipa.it

Details

plot.dglars method produces different plots to study the sequence of models fitted by dgLARS method.

First plot gives information about the goodness-of-fit of the sequence of models fitted by dgLARS method. The user can plot the sequence of AIC (type = "AIC") or BIC values (type = "BIC"). By default, AIC and BIC values are shown on the same plot (type = "both"). More general measures of goodness-of-fit can be specified by using the argument “...” to pass futher arguments to function AIC.dglars (see the examples below). The value of the tuning parameter corresponding to the minimum of the used measure of goodness-of-fit is indentified by a vertical dashed red line, while the \(\gamma\) values at which corresponds a change in the active set are labeled by vertical dashed gray lines. Second plot shows the coefficient profile plot; if the predictor-corrector algorithm is used to fit the model, the third plot shows the Rao's score test statistics as function of \(\gamma\).

See Also

dglars, summary.dglars and AIC.dglars.

Examples

Run this code
###########################
# Logistic regression model
set.seed(123)
n <- 100
p <- 10
X <- matrix(rnorm(n * p), n, p)
b <- 1:2
eta <- b[1] + X[, 1] * b[2]
mu <- binomial()$linkinv(eta)
y <- rbinom(n, 1, mu)
fit <- dglars.fit(X, y, family = binomial)
plot(fit) 
plot(fit, type = "AIC")
plot(fit, type = "BIC")
plot(fit, type = "AIC", k = 5)
plot(fit, type = "AIC", complexity = "gdf")

Run the code above in your browser using DataLab