cpit: Conditional probability integral transform

View source: R/cpit.R

cpitR Documentation

Conditional probability integral transform

Description

Calculates the conditional distribution of the response given the covariates.

Usage

cpit(object, newdata, cores = 1)

Arguments

object

an object of class vinereg.

newdata

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

cores

integer; the number of cores to use for computations.

Examples


# 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)

hist(cpit(fit, dat)) # should be approximately uniform

vinereg documentation built on Nov. 2, 2023, 5:51 p.m.