Learn R Programming

vinereg (version 0.11.0)

cpdf: Conditional PDF

Description

Calculates the conditional density of the response given the covariates.

Usage

cpdf(object, newdata, cores = 1)

Arguments

object

an object of class vinereg.

newdata

matrix of response and covariate values for which to compute the conditional density

cores

integer; the number of cores to use for computations.

Examples

Run this code
# \dontshow{
set.seed(1)
# }
# simulate data
x <- matrix(rnorm(100), 50, 2)
y <- x %*% c(1, -2)
dat <- data.frame(y = y, x = x, z = as.factor(rbinom(50, 2, 0.5)))

# fit vine regression model
fit <- vinereg(y ~ ., dat)

cpdf(fit, dat)

Run the code above in your browser using DataLab