{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $X$ and $Y$ be real random variables on one probability space with finite and positive variances.\nThe correlation coefficient of $X$ and $Y$ is\n$$\\rho_{X, Y} = \\operatorname{Corr}(X, Y) = \\frac{\\operatorname{Cov}(X, Y)}{\\sigma_X \\, \\sigma_Y},$$\nwhere $\\operatorname{Cov}$ is the [[covariance|0DJ8W3HP2D]] and $\\sigma_X$, $\\sigma_Y$ are the [[standard deviations|0VTN5RKNC5]].\n\n## Remarks\n\nBy the Cauchy–Schwarz inequality, $-1 \\le \\rho_{X, Y} \\le 1$.\n$|\\rho_{X, Y}| = 1$ if and only if $Y = aX + b$ almost surely for some reals $a \\ne 0$ and $b$. The sign of $\\rho$ is the sign of $a$.\nThe coefficient does not depend on units: $\\rho_{aX + b, \\, cY + d} = \\rho_{X, Y}$ if $a c \u003e 0$.\nFor a sample of pairs $(x_i, y_i)$, the sample correlation coefficient $r$ uses sample means and sample sums of squares instead of expectations.\n\n## Explanations\n\n### L1 human\n\nThe correlation coefficient tells how close the points $(X, Y)$ are to a straight line.\nA value near $1$ means a strong increasing linear relation, and a value near $-1$ means a strong decreasing one.\nA value near $0$ means that there is no linear relation.\n",
  "commit": "6ac761d40018146541484a9e8b9eafd6ecc303dc",
  "front": {
    "defines": "0DNN9B6Q2F",
    "kind": "definition",
    "msc": [
      "62H20"
    ],
    "name": "Correlation coefficient",
    "sources": [
      {
        "locator": "For a population",
        "url": "https://en.wikipedia.org/wiki/Pearson_correlation_coefficient"
      }
    ],
    "tag": "04CTY6XYWN",
    "uses": [
      "0DJ8W3HP2D",
      "0VTN5RKNC5"
    ]
  },
  "kind": "definition",
  "link": "https://math2.tamnd.com/node/04CTY6XYWN/",
  "links": [
    {
      "field": "defines",
      "target": "0DNN9B6Q2F"
    },
    {
      "field": "uses",
      "target": "0DJ8W3HP2D"
    },
    {
      "field": "uses",
      "target": "0VTN5RKNC5"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/04CTY6XYWN.md",
  "msc": [
    "62H20"
  ],
  "name": "Correlation coefficient",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/04C/04CTY6XYWN.md",
  "status": null,
  "tag": "04CTY6XYWN",
  "uri": "m2://04CTY6XYWN",
  "url": "https://math2.tamnd.com/wiki/correlation-coefficient-definition/",
  "writing": {
    "tag": "04CTY6XYWN",
    "kind": "definition",
    "level": "W1",
    "next": [
      {
        "what": "edge instance_of in",
        "note": "one example",
        "have": 0,
        "want": 1
      },
      {
        "what": "edge not_instance_of in",
        "note": "one non-example that fails one clause",
        "have": 0,
        "want": 1
      }
    ]
  }
}
