{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $n, p, m \\ge 1$.\nA *general linear model* is a statistical model for a random $n \\times m$ response matrix $Y$ of the form\n$$Y = X B + U,$$\nwhere:\n\n1. $X$ is a known real $n \\times p$ matrix, the *design matrix*;\n2. $B$ is an unknown real $p \\times m$ matrix of coefficients;\n3. $U$ is a random $n \\times m$ error matrix whose rows are independent with [[expected value|0WQNRCNY3M]] $0$ and a common [[covariance matrix|0V7G6WMFK0]] $\\Sigma$.\n\nOften the rows of $U$ are assumed to follow the [[multivariate normal distribution|0XN3K7RSZY]] $N_m(0, \\Sigma)$.\n\n## Remarks\n\nWith $m = 1$, the model is $y = X\\beta + \\varepsilon$, multiple [[linear regression|41FVC4P5JB]], and $\\Sigma = \\sigma^2$ is a single variance.\n\nExample: the comparison of two group means.\nLet observations $1, \\dots, n_1$ belong to group $1$ and the others to group $2$, and let $X$ have two columns: the indicator of group $1$ and the indicator of group $2$.\nThen $\\beta = (\\mu_1, \\mu_2)^T$, and the model says that $y_i$ has mean $\\mu_1$ or $\\mu_2$ according to its group, with a common error variance.\nThis is the model of the two-sample $t$-test.\n\nNon-example: the model $E[y_i] = \\exp(x_i^T \\beta)$ is not a general linear model.\nIts mean is not a linear function of $\\beta$, so it cannot be written as the $i$-th entry of $X B$.\n\nWhen $X$ has rank $p$, the least squares estimate is $\\hat B = (X^T X)^{-1} X^T Y$, computed column by column.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "A06SGFCSCE",
    "kind": "definition",
    "msc": [
      "62J05",
      "62J10",
      "62H12"
    ],
    "name": "General linear model",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/General_linear_model"
      }
    ],
    "tag": "GQM8GPBRYN",
    "uses": [
      "41FVC4P5JB",
      "0V7G6WMFK0",
      "0WQNRCNY3M",
      "0XN3K7RSZY"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/GQM8GPBRYN/",
  "links": [
    {
      "field": "defines",
      "target": "A06SGFCSCE"
    },
    {
      "field": "uses",
      "target": "41FVC4P5JB"
    },
    {
      "field": "uses",
      "target": "0V7G6WMFK0"
    },
    {
      "field": "uses",
      "target": "0WQNRCNY3M"
    },
    {
      "field": "uses",
      "target": "0XN3K7RSZY"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/GQM8GPBRYN.md",
  "msc": [
    "62J05",
    "62J10",
    "62H12"
  ],
  "name": "General linear model",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/GQM/GQM8GPBRYN.md",
  "status": null,
  "tag": "GQM8GPBRYN",
  "uri": "m2://GQM8GPBRYN",
  "url": "https://tamnd.github.io/math2/wiki/general-linear-model-definition/",
  "writing": {
    "tag": "GQM8GPBRYN",
    "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
      }
    ]
  }
}
