qis.GaussianMonteCarlo

class qis.GaussianMonteCarlo(spec)[source]

Bases: object

Reusable antithetic normal draws for portfolio and benchmark marginal VaR.

Projecting an asset Gaussian onto two linear portfolios has the same distribution as simulating all asset shocks and applying their weights. The first shock represents the benchmark; the second the portfolio residual. Identical portfolios have exactly unit VaR ratio. Draws can be reused across reporting dates for reproducible common-random-number comparisons.

Variables:

spec – Confidence, horizon, scenario count and random seed.

Parameters:

spec (GaussianVarSpec)

__init__(spec)[source]
Parameters:

spec (GaussianVarSpec)

Methods

__init__(spec)

var(portfolio_variance, benchmark_variance, ...)

Compute loss-positive portfolio and benchmark VaR.

var(portfolio_variance, benchmark_variance, cross_covariance)[source]

Compute loss-positive portfolio and benchmark VaR.

Parameters:
  • portfolio_variance (float) – Portfolio variance per covariance time unit.

  • benchmark_variance (float) – Benchmark variance in the same units.

  • cross_covariance (float) – Portfolio/benchmark covariance in the same units.

Returns:

Portfolio and benchmark loss quantiles over the configured horizon.

Raises:

ValueError – If joint moments are nonfinite or not positive semidefinite.

Return type:

tuple[float, float]