{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $(X, \\delta)$ be a [[metric space|0VKD1TP7F3]], usually $\\R^d$ with the [[Euclidean distance|0NPPGHQNXQ]].\nLet $x_1, \\dots, x_N \\in X$ be pairwise distinct, let $u_1, \\dots, u_N \\in \\R$, and let $p \u003e 0$.\nFor $x \\in X$ and $i = 1, \\dots, N$ with $x \\ne x_i$, put $w_i(x) = \\delta(x, x_i)^{-p}$.\nThe *inverse distance weighting interpolant* of the data is the function $u \\colon X \\to \\R$ given as follows.\nIf $x$ is not one of the $x_i$, then\n$$u(x) = \\frac{\\sum_{i=1}^{N} w_i(x) \\, u_i}{\\sum_{i=1}^{N} w_i(x)}.$$\nAt the data points, $u(x_i) = u_i$ for $i = 1, \\dots, N$.\n\n## Remarks\n\nThe interpolant reproduces the data by definition, and it is continuous at each $x_i$, because $w_i(x) \\to \\infty$ as $x \\to x_i$ while the other weights stay bounded.\nEach value $u(x)$ is a convex combination of the $u_i$, so $\\min_i u_i \\le u(x) \\le \\max_i u_i$.\nThis scheme is also called Shepard's method.\nIt is the case of constant fits with weight $r^{-p}$ in [[moving least squares|T0JZN6WP5X]].\n\nExample: on $\\R$ with $p = 2$, data $u_1 = 10$ at $x_1 = 0$ and $u_2 = 40$ at $x_2 = 3$, at $x = 1$ the weights are $1$ and $1/4$.\nSo $u(1) = \\frac{10 + 40/4}{1 + 1/4} = 16$, which lies between $10$ and $40$.\n\nNon-example: the plain average $\\sum_i u_i / N$ with equal weights does not depend on the distances and does not reproduce the data; for the same data it gives $25 \\ne 10$ at $x_1$.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "QHN67MSH8S",
    "kind": "definition",
    "msc": [
      "65D05",
      "41A05",
      "41A63"
    ],
    "name": "Inverse distance weighting",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Inverse_distance_weighting"
      }
    ],
    "tag": "55V8WAJXXJ",
    "uses": [
      "BM703GV34G",
      "0VKD1TP7F3",
      "0NPPGHQNXQ"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/55V8WAJXXJ/",
  "links": [
    {
      "field": "defines",
      "target": "QHN67MSH8S"
    },
    {
      "field": "uses",
      "target": "BM703GV34G"
    },
    {
      "field": "uses",
      "target": "0VKD1TP7F3"
    },
    {
      "field": "uses",
      "target": "0NPPGHQNXQ"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/55V8WAJXXJ.md",
  "msc": [
    "65D05",
    "41A05",
    "41A63"
  ],
  "name": "Inverse distance weighting",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/55V/55V8WAJXXJ.md",
  "status": null,
  "tag": "55V8WAJXXJ",
  "uri": "m2://55V8WAJXXJ",
  "url": "https://tamnd.github.io/math2/wiki/inverse-distance-weighting-definition/",
  "writing": {
    "tag": "55V8WAJXXJ",
    "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
      }
    ]
  }
}
