{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $X$ be a random vector in $\\R^p$ and $Y$ a random vector in $\\R^q$, with finite second moments.\nAssume that the [[covariance matrices|0V7G6WMFK0]] $\\Sigma_{XX}$ and $\\Sigma_{YY}$ are [[positive definite|0KX66CZMBB]], and let $\\Sigma_{XY} = \\operatorname{Cov}(X, Y)$.\nLet $m = \\min(p, q)$.\nFor $i = 1, \\ldots, m$, the $i$-th pair of *canonical variates* $(a_i^T X, b_i^T Y)$ is defined inductively:\n$a_i \\in \\R^p$ and $b_i \\in \\R^q$ maximise the [[correlation|0DNN9B6Q2F]] $\\operatorname{Corr}(a^T X, b^T Y)$ under these constraints:\n\n1. $\\operatorname{Var}(a^T X) = \\operatorname{Var}(b^T Y) = 1$;\n2. $\\operatorname{Cov}(a^T X, a_j^T X) = 0$ for all $j \u003c i$;\n3. $\\operatorname{Cov}(b^T Y, b_j^T Y) = 0$ for all $j \u003c i$.\n\nThe maximal value $\\rho_i = \\operatorname{Corr}(a_i^T X, b_i^T Y)$ is the $i$-th *canonical correlation*.\n\n## Remarks\n\nOne has $1 \\ge \\rho_1 \\ge \\rho_2 \\ge \\cdots \\ge \\rho_m \\ge 0$.\nThe numbers $\\rho_1^2, \\ldots, \\rho_m^2$ are the $m$ largest [[eigenvalues|0BQAA2BK3Q]] of $\\Sigma_{XX}^{-1} \\Sigma_{XY} \\Sigma_{YY}^{-1} \\Sigma_{YX}$.\nExample: for $p = q = 1$, the only canonical correlation is $\\rho_1 = \\abs{\\operatorname{Corr}(X, Y)}$, attained with $b_1 = \\pm 1/\\sqrt{\\operatorname{Var}(Y)}$ chosen with the sign of the covariance.\nNon-example: for $X = (X_1, X_2)$ with $X_1 = Y$ and $X_2$ independent of $Y$, the pair $a = (0, 1)/\\sqrt{\\operatorname{Var}(X_2)}$ gives correlation $0$, which is not maximal, since $a = (1, 0)/\\sqrt{\\operatorname{Var}(Y)}$ gives correlation $1$.\nThe sample version replaces the covariance matrices by sample covariance matrices.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "E0WKQ3XBAC",
    "kind": "definition",
    "msc": [
      "62H20"
    ],
    "name": "Canonical correlation",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Canonical_correlation"
      }
    ],
    "tag": "AWK2MBQ94K",
    "uses": [
      "0DNN9B6Q2F",
      "0V7G6WMFK0",
      "0KX66CZMBB",
      "0BQAA2BK3Q"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/AWK2MBQ94K/",
  "links": [
    {
      "field": "defines",
      "target": "E0WKQ3XBAC"
    },
    {
      "field": "uses",
      "target": "0DNN9B6Q2F"
    },
    {
      "field": "uses",
      "target": "0V7G6WMFK0"
    },
    {
      "field": "uses",
      "target": "0KX66CZMBB"
    },
    {
      "field": "uses",
      "target": "0BQAA2BK3Q"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/AWK2MBQ94K.md",
  "msc": [
    "62H20"
  ],
  "name": "Canonical correlation",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/AWK/AWK2MBQ94K.md",
  "status": null,
  "tag": "AWK2MBQ94K",
  "uri": "m2://AWK2MBQ94K",
  "url": "https://tamnd.github.io/math2/wiki/canonical-correlation-definition/",
  "writing": {
    "tag": "AWK2MBQ94K",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      },
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
