MQR_qreg_gam: DEPRECIATED: Multiple Quantile Regression Using Generalised...

MQR_qreg_gamR Documentation

DEPRECIATED: Multiple Quantile Regression Using Generalised Additive Models and Linear Quantile Regression

Description

OLD VERSION SUPERCEDED BY qreg_gam. This function fits multiple conditional linear quantile regression models to the residuals of a generalised additive model using mgcv and with facilities for cross-validation.

Usage

MQR_qreg_gam(
  data,
  formula,
  formula_qr = NULL,
  model_res2 = F,
  formula_res2 = formula,
  quantiles = c(0.25, 0.5, 0.75),
  CVfolds = NULL,
  ...,
  use_bam = T,
  w = rep(1, nrow(data)),
  Sort = T,
  SortLimits = NULL
)

Arguments

data

A data.frame containing target and explanatory variables. May optionally contain a collumn called "kfold" with numbered/labeled folds and "Test" for test data. If data contains a column called "gam_pred" then gam modelling will be skipped and this will be used in quantile regression.

formula_qr

Formula for linear quantile regression model for GAM residuals. Term gam_pred is the prediction from the above GAM may be included in this formula.

model_res2

If TRUE also model squared residuals of GAM using a GAM. Defaults to FALSE.

formula_res2

Formula for GAM to predict squared residuals.

quantiles

The quantiles to fit models for.

...

Additional agruments passter to gam() or (bam()).

use_bam

If TRUE (default) then GAM is fit using (bam()) in stead of gam(). bam is better suited to large datasets but not all gam model options are available with bam. See bam() documentation for further details.

w

Weights on the contribution of data to model fit. See gam().

Sort

boolean Sort quantiles using SortQuantiles()?

SortLimits

Limits argument to be passed to SortQuantiles(). Constrains quantiles to upper and lower limits given by list(U=upperlim,L=lowerlim).

formala

A formula object with the response on the left of an ~ operator, and the terms, separated by + operators, on the right passed to gam() or bam() from mgcv.

gbm_params

List of parameters to be passed to fit.gbm().

cv_folds

Control for cross-validation if not supplied in data.

Details

The returned predictive quantiles and GAM predictions are those produced out-of-sample for each cross-validation fold (using models trained on the remaining folds but not "Test" data). Predictive quantiles corresponding to "Test" data are produced using models trained on all non-test data.

Value

Returns a list containing predictive quantiles (in a MultiQR object), GAM models, and deterministic predictions from GAMs.

Author(s)

Jethro Browell, jethro.browell@strath.ac.uk


jbrowell/ProbCast documentation built on July 20, 2024, 1:53 p.m.