plot.gds: Plot the estimates returned by gds

View source: R/plot.gds.R

plot.gdsR Documentation

Plot the estimates returned by gds

Description

Plot the number of nonzero coefficients at the given lambda.

Usage

## S3 method for class 'gds'
plot(x, ...)

Arguments

x

An object of class gds

...

Other arguments to plot (not used).

Examples

set.seed(1)
# Example with logistic regression
# Number of samples
n <- 1000
# Number of covariates
p <- 10
# True (latent) variables (Design matrix)
X <- matrix(rnorm(n * p), nrow = n)
# True regression coefficients
beta <- c(seq(from = 0.1, to = 1, length.out = 5), rep(0, p-5))
# Binomially distributed response
y <- rbinom(n, 1, (1 + exp(-X %*% beta))^(-1))
# Fit the generalized Dantzig Selector
gds <- gds(X, y, family = "binomial")
# Plot the estimated coefficients at the chosen lambda
plot(gds)


hdme documentation built on May 31, 2023, 5:44 p.m.