# PIT for a draws object
x <- example_draws()
# Create a vector of observations
y <- rnorm(nvariables(x), 5, 5)
pit(x, y)
# Compute weighted PIT (for example LOO-PIT)
weights <- matrix(runif(length(x)), ncol = nvariables(x))
pit(x, y, weights)
# PIT for an rvar
x <- rvar(example_draws())
# Create an array of observations with the same dimensions as x.
y_arr <- array(rnorm(length(x), 5, 5), dim = dim(x))
pit(x, y_arr)
Run the code above in your browser using DataLab