qreg_gam | R Documentation |
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.
Quantile regression may be performed using user-specified formula or the design matrix of
the fitted GAM.
qreg_gam(
data,
formula,
formula_qr = NULL,
model_res2 = F,
formula_res2 = NULL,
quantiles = c(0.25, 0.5, 0.75),
cv_folds = NULL,
use_bam = T,
exclude_train = NULL,
sort = T,
sort_limits = NULL,
...
)
data |
A |
formula_qr |
Formula for linear quantile regression model for GAM residuals. Term |
model_res2 |
If |
formula_res2 |
Formula for GAM to predict squared residuals. |
quantiles |
The quantiles to fit models for. |
cv_folds |
Control for cross-validation with various options, either:
|
use_bam |
If |
exclude_train |
A column name in |
sort |
|
sort_limits |
|
... |
Additional arguments past to |
formala |
A |
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.
Returns a list
containing predictive quantiles (in a MultiQR
object), GAM models, and deterministic predictions
from GAMs.
Jethro Browell, jethro.browell@glasgow.ac.uk
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.