| mlt | R Documentation |
Likelihood-based model estimation in conditional transformation models
mlt(model, data, weights = NULL, offset = NULL, fixed = NULL,
theta = NULL, pstart = NULL, scaleparm = TRUE,
dofit = TRUE, optim = mltoptim(hessian = has_scale(model)))
model |
a conditional transformation model as specified by |
data |
a |
weights |
an optional vector of case weights |
offset |
an optional vector of offset values; offsets are not added
to an optional |
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 |
scaleparm |
a logical indicating if (internal) scaling shall be applied to the
model parameters; |
dofit |
a logical indicating if the model shall be fitted to the
data ( |
optim |
a list of functions implementing suitable optimisers, requires numerical Hessian for location-scale models |
This function fits a conditional transformation model by searching for the most likely transformation as described in \bibcitetmlt::Hothorn:Moest:Buehlmann:2017, including location-scale models \bibcitepSiegfried_Kook_Hothorn_2023. Implementation details are given in \bibcitepmlt::Hothorn:2018.
An object of class mlt with corresponding methods.
*
### 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"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.