ppd_gamlss: Fit 'gamlss'-type semi-parametric models

View source: R/Para_gamlss.R

ppd_gamlssR Documentation

Fit gamlss-type semi-parametric models

Description

This function is a wrapper for the function gamlss, which fits semi-parametric regression models for predictive distributions with up to four parameters (location, scale, shape1, shape2).

Usage

ppd_gamlss(
  data,
  formula,
  cv_folds = NULL,
  sigma.formula = ~1,
  nu.formula = ~1,
  tau.formula = ~1,
  family = gamlss.dist::NO(),
  cores = 1,
  pckgs = NULL,
  save_models_path = NULL,
  ... = NULL
)

Arguments

data

A data.frame containing target and explanatory variables. May optionally contain a column called "kfold" with numbered/labeled folds and "Test" for test data.

formula

A formula object with the response on the left of an ~ operator, and the terms, separated by + operators, on the right.

cv_folds

Control for cross-validation if not supplied in data.

sigma.formula

A formula object for fitting a model to the sigma parameter, as in the formula above.

nu.formula

A formula object for fitting a model to the nu parameter, as in the formula above.

tau.formula

A formula object for fitting a model to the tau parameter, as in the formula above.

family

A gamlss.family object, which is used to define the distribution and the link functions of the various parameters.

cores

the number of available cores. Defaults to one, i.e. no parallelisation, although in this case the user must still specify pckgs if applicable.

pckgs

specify additional packages required for each worker (e.g. c("data.table") if data stored as such).

save_models_path

Path to save models. Model details and file extension pasted onto this string.

...

Additional arguments passed to gamlss().

Details

See ?gamlss for additional details and options.

Value

A list of gamlss models with class PPD. Each list element corresponds to a cross-validation fold and contains a gamlss model trained on all other folds.

Author(s)

Jethro Browell, jethro.browell@strath.ac.uk; Ciaran Gilbert, ciaran.gilbert@strath.ac.uk


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