pyvinecopulib¶
The pyvinecopulib package¶
A bivariate copula family identifier. |
|
A class for bivariate copula models. |
|
A class for controlling fits of bivariate copula models. |
|
A class for vine copula models. |
|
A class for controlling fits of vine copula models. |
|
A class for C-vine structures. |
|
A class for D-vine structures. |
|
A class for R-vine structures. |
Functions¶
- to_pseudo_obs(x: numpy.ndarray[numpy.float64[m, n]], ties_method: str = 'average') → numpy.ndarray[numpy.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).
- Parameter
- simulate_uniform(n: int, d: int, qrng: bool = False, seeds: List[int] = []) → numpy.ndarray[numpy.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 (seeghalton()
) are used for \(d \leq 300\) and Sobol sequences otherwise (seesobol()
).- Returns
math:mathrm{U}[0, 1] random variables.
- Return type
An \(n \times d\) matrix of independent
- Parameter
- ghalton(n: int, d: int, seeds: List[int] = []) → numpy.ndarray[numpy.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
- Parameter
- sobol(n: int, d: int, seeds: List[int] = []) → numpy.ndarray[numpy.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
- Parameter