IMLInvestment
Model Library

Risk measurement / v1.0.0

Two-asset portfolio variance

Reconcile capital weights and covariance into a portfolio variance and volatility at the input frequency.

Synthetic educational references. Not a fitted investment strategy, forecast, provider model or client return. First publication: 2026-10-16. Model and engine version 1.0.0.

Calculation contract

v_p = w1^2*v1 + 2*w1*w2*c12 + w2^2*v2; sigma_p = sqrt(v_p)
Version 1.0.0 input contract
InputAllowed valuesMeaning
weightsTwo nonnegative decimals summing to oneCapital weights in covariance asset order
covarianceSymmetric PSD 2x2 matrix; entries -100 to 100Same-frequency squared decimal-return units; nonnegative diagonal

Method and interpretation

The cross term is essential. Adding weighted standalone variances while ignoring covariance changes the model rather than simplifying the same calculation. With default weights 0.6/0.4, the variance is 0.01888; its square root is approximately 0.1374045.

No annualization is hidden in the engine. Annual covariance produces annual volatility; period covariance produces period volatility. Inputs labelled percentages must first be converted to decimals, and covariance scales with the square of that conversion.

Where the reference stops

The matrix summarizes second moments, not tail loss or liquidity. Shorting, derivatives, nonlinear exposure and cash flows are outside this two-asset card. Symmetry and positive semidefiniteness are mathematical admission checks, not evidence that an estimate is economically reliable.

Published synthetic inputs

{
  "weights": [
    0.6,
    0.4
  ],
  "covariance": [
    [
      0.04,
      0.006
    ],
    [
      0.006,
      0.01
    ]
  ]
}

Frozen calculation output

{
  "variance": 0.01888,
  "volatility": 0.13740451229854134
}

Two aligned long-only weights and a same-frequency covariance matrix. No additional annualization is applied.

Verification coverage

  • Direct quadratic form, zero weights and perfectly offsetting covariance checked.
  • Order consistency, weight sums and PSD bounds validated.

Unit and independent-reference checks test arithmetic and rejection rules, not future investment performance.

Method references

Read the assumptions in context

Risk measurement

Component Risk Contributions Are Not Capital Weights

Volatility contributions allocate a portfolio-level estimate. They can be negative or exceed the total, even when every capital weight is positive.

Risk measurement

Covariance Units and Frequency Must Travel With the Matrix

Decimal versus percentage returns and daily versus annual horizons change covariance scales. Correct matrix multiplication cannot repair mismatched units or unsupported time aggregation.