Calculates the conditional density of the response given the covariates.

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

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

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

cpdf(fit, dat)
#>   [1] 7.702229e+00 7.786503e+00 6.770718e+00 3.907868e+00 6.299966e+00
#>   [6] 7.302949e+00 2.162574e-03 7.543265e+00 6.841347e+00 4.088258e+00
#>  [11] 3.748545e+00 5.765243e+00 4.380030e+00 7.250959e+00 4.717733e+00
#>  [16] 7.705719e+00 4.910442e+00 7.637205e+00 5.627719e+00 6.574962e+00
#>  [21] 4.939933e+00 5.565616e+00 6.716775e+00 6.559413e-02 4.983052e+00
#>  [26] 3.859757e+00 1.042508e-01 8.042180e+00 4.002169e+00 4.571622e+00
#>  [31] 1.486020e+00 4.638830e+00 3.127500e+00 5.668684e+00 4.258756e+00
#>  [36] 4.350911e+00 3.832283e+00 4.024594e+00 3.107419e+00 6.023398e+00
#>  [41] 4.469347e+00 7.610951e+00 5.024515e+00 7.476611e+00 7.366826e+00
#>  [46] 7.795914e+00 5.752886e+00 6.558990e+00 5.712558e+00 5.379007e+00
#>  [51] 4.702264e+00 3.138509e+00 3.113534e+00 4.994948e+00 7.133428e+00
#>  [56] 7.825007e+00 7.039635e+00 7.253096e+00 6.488448e+00 7.781031e+00
#>  [61] 4.633483e+00 6.717213e+00 6.480285e+00 5.869497e+00 6.785177e+00
#>  [66] 3.420703e+00 8.210606e+00 2.683296e+00 7.079232e+00 1.105640e+00
#>  [71] 3.161915e+00 7.385288e+00 6.733156e+00 6.865336e-01 7.573989e+00
#>  [76] 7.799372e+00 4.026715e+00 7.159457e+00 6.741621e+00 6.192476e+00
#>  [81] 4.091345e+00 5.263136e+00 5.672809e+00 6.869510e+00 5.666585e+00
#>  [86] 5.938310e+00 8.217052e+00 6.322439e+00 5.568050e+00 6.166252e+00
#>  [91] 5.910217e+00 7.947402e+00 2.180331e+00 5.380805e+00 4.360616e-06
#>  [96] 7.506010e+00 7.819416e+00 5.016344e+00 7.698130e+00 6.848461e+00
#> [101] 7.273516e+00 5.598446e+00 7.582217e+00 5.087860e+00 7.362124e+00
#> [106] 7.189107e-01 6.913791e+00 4.191336e+00 6.695376e-01 3.365240e+00
#> [111] 5.593613e-02 6.418154e+00 7.642081e+00 3.583431e+00 5.019747e+00
#> [116] 6.130364e+00 5.642868e+00 6.346182e+00 6.812571e+00 6.077757e+00
#> [121] 3.833449e+00 1.471041e+00 5.216980e+00 5.633811e+00 6.596945e+00
#> [126] 4.240371e+00 6.987894e+00 5.161893e+00 5.446191e+00 6.531481e+00
#> [131] 4.902632e+00 6.413921e+00 6.658343e+00 8.151096e+00 3.241175e+00
#> [136] 8.670457e+00 4.083574e-01 7.690153e+00 9.877669e-01 6.074161e+00
#> [141] 5.767878e+00 3.800360e+00 7.540807e+00 7.799747e+00 7.520508e+00
#> [146] 2.508644e+00 8.976693e+00 6.228953e+00 2.808001e+00 8.071260e+00
#> [151] 3.702673e+00 4.698071e+00 4.076998e+00 4.162422e+00 6.835786e+00
#> [156] 4.819522e+00 5.827331e+00 4.304387e+00 6.841837e+00 8.188474e+00
#> [161] 5.812410e+00 5.713034e+00 7.556208e+00 7.061019e+00 3.326674e+00
#> [166] 1.232830e+00 4.571277e+00 7.977774e+00 6.055875e+00 4.085833e+00
#> [171] 8.559612e+00 6.402495e+00 4.958564e+00 3.303412e+00 6.355727e+00
#> [176] 5.005700e+00 2.461110e+00 8.699447e+00 7.360022e+00 7.561845e+00
#> [181] 3.122473e-01 4.698262e+00 6.744344e+00 8.587991e+00 7.839179e+00
#> [186] 4.900903e+00 3.577782e+00 6.934802e+00 3.663421e+00 6.996445e+00
#> [191] 4.435527e+00 3.581656e+00 6.904131e+00 7.838745e+00 8.079613e+00
#> [196] 1.293565e-01 1.665414e+00 4.160496e+00 6.533835e+00 1.159444e-01
#> [201] 4.225522e+00 7.639615e+00 8.021576e+00 4.187206e+00 1.918976e-01
#> [206] 6.817152e+00 7.435194e+00 4.410293e-02 6.733230e+00 7.892006e+00
#> [211] 4.485881e+00 1.564385e+00 5.865665e+00 7.779485e+00 3.188950e+00
#> [216] 1.042826e+00 4.314377e+00 7.596939e+00 3.325105e+00 3.807630e+00
#> [221] 3.300394e+00 5.359272e+00 5.827411e+00 7.239567e+00 7.315356e+00
#> [226] 3.709037e-01 7.637483e+00 8.079161e+00 3.266893e+00 5.409966e+00
#> [231] 4.625318e+00 2.628123e+00 3.276293e+00 5.820995e+00 8.451177e-01
#> [236] 4.520307e-01 4.899131e+00 1.472202e+00 5.567458e-03 6.973750e+00
#> [241] 6.603349e+00 8.752171e-01 6.970573e+00 7.956458e+00 8.140064e-06
#> [246] 1.173534e+00 7.801674e+00 5.679846e+00 7.735491e+00 7.084380e+00