predict.crch
Predicted/Fitted Values for CRCH Fits
Obtains various types of predictions for crch
models.
- Keywords
- regression
Usage
# S3 method for crch
predict(object, newdata = NULL, type = c("location", "scale",
"response", "parameter", "density", "probability", "quantile", "crps"),
na.action = na.pass, at = 0.5, left = NULL, right = NULL, …)
Arguments
- object
an object of class
"crch"
.- newdata
an optional data frame in which to look for variables with which to predict.
- type
type of prediction:
"location"
returns the location of the predicted distribution."scale"
returns the scale of the predicted distribution."response"
returns the expected value of the predicted distribution (not equal to location for censored and truncated distributions)."parameter"
returns a data frame with predicted location and scale parameters."density"
evaluates the predictive density atat
."probability"
evaluates the predictive CDF atat
."quantile"
returns a matrix of predicted quantiles with quantile probabilitiesat
."crps"
returns the CRPS of the predictive distributions atat
.- na.action
a function which indicates what should happen when the data contain
NA
s. Default is na.pass- at
a vector of values to evaluate the predictive density (
type = "density"
), probability (type = "probability"
), or CRPS (type = "crps"
) or a vector of quantile probabilities used fortype = "quantile"
. Alternatively, withat = "function"
a function is returned that takesat
as an argument.- left
left censoring or truncation point. Only used for
type = "quantile"
. If NULL, censoring or truncation point is obtained fromobject
.- right
right censoring or truncation point. Only used for
type = "quantile"
. If NULL, censoring or truncation point is obtained fromobject
.- …
further arguments passed to or from other methods.
Value
For type "response"
, "location"
, or "scale"
a vector with
either the location or the scale of the predicted distribution.
For type "quantile"
a matrix of predicted quantiles each column
corresponding to an element of at
.