plot.piqr: Plot Penalized Quantile Regression Coefficients

Description Usage Arguments Details Author(s) See Also Examples

Description

Produces a coefficient profile plot of the quantile regression coefficient paths for a fitted model of class “piqr”.

Usage

1
2
3
## S3 method for class 'piqr'
plot(x, xvar=c("lambda", "objective", "grad", "beta"), pos.lambda,
                    label=FALSE, which=NULL, ask=TRUE, polygon=TRUE, ...)

Arguments

x

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

xvar

What is on the X-axis. "lambda" against the log-lambda sequence, "objective" against the value of the minimized integrated loss function and "grad" the log-lambda sequence against the gradient. xvar = "beta" needs a lambda value to plot quantile regression coefficients β(p | θ(λ)) as a function of p, based on the fitted model of class “piqr

pos.lambda

the position of a lambda in the sequence of the object of class “piqr”. Could be the best after selecting the result of a call to gof.piqr

label

If TRUE, label the curves with variable sequence numbers.

which

an optional numerical vector indicating which coefficient(s) to plot. If which = NULL, all coefficients are plotted.

ask

logical. If which = NULL and ask = TRUE (the default), you will be asked interactively which coefficients to plot.

polygon

ogical. If TRUE, confidence intervals are represented by shaded areas via polygon. Otherwise, dashed lines are used.

...

additional graphical parameters, that can include xlim, ylim, xlab, ylab, col, lwd. See par.

Details

A coefficient profile plot is produced.

Author(s)

Gianluca Sottile gianluca.sottile@unipa.ot

See Also

piqr for model fitting; gof.piqr for the model selection criteria; summary.piqr and predict.piqr for model summary and prediction.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
  # using simulated data

  n <- 300
  x <- runif(n)
  qy <- function(p,x){p^2 + x*log(p)}
  # true quantile function: Q(p | x) = beta0(p) + beta1(p)*x, with
     # beta0(p) = p^2
     # beta1(p) = log(p)
  y <- qy(runif(n), x) # to generate y, plug uniform p in qy(p,x)

  obj <- piqr(y ~ x, formula.p = ~ slp(p,3), nlambda=50)
  best <- gof.piqr(obj, method="BIC", plot=FALSE)
  par(mfrow = c(1,3))
  plot(obj, xvar="lambda")
  plot(obj, xvar="objective")
  plot(obj, xvar="grad")
  par(mfrow=c(1,2));plot(obj, xvar="beta", pos.lambda=best$posMinLambda, ask=FALSE)
  # flexible fit with shifted Legendre polynomials

qrcmNP documentation built on Feb. 22, 2021, 9:10 a.m.