Class GaussianCopula
Both samplers emit correlated uniforms; feed them through your
marginals' inverse CDFs. The Gaussian copula has no tail dependence:
joint extremes are asymptotically independent, the property famously
blamed for pre-2008 CDO models. The Student-t copula with few degrees
of freedom has strong symmetric tail dependence (extremes cluster)
and converges to the Gaussian as df → ∞; the tests pin both
behaviors. Correlation matrices are factored at construction with
PsdMatrices.choleskyPsd(double[][]): a positive semi-definite matrix
(including a rank-deficient one) is accepted, an indefinite one fails
here rather than as NaN samples later; repair an estimated matrix with
PsdMatrices.nearestCorrelation(double[][]) first. Deterministic per seed via
the caller-owned RandomGenerator.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintvoidsample(RandomGenerator rnd, double[] out, double[] scratch) One Gaussian-copula draw:out[i]are correlated uniforms in (0, 1).voidsampleT(RandomGenerator rnd, int df, double[] out, double[] scratch) One Student-t-copula draw withdfdegrees of freedom: the same correlated Gaussians divided by a shared √(χ²/df) — the shared shock is what creates tail dependence (one bad draw drags every factor's tail together).
-
Constructor Details
-
GaussianCopula
public GaussianCopula(double[][] correlation) - Parameters:
correlation- symmetric positive semi-definite correlation matrix
-
-
Method Details
-
sample
One Gaussian-copula draw:out[i]are correlated uniforms in (0, 1). Arrays are caller-owned;scratchmust be a second array of the same length (kept separate so the sampler allocates nothing per draw). -
sampleT
One Student-t-copula draw withdfdegrees of freedom: the same correlated Gaussians divided by a shared √(χ²/df) — the shared shock is what creates tail dependence (one bad draw drags every factor's tail together). Uniforms come from the exact t-CDF (SpecialFunctions.tCdf(double, double)); a moment-matched normal approximation here would distort exactly the tail quantiles this sampler exists to model (at df = 3 it puts ~37% excess mass below the 1% level). -
dimension
public int dimension()
-