Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
Copula.Copula Class Reference
Inheritance diagram for Copula.Copula:

Public Member Functions

 __init__ (self, Any cpp_obj)
 
"Copula" from_cpp (cls, Any cpp_obj)
 
Union[List[float], List[List[float]]] sample_u (self, Optional[int] n=None)
 
float log_density (self, Sequence[float] u)
 
float density (self, Sequence[float] u)
 

Protected Attributes

 _cpp_obj
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __init__()

Copula.Copula.__init__ (   self,
Any  cpp_obj 
)
Store the bound C++ copula object.

Definition at line 34 of file Copula.py.

Member Function Documentation

◆ density()

float Copula.Copula.density (   self,
Sequence[float]  u 
)
Evaluate the copula density at a point in the unit hypercube.

Args:
    u: Uniform coordinates passed to :meth:`log_density`.

Returns:
    The density value ``c(u)``.

Definition at line 100 of file Copula.py.

◆ from_cpp()

"Copula" Copula.Copula.from_cpp (   cls,
Any  cpp_obj 
)
Wrap a bound C++ copula with the most specific Python class.

Args:
    cpp_obj: Bound C++ copula instance.

Returns:
    ``GaussianCopula`` for Gaussian C++ objects,
    ``StudentTCopula`` for Student-t C++ objects, otherwise the generic
    ``Copula`` wrapper.

Definition at line 39 of file Copula.py.

◆ log_density()

float Copula.Copula.log_density (   self,
Sequence[float]  u 
)
Evaluate the copula log-density at a point in the unit hypercube.

Args:
    u: Uniform coordinates. Each component is expected to lie in
        ``[0, 1]`` and the length must match the copula dimension.

Returns:
    The scalar value ``log c(u)``.

Definition at line 88 of file Copula.py.

◆ sample_u()

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.

Member Data Documentation

◆ _cpp_obj

Copula.Copula._cpp_obj
protected

Definition at line 36 of file Copula.py.


The documentation for this class was generated from the following file: