{
  "slug": "portfolio-variance",
  "title": "Two-asset portfolio variance",
  "topic": "risk",
  "summary": "Reconcile capital weights and covariance into a portfolio variance and volatility at the input frequency.",
  "version": "1.0.0",
  "published": "2026-10-16",
  "status": "Educational reference",
  "formula": "v_p = w1^2*v1 + 2*w1*w2*c12 + w2^2*v2; sigma_p = sqrt(v_p)",
  "inputs": [
    [
      "weights",
      "Two nonnegative decimals summing to one",
      "Capital weights in covariance asset order"
    ],
    [
      "covariance",
      "Symmetric PSD 2x2 matrix; entries -100 to 100",
      "Same-frequency squared decimal-return units; nonnegative diagonal"
    ]
  ],
  "method": [
    "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."
  ],
  "limits": [
    "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."
  ],
  "checks": [
    "Direct quadratic form, zero weights and perfectly offsetting covariance checked.",
    "Order consistency, weight sums and PSD bounds validated."
  ],
  "related": [
    "covariance-units",
    "component-risk-and-capital"
  ],
  "sources": [
    {
      "title": "MOSEK: portfolio variance and allocation constraints",
      "url": "https://docs.mosek.com/portfolio-cookbook/markowitz.html"
    }
  ],
  "example": {
    "weights": [
      0.6,
      0.4
    ],
    "covariance": [
      [
        0.04,
        0.006
      ],
      [
        0.006,
        0.01
      ]
    ]
  },
  "frozen_result": {
    "schema_version": 1,
    "model_id": "portfolio-variance",
    "model_version": "1.0.0",
    "engine_version": "1.0.0",
    "published_at": "2026-10-16",
    "scope": "Synthetic educational reference calculation. Not a fitted investment strategy, forecast, provider model or client return.",
    "inputs": {
      "weights": [
        0.6,
        0.4
      ],
      "covariance": [
        [
          0.04,
          0.006
        ],
        [
          0.006,
          0.01
        ]
      ]
    },
    "outputs": {
      "variance": 0.01888,
      "volatility": 0.13740451229854134
    },
    "notes": [
      "Two aligned long-only weights and a same-frequency covariance matrix. No additional annualization is applied."
    ]
  }
}
