Learn R Programming

mlt (version 1.6-0)

mlt: Most Likely Transformations

Description

Likelihood-based model estimation in conditional transformation models

Usage

mlt(model, data, weights = NULL, offset = NULL, fixed = NULL, theta = NULL, 
    pstart = NULL, scale = FALSE, dofit = TRUE, optim = mltoptim())

Value

An object of class mlt with corresponding methods.

Arguments

model

a conditional transformation model as specified by ctm

data

a data.frame containing all variables specified in model

weights

an optional vector of case weights

offset

an optional vector of offset values; offsets are not added to an optional scaling term (see link{ctm})

fixed

a named vector of fixed regression coefficients; the names need to correspond to column names of the design matrix

theta

optional starting values for the model parameters

pstart

optional starting values for the distribution function evaluated at the data

scale

a logical indicating if (internal) scaling shall be applied to the model coefficients

dofit

a logical indicating if the model shall be fitted to the data (TRUE) or not. If theta is given, a model of class mlt (a full "fitted" model) featuring these parameters is returned. Otherwise, an unfitted model of class ctm is returned

optim

a list of functions implementing suitable optimisers

Details

This function fits a conditional transformation model by searching for the most likely transformation as described in Hothorn et al. (2018) and Hothorn (2020).

References

Torsten Hothorn, Lisa Moest, Peter Buehlmann (2018), Most Likely Transformations, Scandinavian Journal of Statistics, 45(1), 110--134, tools:::Rd_expr_doi("10.1111/sjos.12291").

Torsten Hothorn (2020), Most Likely Transformations: The mlt Package, Journal of Statistical Software, 92(1), 1--68, tools:::Rd_expr_doi("10.18637/jss.v092.i01")

Sandra Siegfried, Lucas Kook, Torsten Hothorn (2023), Distribution-Free Location-Scale Regression, The American Statistician, 77(4), 345--356, tools:::Rd_expr_doi("10.1080/00031305.2023.2203177").

Examples

Run this code
 
  ### set-up conditional transformation model for conditional
  ### distribution of dist given speed
  dist <- numeric_var("dist", support = c(2.0, 100), bounds = c(0, Inf))
  speed <- numeric_var("speed", support = c(5.0, 23), bounds = c(0, Inf)) 
  ctmm <- ctm(response = Bernstein_basis(dist, order = 4, ui = "increasing"),
              interacting = Bernstein_basis(speed, order = 3))

  ### fit model
  mltm <- mlt(ctmm, data = cars)

  ### plot data
  plot(cars)
  ### predict quantiles and overlay data with model via a "quantile sheet"
  q <- predict(mltm, newdata = data.frame(speed = 0:24), type = "quantile", 
               p = 2:8 / 10, K = 500)
  tmp <- apply(q, 1, function(x) lines(0:24, x, type = "l"))

Run the code above in your browser using DataLab