Predict from a longitudinal GAMLSS-copula model
Source:R/adoption_workflow.R
predict.gamlss.longitudinal.RdPredict from a longitudinal GAMLSS-copula model
Usage
# S3 method for class 'gamlss.longitudinal'
predict(
object,
newdata = NULL,
type = c("response", "mean", "mu", "median", "parameters", "quantile", "cdf",
"density", "probability"),
probs = c(0.025, 0.5, 0.975),
q = NULL,
y = NULL,
direction = c("below", "above"),
se.fit = FALSE,
interval = c("none", "confidence"),
level = 0.95,
vcov_method = "analytical",
...
)Arguments
- object
A fitted
gamlss.longitudinalobject.- newdata
Optional new data. If omitted, fitted rows are used.
- type
Prediction type:
"mean"returns the fitted marginal response mean,"median"returns the fitted marginal median,"mu"returns the fitted GAMLSSmuparameter,"response"is retained as a compatibility alias for"mu","parameters"returns all fitted marginal distribution parameters,"quantile"returns fitted marginal quantiles,"cdf"/"density"evaluate the fitted marginal CDF or density, and"probability"returns probabilities below or above a threshold.- probs
Quantile probabilities when
type = "quantile".- q
Threshold value for
type = "cdf"ortype = "probability". Defaults to observed responses fortype = "cdf"when available.- y
Evaluation value for
type = "density". Defaults to observed responses when available.- direction
Probability direction for
type = "probability".- se.fit
Logical; for
type = "response","mu", or"mean", return approximate delta-method standard errors for the fittedmulinear predictor contribution. For non-muresponse means this is a first-order approximation and should be treated as exploratory.- interval
Interval type.
"confidence"adds response-scale confidence limits whentype = "response","mu", or"mean".- level
Confidence level for
interval = "confidence".- vcov_method
Variance-covariance method passed to
vcov.gamlss.longitudinal().- ...
Additional arguments reserved for future methods.
Value
A numeric vector for type = "response", "mu", "mean", or
"median" unless standard errors or intervals are requested; a data frame
otherwise.
Details
predict() returns marginal summaries from the fitted distribution at each
requested row. The fitted copula/dependence structure is not used to condition a
row's prediction on that subject's other observed responses. Instead,
dependence affects prediction indirectly through the coefficients estimated by
the joint copula likelihood, and through se.fit/confidence intervals when
the covariance matrix is computed from the joint model. Use
simulate.gamlss.longitudinal() for
fitted-data trajectory simulation that preserves the fitted copula dependence
structure. With newdata, simulation is unconditional and uses the
model-implied dependence evaluated on the supplied panel.
type = "response" is a soft-deprecated compatibility alias for
type = "mu" because GAMLSS mu is not the response mean for every
family. New code should use type = "mean" for response-mean estimands or
type = "mu" for the distribution parameter.