coef.cv.ncpen: coef.cv.ncpen: extracts the optimal coefficients from...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/ncpen_cpp_wrap.R

Description

The function returns the optimal vector of coefficients.

Usage

1
2
## S3 method for class 'cv.ncpen'
coef(object, type = c("rmse", "like"), ...)

Arguments

object

(cv.ncpen object) fitted cv.ncpen object.

type

(character) a cross-validated error type which is either rmse or like.

...

other S3 parameters. Not used. Each error type is defined in cv.ncpen.

Value

the optimal coefficients vector selected by cross-validation.

type

error type.

lambda

the optimal lambda selected by CV.

beta

the optimal coefficients selected by CV.

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

cv.ncpen, plot.cv.ncpen , gic.ncpen

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
### linear regression with scad penalty
sam =  sam.gen.ncpen(n=200,p=10,q=5,cf.min=0.5,cf.max=1,corr=0.5)
x.mat = sam$x.mat; y.vec = sam$y.vec
fit = cv.ncpen(y.vec=y.vec,x.mat=x.mat,n.lambda=10)
coef(fit)
### logistic regression with classo penalty
sam =  sam.gen.ncpen(n=200,p=10,q=5,cf.min=0.5,cf.max=1,corr=0.5,family="binomial")
x.mat = sam$x.mat; y.vec = sam$y.vec
fit = cv.ncpen(y.vec=y.vec,x.mat=x.mat,n.lambda=10,family="binomial",penalty="classo")
coef(fit)
### multinomial regression with sridge penalty
sam =  sam.gen.ncpen(n=200,p=10,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 = cv.ncpen(y.vec=y.vec,x.mat=x.mat,n.lambda=10,family="multinomial",penalty="sridge")
coef(fit)

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