gof.piqr: Goodness of Fit of Penalized Quantile Regression Coefficients...

View source: R/qrcmPen.R

gof.piqrR Documentation

Goodness of Fit of Penalized Quantile Regression Coefficients Modeling

Description

Goodness of Fit of an object of class “piqr”, usefull to select the best tuning parameter.

Usage

gof.piqr(object, method=c("BIC","AIC"), Cn="1", plot=TRUE, df.new=TRUE, logi=TRUE, ...)

Arguments

object

an object of class “piqr”, the result of a call to piqr.

method

a method to evaluate the goodness of fit and select the best value of the tuning parameter.

Cn

It is some positive constant that diverges to infinity as n increase. It is used by the BIC criterion and if Cn = 1 the classical BIC is used.

df.new

if TRUE degrees of freedom are evaluated as the number of

\beta_j(p | \theta) != 0, j = 1,\ldots, q

.

logi

if TRUE the loss function is log-transformed.

plot

if TRUE the chosen method is plotted - default is TRUE.

...

additional arguments.

Details

The best value of lambda is chosen minimizing the criterion, i.e., AIC and BIC.

Value

minLambda

the best value of lambda.

dfMinLambda

the number of nonzero parameters associated to the best lambda.

betaMin

the parameters associated to the best lambda.

posMinLambda

the position of the best lambda along the sequence of lambda.

call

the matched call.

Author(s)

Gianluca Sottile gianluca.sottile@unipa.it

See Also

piqr, for model fitting; summary.piqr and plot.piqr, for summarizing and plotting piqr objects.

Examples


# using simulated data

set.seed(1234)
n <- 300
x1 <- rexp(n)
x2 <- runif(n, 0, 5)
x <- cbind(x1,x2)

b <- function(p){matrix(cbind(1, qnorm(p), slp(p, 2)), nrow=4, byrow=TRUE)}
theta <- matrix(0, nrow=3, ncol=4); theta[, 1] <- 1; theta[1,2] <- 1; theta[2:3,3] <- 2
qy <- function(p, theta, b, x){rowSums(x * t(theta %*% b(p)))}

y <- qy(runif(n), theta, b, cbind(1, x))

s <- matrix(1, nrow=3, ncol=4); s[1,3:4] <- 0
obj <- piqr(y ~ x1 + x2, formula.p = ~ I(qnorm(p)) + slp(p, 2), s=s, nlambda=50)

par(mfrow=c(1,2))
best <- gof.piqr(obj, method="AIC", plot=TRUE)
best2 <- gof.piqr(obj, method="BIC", plot=TRUE)

qrcmNP documentation built on May 29, 2024, 8:29 a.m.