{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nA *linear mixed model* is a statistical model for a random vector $y \\in \\R^n$ of the form\n$$y = X\\beta + Z u + \\varepsilon,$$\nwhere:\n\n1. $X$ is a known real $n \\times p$ matrix and $\\beta \\in \\R^p$ is an unknown vector of *fixed effects*;\n2. $Z$ is a known real $n \\times q$ matrix and $u$ is a random vector of *random effects* with $u \\sim N_q(0, G)$;\n3. $\\varepsilon \\sim N_n(0, R)$ is a random error vector, independent of $u$;\n4. the [[covariance matrices|0V7G6WMFK0]] $G$ and $R$ are [[positive definite|0KX66CZMBB]] and depend on unknown variance parameters.\n\nHere $N_k(m, S)$ is the [[multivariate normal distribution|0XN3K7RSZY]].\n\n## Remarks\n\nThe model implies $y \\sim N_n(X\\beta, \\, Z G Z^T + R)$.\nWithout the term $Z u$ it is a [[general linear model|A06SGFCSCE]] with one response.\n\nExample: the random intercept model.\nFor groups $i = 1, \\dots, a$ and members $j = 1, \\dots, m$, let $y_{ij} = \\beta_0 + b_i + \\varepsilon_{ij}$ with independent $b_i \\sim N(0, \\tau^2)$ and $\\varepsilon_{ij} \\sim N(0, \\sigma^2)$.\nThis fits the definition with $p = 1$, $X$ the column of ones, $q = a$, $Z$ the matrix of group indicators, $G = \\tau^2 I_a$ and $R = \\sigma^2 I_{am}$.\nTwo members of the same group have covariance $\\tau^2$ and correlation $\\tau^2 / (\\tau^2 + \\sigma^2)$, the intraclass correlation.\n\nNon-example: if the group shifts $b_i$ are treated as unknown constants rather than random variables, clause 2 fails.\nThe model is then a fixed effects model, a general linear model with the group indicators among the columns of $X$.\n\nGiven the variance parameters, $\\beta$ is estimated by generalized least squares and $u$ is predicted by its best linear unbiased predictor.\nThe variance parameters are usually estimated by restricted maximum likelihood.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "JNTTAHTPDD",
    "kind": "definition",
    "msc": [
      "62J05"
    ],
    "name": "Mixed model",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Mixed_model"
      }
    ],
    "tag": "EV7HZCHQ5V",
    "uses": [
      "A06SGFCSCE",
      "0XN3K7RSZY",
      "0V7G6WMFK0",
      "0KX66CZMBB"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/EV7HZCHQ5V/",
  "links": [
    {
      "field": "defines",
      "target": "JNTTAHTPDD"
    },
    {
      "field": "uses",
      "target": "A06SGFCSCE"
    },
    {
      "field": "uses",
      "target": "0XN3K7RSZY"
    },
    {
      "field": "uses",
      "target": "0V7G6WMFK0"
    },
    {
      "field": "uses",
      "target": "0KX66CZMBB"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/EV7HZCHQ5V.md",
  "msc": [
    "62J05"
  ],
  "name": "Mixed model",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/EV7/EV7HZCHQ5V.md",
  "status": null,
  "tag": "EV7HZCHQ5V",
  "uri": "m2://EV7HZCHQ5V",
  "url": "https://tamnd.github.io/math2/wiki/mixed-model-definition/",
  "writing": {
    "tag": "EV7HZCHQ5V",
    "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
      }
    ]
  }
}
