risk.ArchimedeanCopula
An exchangeable Archimedean copula: Clayton, Gumbel, Frank or Joe.
Usage
risk.ArchimedeanCopula()Parameters
family: (clayton, gumbel, frank, joe) = "clayton"theta: float-
Positive for Clayton and Frank; at least 1 for Gumbel and Joe.
dim: int
Raises
ValueError- If the family is unknown or theta is out of range.
Examples
>>> from prospicio.risk import ArchimedeanCopula
>>> c = ArchimedeanCopula("clayton", 2.0, 3) # Kendall's tau 0.5
>>> c.dim, c.family(3, ‘clayton’)
Attributes
| Name | Description |
|---|---|
| dim | Number of dimensions. |
| family | Family name. |
| theta | Copula parameter. |
dim
Number of dimensions.
dim: int
family
Family name.
family: str
theta
Copula parameter.
theta: float
Methods
| Name | Description |
|---|---|
| cdf() | The copula’s distribution function at the point u, each |
| sample() |
n draws of uniforms; draw i uses stream i of seed.
|
cdf()
The copula’s distribution function at the point u, each
Usage
cdf(u)coordinate in [0, 1].
Parameters
u: list of float- One value per dimension.
Returns
float
Raises
ValueError-
If u has the wrong length or a value outside
[0, 1], or the copula has no closed-form distribution function here.
Examples
>>> from prospicio.risk import ArchimedeanCopula
>>> c = ArchimedeanCopula("clayton", 2.0, 2)
>>> round(c.cdf([0.3, 0.6]), 12) == round((0.3**-2 + 0.6**-2 - 1) ** -0.5, 12)True
sample()
Usage
sample(n, seed)Parameters
n: intseed: int
Returns
list of list of float