Learn R Programming

rvinecopulib (version 0.3.2.1.1)

vinecop_predict_and_fitted: Predictions and fitted values for a vine copula model

Description

Predictions of the density and distribution function for a vine copula model.

Usage

# S3 method for vinecop
predict(object, newdata, what = "pdf", n_mc = 10^4,
  cores = 1, ...)

# S3 method for vinecop fitted(object, what = "pdf", n_mc = 10^4, cores = 1, ...)

Arguments

object

a vinecop object.

newdata

points where the fit shall be evaluated.

what

what to predict, either "pdf" or "cdf".

n_mc

number of samples used for quasi Monte Carlo integration when what = "cdf".

cores

number of cores to use; if larger than one, computations are done in parallel on cores batches .

...

unused.

Value

fitted() and predict() have return values similar to dvinecop() and pvinecop().

Details

fitted() can only be called if the model was fit with the keep_data = TRUE option.

Examples

Run this code
# NOT RUN {
u <- sapply(1:5, function(i) runif(50))
fit <- vinecop(u, "par", keep_data = TRUE)
all.equal(predict(fit, u), fitted(fit))
# }

Run the code above in your browser using DataLab