pyvinecopulib

The pyvinecopulib package

BicopFamily

A bivariate copula family identifier.

Bicop

A class for bivariate copula models.

FitControlsBicop

A class for controlling fits of bivariate copula models.

Vinecop

A class for vine copula models.

FitControlsVinecop

A class for controlling fits of vine copula models.

CVineStructure

A class for C-vine structures.

DVineStructure

A class for D-vine structures.

RVineStructure

A class for R-vine structures.

Functions

to_pseudo_obs(x: numpy.ndarray[float64[m, n]], ties_method: str = 'average') → numpy.ndarray[float64[m, n]]

Applies the empirical probability integral transform to a data matrix.

Gives pseudo-observations from the copula by applying the empirical distribution function (scaled by \(n + 1\)) to each margin/column.

Parameter x:

A matrix of real numbers.

Parameter ties_method:

Indicates how to treat ties; same as in R, see https://stat.ethz.ch/R-manual/R-devel/library/base/html/rank.html.

Returns

Pseudo-observations of the copula, i.e. \(F_X(x)\) (column-wise).

simulate_uniform(n: int, d: int, qrng: bool = False, seeds: List[int] = []) → numpy.ndarray[float64[m, n]]

Simulates from the multivariate uniform distribution.

Parameter n:

Number of observations.

Parameter d:

Dimension.

Parameter qrng:

If true, quasi-numbers are generated.

Parameter seeds:

Seeds of the random number generator; if empty (default), the random number generator is seeded randomly.

If qrng = TRUE, generalized Halton sequences (see ghalton()) are used for \(d \leq 300\) and Sobol sequences otherwise (see sobol()).

Returns

math:mathrm{U}[0, 1] random variables.

Return type

An \(n \times d\) matrix of independent

ghalton(n: int, d: int, seeds: List[int] = []) → numpy.ndarray[float64[m, n]]

Simulates from the multivariate Generalized Halton Sequence.

For more information on Generalized Halton Sequence, see Faure, H., Lemieux, C. (2009). Generalized Halton Sequences in 2008: A Comparative Study. ACM-TOMACS 19(4), Article 15.

Parameter n:

Number of observations.

Parameter d:

Dimension.

Parameter seeds:

Seeds to scramble the quasi-random numbers; if empty (default), the quasi-random number generator is seeded randomly.

Returns

math:mathrm{U}[0, 1] variables.

Return type

An \(n \times d\) matrix of quasi-random

sobol(n: int, d: int, seeds: List[int] = []) → numpy.ndarray[float64[m, n]]

Simulates from the multivariate Sobol sequence.

For more information on the Sobol sequence, see S. Joe and F. Y. Kuo (2008), constructing Sobol sequences with better two-dimensional projections, SIAM J. Sci. Comput. 30, 2635–2654.

Parameter n:

Number of observations.

Parameter d:

Dimension.

Parameter seeds:

Seeds to scramble the quasi-random numbers; if empty (default), the quasi-random number generator is seeded randomly.

Returns

math:mathrm{U}[0, 1] variables.

Return type

An \(n \times d\) matrix of quasi-random