plot.ncpen: plot.ncpen: plots coefficients from an 'ncpen' object.

Description Usage Arguments Author(s) References See Also Examples

View source: R/ncpen_cpp_wrap.R

Description

Produces a plot of the coefficients paths for a fitted ncpen object. Class-wise paths can be drawn for multinomial.

Usage

1
2
3
## S3 method for class 'ncpen'
plot(x, log.scale = FALSE, mult.type = c("mat", "vec"),
  ...)

Arguments

x

(ncpen object) Fitted ncpen object.

log.scale

(logical) whether to use log scale of lambda for horizontal axis.

mult.type

(character) additional option for multinomial whether to draw the coefficients class-wise or not. Default is mat that uses class-wise coefficients.

...

other graphical parameters to plot

Author(s)

Dongshin Kim, Sunghoon Kwon, Sangin Lee

References

Lee, S., Kwon, S. and Kim, Y. (2016). A modified local quadratic approximation algorithm for penalized optimization problems. Computational Statistics and Data Analysis, 94, 275-286.

See Also

ncpen

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
### linear regression with scad penalty
sam =  sam.gen.ncpen(n=200,p=20,q=5,cf.min=0.5,cf.max=1,corr=0.5)
x.mat = sam$x.mat; y.vec = sam$y.vec
fit = ncpen(y.vec=y.vec,x.mat=x.mat)
plot(fit)
### multinomial regression with classo penalty
sam =  sam.gen.ncpen(n=200,p=20,q=5,k=3,cf.min=0.5,cf.max=1,corr=0.5,family="multinomial")
x.mat = sam$x.mat; y.vec = sam$y.vec
fit = ncpen(y.vec=y.vec,x.mat=x.mat,family="multinomial",penalty="classo")
plot(fit)
plot(fit,mult.type="vec",log.scale=TRUE)

ncpen documentation built on May 1, 2019, 9:21 p.m.