{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $d \\ge 1$ and $m \\ge 0$, and let $\\Pi_m$ be the space of [[polynomials in $d$ variables|07GNX8GCYP]] of total degree at most $m$.\nLet $x_1, \\dots, x_N \\in \\R^d$ be pairwise distinct, let $f_1, \\dots, f_N \\in \\R$, and let $\\theta \\colon [0, \\infty) \\to [0, \\infty)$ be a weight function.\nFor $x \\in \\R^d$, let $p_x \\in \\Pi_m$ minimise the [[weighted least squares|H5CGZHBR58]] error\n$$\\sum_{i=1}^{N} \\theta(\\norm{x - x_i}) \\, \\bigl(p(x_i) - f_i\\bigr)^2$$\nover $p \\in \\Pi_m$, where $\\norm{\\cdot}$ is the Euclidean norm.\nThe *moving least squares approximation* of the data is the function $\\hat f(x) = p_x(x)$, defined at every $x$ where this minimiser is unique.\n\n## Remarks\n\nThe minimiser is unique when the points $x_i$ with $\\theta(\\norm{x - x_i}) \u003e 0$ include a [[unisolvent set|5276MDSDQV]] for $\\Pi_m$.\nIn general $\\hat f$ only approximates the data; singular weights, such as in the example below, make it interpolate.\nIf the data come from a polynomial in $\\Pi_m$, then $\\hat f$ reproduces that polynomial.\n\nExample: $m = 0$ and $\\theta(r) = r^{-p}$ for $r \u003e 0$, with $p \u003e 0$, at a point $x$ that is not a data point.\nThen $p_x$ is the constant $\\sum_i \\theta_i f_i / \\sum_i \\theta_i$, where $\\theta_i = \\theta(\\norm{x - x_i})$.\nExtended by the data values at the data points, this is [[inverse distance weighting|QHN67MSH8S]].\n\nNon-example: with constant weights $\\theta = 1$ the fit is an ordinary least squares fit.\nIt gives the same polynomial $p_x = p$ at every $x$, so the result is one global polynomial.\nThe dependence of the weights on $x$, the \"moving\" feature, is lost.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "T0JZN6WP5X",
    "kind": "definition",
    "msc": [
      "65D10",
      "41A63",
      "65D05"
    ],
    "name": "Moving least squares",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Moving_least_squares"
      }
    ],
    "tag": "9HWTPQHHZK",
    "uses": [
      "H5CGZHBR58",
      "07GNX8GCYP",
      "0NPPGHQNXQ"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/9HWTPQHHZK/",
  "links": [
    {
      "field": "defines",
      "target": "T0JZN6WP5X"
    },
    {
      "field": "uses",
      "target": "H5CGZHBR58"
    },
    {
      "field": "uses",
      "target": "07GNX8GCYP"
    },
    {
      "field": "uses",
      "target": "0NPPGHQNXQ"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/9HWTPQHHZK.md",
  "msc": [
    "65D10",
    "41A63",
    "65D05"
  ],
  "name": "Moving least squares",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/9HW/9HWTPQHHZK.md",
  "status": null,
  "tag": "9HWTPQHHZK",
  "uri": "m2://9HWTPQHHZK",
  "url": "https://tamnd.github.io/math2/wiki/moving-least-squares-definition/",
  "writing": {
    "tag": "9HWTPQHHZK",
    "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
      }
    ]
  }
}
