Plot, predict and sample from objects of class mlt
# S3 method for ctm
plot(x, newdata, type = c("distribution", "survivor", "density",
"logdensity", "hazard", "loghazard", "cumhazard", "quantile", "trafo"),
q = NULL, prob = 1:(K - 1) / K, K = 50, col = rgb(.1, .1, .1, .1), lty = 1,
add = FALSE, ...)
# S3 method for mlt
plot(x, ...)
# S3 method for ctm
predict(object, newdata, type = c("trafo", "distribution",
"survivor", "density", "logdensity", "hazard", "loghazard", "cumhazard",
"quantile"), terms = c("bresponse", "binteracting", "bshifting"),
q = NULL, prob = NULL, K = 50, interpolate = TRUE, ...)
# S3 method for mlt
predict(object, newdata = object$data, ...)
# S3 method for ctm
simulate(object, nsim = 1, seed = NULL, newdata, K = 50, q = NULL,
interpolate = TRUE, bysim = TRUE, ...)
# S3 method for mlt
simulate(object, nsim = 1, seed = NULL, newdata = object$data, bysim = TRUE, ...)a fitted conditional transformation model as returned by mlt
an optional data frame of observations
type of prediction or plot to generate
quantiles at which to evaluate the model
probabilities for the evaluation of the quantile function (type = "quantile")
terms to evaluate for the predictions, corresponds to the argument
response, interacting and shifting in ctm
number of grid points to generate (in the absence of q)
color for the lines to plot
line type for the lines to plot
logical indicating if a new plot shall be generated (the default)
logical indicating if quantiles shall be interpolated linearily
number of samples to generate
optional seed for the random number generator
logical, if TRUE a list with nsim elements is returned,
each element is of length nrow(newdata) and
contains one sample from the conditional distribution for each
row of newdata. If FALSE, a list of length nrow(newdata)
is returned, its ith element of length nsim contains nsim samples
from the conditional distribution given newdata[i,].
additional arguments
plot evaluates the transformation function over a grid of q values
for all observations in newdata and plots these functions (according to
type). predict evaluates the transformation function over a grid
of q values for all observations in newdata and returns the
result as a matrix (where _columns_ correspond to _rows_ in newdata).
Note that the predict method for ctm objects requires all
model coefficients to be specified in this unfitted model.
simulate draws samples from object by numerical inversion of the
quantile function.