Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

predict.crch

Predicted/Fitted Values for CRCH Fits


Description

Obtains various types of predictions for crch models.

Usage

## S3 method for class '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 at at. "probability" evaluates the predictive CDF at at. "quantile" returns a matrix of predicted quantiles with quantile probabilities at. "crps" returns the CRPS of the predictive distributions at at.

na.action

a function which indicates what should happen when the data contain NAs. 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 for type = "quantile". Alternatively, with at = "function" a function is returned that takes at as an argument.

left

left censoring or truncation point. Only used for type = "quantile". If NULL, censoring or truncation point is obtained from object.

right

right censoring or truncation point. Only used for type = "quantile". If NULL, censoring or truncation point is obtained from object.

...

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.

See Also


crch

Censored Regression with Conditional Heteroscedasticity

v1.0-4
GPL-2 | GPL-3
Authors
Jakob Messner [aut, cre] (<https://orcid.org/0000-0002-1027-3673>), Achim Zeileis [aut] (<https://orcid.org/0000-0003-0918-3766>), Reto Stauffer [aut] (<https://orcid.org/0000-0002-3798-5507>)
Initial release
2019-08-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.