Skip to contents

Mirrors the C# BivariateEmpirical class of the Numerics library: a joint distribution defined over a grid of two marginal value vectors and a matrix of associated probabilities.

Usage

mvdist_bivariate_empirical(
  x1,
  x2,
  p,
  x1_transform = "None",
  x2_transform = "None",
  p_transform = "None"
)

Arguments

x1, x2

numeric vectors of grid values for each dimension.

p

a length(x1) x length(x2) matrix of joint probabilities.

x1_transform, x2_transform, p_transform

how each axis is interpolated between: one of "None" (the default), "Logarithmic", or "NormalZ".

Value

a corehydro_mvdist of family "BivariateEmpirical". Note: pdf is an upstream stub (see mvdist_pdf()).

Examples

mv <- mvdist_bivariate_empirical(c(1, 2), c(1, 2), matrix(c(0.2, 0.3, 0.2, 0.3), nrow = 2))
mvdist_cdf(mv, c(1.5, 1.5))
#> [1] 0.25