Skip to contents

univariate_distribution() describes the law of one input, as the distributions of Distributions.jl do in GlobalSensitivity.jl. Give a family of the stats package by its suffix ("unif", "norm", "gamma", ...) and its parameters, or the random generator r(n), the distribution function p(x) and the quantile function q(u) directly. SklarDist() joins marginal distributions with a copula: IndependentCopula(d) for independent inputs or GaussianCopula(Sigma) with the correlation matrix Sigma, as SklarDist of Copulas.jl.

Usage

univariate_distribution(family = NULL, ..., r = NULL, p = NULL, q = NULL)

IndependentCopula(d)

GaussianCopula(Sigma)

SklarDist(copula, marginals)

dist_rand(D, n)

Arguments

family

Suffix of a stats distribution family, or NULL.

...

Parameters of the family, such as min and max.

r, p, q

Random generator, distribution function and quantile function; they override the family.

d

Dimension of the copula.

Sigma

Correlation matrix of the Gaussian copula.

copula

A copula.

marginals

List of univariate distributions, one per input.

D

A distribution.

n

Number of draws.

Value

A distribution object.

dist_rand() returns n draws of a univariate distribution, or a d x n matrix for a SklarDist.

Examples

x1 <- univariate_distribution("unif", min = -pi, max = pi)
x2 <- univariate_distribution("norm", mean = 0, sd = 2)
D <- SklarDist(GaussianCopula(matrix(c(1, 0.5, 0.5, 1), 2)), list(x1, x2))
set.seed(1)
dist_rand(D, 3)
#>            [,1]      [,2]       [,3]
#> [1,] -1.4733525 -1.874388  0.8112474
#> [2,] -0.3083742  1.927479 -1.0915852