{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Statement\n\nLet $x_0 \u003c x_1$, let $y_0, y_1 \\in \\R$ with $y_0 \\ne y_1$, and let $m_0, m_1 \\in \\R$.\nLet $p$ be the [[cubic Hermite interpolant|HCQWPAHYAT]] on $[x_0, x_1]$ with $p(x_i) = y_i$ and $p'(x_i) = m_i$ for $i = 0, 1$.\nLet $\\Delta = (y_1 - y_0)/(x_1 - x_0)$, $\\alpha = m_0/\\Delta$ and $\\beta = m_1/\\Delta$.\n\n1. If $p$ is [[monotone|0A7KV2WB7A]] on $[x_0, x_1]$, then $\\alpha \\ge 0$ and $\\beta \\ge 0$.\n2. If $0 \\le \\alpha \\le 3$ and $0 \\le \\beta \\le 3$, then $p$ is monotone on $[x_0, x_1]$.\n\nIn particular, let $x_0 \u003c \\cdots \u003c x_n$ and $y_0 \\le \\cdots \\le y_n$, with slopes $m_0, \\dots, m_n$.\nOn each interval $[x_k, x_{k+1}]$ assume that either $y_k = y_{k+1}$ and $m_k = m_{k+1} = 0$, or the ratios $\\alpha_k, \\beta_k$ lie in $[0, 3]$.\nThen the piecewise cubic Hermite interpolant is non-decreasing on $[x_0, x_n]$.\n\n## Remarks\n\nWith $h = x_1 - x_0$ and $t = (x - x_0)/h$, the derivative is\n$$\\frac{p'(x)}{\\Delta} = \\alpha (1 - t)(1 - 3t) + \\beta \\, t (3t - 2) + 6 t (1 - t).$$\nAt $t = 0$ and $t = 1$ this gives $\\alpha$ and $\\beta$, which proves part 1.\nFor fixed $t$, the right side is affine in $(\\alpha, \\beta)$, so its minimum over the square $[0, 3]^2$ is at a corner.\nAt the four corners it equals $6t(1 - t)$, $3(1 - t)^2$, $3t^2$ and $3(1 - 2t)^2$, all non-negative, which proves part 2.\n\nThe Fritsch–Carlson method (1980) uses this to make a monotone $C^1$ interpolant.\nIt starts from some slope estimates and sets $m_k = m_{k+1} = 0$ on flat intervals.\nWhere $\\alpha_k^2 + \\beta_k^2 \u003e 9$, it multiplies both slopes by $3/\\sqrt{\\alpha_k^2 + \\beta_k^2}$, which moves $(\\alpha_k, \\beta_k)$ into the disc of radius $3$, a subset of the square.\nWithout such a limiter, a cubic spline through monotone data can overshoot: for data $0, 0, 1, 1$ at $x = 0, 1, 2, 3$, the natural cubic spline dips below $0$ on $(0, 1)$.\nExample: for $y = 0, 1$ on $[0, 1]$ with $m_0 = m_1 = 3$, one has $\\alpha = \\beta = 3$ and $p(x) = 3x - 6x^2 + 4x^3$.\nThen $p'(x) = 3(1 - 2x)^2 \\ge 0$, so $p$ is monotone, with a flat point at $x = 1/2$.\n\n## Explanations\n\n### L1 human\n\nSmooth curves through increasing data points can still wiggle down between points, which is bad for data such as cumulative totals or concentrations.\nThis theorem says how steep the curve may be at the data points without causing such wiggles.\nIf the slopes at both ends of an interval are between $0$ and $3$ times the slope of the straight line between the points, the curve stays monotone.\n\n### L2 human\n\nThe condition is sufficient, and the exact region of monotone $(\\alpha, \\beta)$ found by Fritsch and Carlson is larger than the square.\nMonotone interpolation trades some smoothness for shape preservation: the result is $C^1$ but in general not $C^2$, unlike a cubic spline.\nIt is the basis of the PCHIP routine in many numerical libraries and of shape-preserving interpolation more generally.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "about": [
      "HCQWPAHYAT"
    ],
    "kind": "statement",
    "msc": [
      "65D05",
      "65D07",
      "41A05"
    ],
    "name": "Monotone cubic interpolation",
    "role": "theorem",
    "same_as": {
      "wikidata": "Q4044484",
      "wikipedia": "Monotone cubic interpolation"
    },
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Monotone_cubic_interpolation"
      }
    ],
    "tag": "T53N88Y21J",
    "uses": [
      "HCQWPAHYAT",
      "0A7KV2WB7A",
      "SS1YMS2NPC"
    ]
  },
  "kind": "statement",
  "link": "https://tamnd.github.io/math2/node/T53N88Y21J/",
  "links": [
    {
      "field": "about",
      "target": "HCQWPAHYAT"
    },
    {
      "field": "uses",
      "target": "HCQWPAHYAT"
    },
    {
      "field": "uses",
      "target": "0A7KV2WB7A"
    },
    {
      "field": "uses",
      "target": "SS1YMS2NPC"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/T53N88Y21J.md",
  "msc": [
    "65D05",
    "65D07",
    "41A05"
  ],
  "name": "Monotone cubic interpolation",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/T53/T53N88Y21J.md",
  "status": null,
  "tag": "T53N88Y21J",
  "uri": "m2://T53N88Y21J",
  "url": "https://tamnd.github.io/math2/wiki/monotone-cubic-interpolation/",
  "writing": {
    "tag": "T53N88Y21J",
    "kind": "statement",
    "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
      }
    ]
  }
}
