plot-predict-simulate {mlt} | R Documentation |
Plot, predict and sample from objects of class mlt
## S3 method for class '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), add = FALSE, ...) ## S3 method for class 'mlt' plot(x, ...) ## S3 method for class '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 class 'mlt' predict(object, newdata = object$data, ...) ## S3 method for class 'ctm' simulate(object, nsim = 1, seed = NULL, newdata, K = 50, q = NULL, interpolate = TRUE, bysim = TRUE, ...) ## S3 method for class 'mlt' simulate(object, nsim = 1, seed = NULL, newdata = object$data, bysim = TRUE, ...)
object |
a fitted conditional transformation model as returned by |
x |
a fitted conditional transformation model as returned by |
newdata |
an optional data frame of observations |
type |
type of prediction or plot to generate |
q |
quantiles at which to evaluate the model |
prob |
probabilities for the evaluation of the quantile function ( |
terms |
terms to evaluate for the predictions, corresponds to the argument
|
K |
number of grid points to generate (in the absence of |
col |
color for the lines to plot |
add |
logical indicating if a new plot shall be generated (the default) |
interpolate |
logical indicating if quantiles shall be interpolated linearily |
nsim |
number of samples to generate |
seed |
optional seed for the random number generator |
bysim |
logical, if |
... |
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.