predict.kdecopula: Prediction method for 'kdecop()' fits

Description Usage Arguments Value Examples

Description

Predicts the pdf, cdf, or (inverse) h-functions by calling dkdecop(), pkdecop(), or hkdecop().

Usage

1
2
3
## S3 method for class 'kdecopula'
predict(object, newdata, what = "pdf", stable = FALSE,
  ...)

Arguments

object

an object of class kdecopula.

newdata

evaluation point(s), a length two vector or a matrix with two columns.

what

what to predict, one of c("pdf", "cdf", "hfunc1", "hfunc2", "hinv1", "hinv2").

stable

only used for what = "pdf", see dkdecop().

...

unused.

Value

A numeric vector of predictions.

Examples

1
2
3
4
5
6
data(wdbc)
udat <- apply(wdbc[, -1], 2, function(x) rank(x) / (length(x) + 1))
fit <- kdecop(udat[, 5:6])

all.equal(predict(fit, c(0.1, 0.2)), dkdecop(c(0.1, 0.2), fit))
all.equal(predict(fit, udat, "hfunc1"), hkdecop(udat, fit, cond.var = 1))

Example output

[1] TRUE
[1] TRUE

kdecopula documentation built on May 2, 2019, 1:06 a.m.