Base Python wrapper for a bound C++ copula.
The wrapper intentionally stores the C++ object as an opaque implementation
detail. Use :class:`CopulaFactoryWrapper` to create instances from Python
configuration objects.
Args:
cpp_obj: Bound C++ copula instance.
Definition at line 21 of file Copula.py.
| Union[List[float], List[List[float]]] Copula.Copula.sample_u |
( |
|
self, |
|
|
Optional[int] |
n = None |
|
) |
| |
Draw one or more dependent uniform samples.
Args:
n: Number of samples. When omitted, returns a single vector of
dependent uniforms. When provided, returns a list of ``n``
vectors.
Returns:
A single ``list[float]`` if ``n`` is ``None``; otherwise a
``list[list[float]]`` with shape ``n x dim``.
Raises:
ValueError: If ``n`` is negative.
Examples:
>>> cop = CopulaFactoryWrapper.gaussian([[1.0, 0.5], [0.5, 1.0]], seed=123)
>>> u = cop.sample_u()
>>> len(u)
2
>>> U = cop.sample_u(3)
>>> len(U)
3
Definition at line 56 of file Copula.py.