Skip to contents

Predict from a rqTList Object.

Usage

# S3 method for rqTList
predict(
  object,
  newdata,
  lastFullYear,
  out = c("long", "short"),
  na.action = na.pass,
  trace = 0,
  ...
)

Arguments

object

A rqTList object representing a list of regression quantile models as created by the rq function of the quantreg package.

newdata

New data frame.

lastFullYear

Logical. If TRUE, only the last full year in the data used to fit the quantile regressions will be used. If the regression quantile uses only functions of the date that have the one-year periodicity, the one should use lastFullYear = TRUE.

out

Character giving the format of the output. If "short" a numeric matrix is returned with the formated date as its rownames. If "long" a data frame with columns Date, u and tau is returned. The long format is useful when ggplots areto be produced.

na.action

See predict.rq.

trace

Integer level of verbosity.

...

Further arguments passed to the predict method of the class "rq".

Value

A matrix or a data frame, depending on the value or

out.

Caution

For now, a rqTList object does not store the calls to design functions used at creation time, although these designs functions may have to be re-called on newdata. A quick and dirty solution is used, based on the variables names. It works only for trigonometric bases created by using `tsDesign` with `type = "trigo"`.

Examples

RqRennes <- rqTList(dailyMet = Rennes)
## use a matrix
pRennes <- predict(RqRennes, out = "short")
if (FALSE) {
    stat <- findStationMF("bordeaux-me")
    ## you may here have to use `Sys.setenv(metData = xxx)`
    Bordeaux <- readMet(stat)
    RqBordeaux <- rqTList(dailyMet = Bordeaux)
    pBordeaux <- predict(RqBordeaux, out = "short")
    pBordeaux - pRennes
    autoplot(as.ts(pBordeaux - pRennes)) +
       ggtitle("differences in the quantiles Bordeaux - Rennes")
}