{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Admonition",
          "__tag": 4056,
          "kind": "versionadded",
          "base_type": "neutral",
          "children": [
            {
              "__type": "AdmonitionTitle",
              "__tag": 4055,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "versionadded 1.8.0"
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Accepts only "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "CubicSpline"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " instances for now."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The algorithm follows from differentiation the Marsden's identity [1]: each of coefficients of spline interpolation function in the B-spline basis is computed as follows:"
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": "c_j = \\sum_{m=0}^{k} \\frac{(k-m)!}{k!}\n           c_{m,i} (-1)^{k-m} D^m p_{j,k}(x_i)"
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "c_{m, i}"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " - a coefficient of CubicSpline, "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "D^m p_{j, k}(x_i)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " - an m-th defivative of a dual polynomial in "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "x_i"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "k"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " always equals 3 for now."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "First "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "n - 2"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " coefficients are computed in "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "x_i = x_j"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", e.g."
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": "c_1 = \\sum_{m=0}^{k} \\frac{(k-1)!}{k!} c_{m,1} D^m p_{j,3}(x_1)"
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Last "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "nod + 2"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " coefficients are computed in "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "x[-2]"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "nod"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " - number of derivatives at the ends."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "For example, consider "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "x = [0, 1, 2, 3, 4]"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "y = [1, 1, 1, 1, 1]"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and bc_type = "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "natural"
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The coefficients of CubicSpline in the power basis:"
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "[[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [1, 1, 1, 1, 1]]"
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The knot vector: "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "t = [0, 0, 0, 0, 1, 2, 3, 4, 4, 4, 4]"
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "In this case"
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": "c_j = \\frac{0!}{k!} c_{3, i} k! = c_{3, i} = 1,~j = 0, ..., 6"
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Raises": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Yields": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Methods": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Returns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "b",
              "annotation": "`BSpline` object",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "A new instance representing the initial polynomial in the B-spline basis."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Construct a polynomial in the B-spline basis from a piecewise polynomial in the power basis."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Receives": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warnings": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Attributes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "pp",
              "annotation": "CubicSpline",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "A piecewise polynomial in the power basis, as created by "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "CubicSpline"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "bc_type",
              "annotation": "string, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Boundary condition type as in "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "CubicSpline"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ": one of the "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "not-a-knot"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "natural"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "clamped"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", or "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "periodic"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". Necessary for construction an instance of "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "BSpline"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " class. Default is "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "not-a-knot"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "For now, accepts "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "CubicSpline"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " instances only."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Other Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    }
  },
  "_ordered_sections": [
    "Summary",
    "Extended Summary",
    "Parameters",
    "Attributes",
    "Methods",
    "Returns",
    "Yields",
    "Receives",
    "Other Parameters",
    "Raises",
    "Warns",
    "Warnings",
    "Notes"
  ],
  "item_file": "/scipy/interpolate/_bsplines.py",
  "item_line": 792,
  "item_type": "classmethod",
  "aliases": [
    "scipy.interpolate.BSpline.from_power_basis"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "signature": null,
  "references": [
    ".. [1] Tom Lyche and Knut Morken, Spline Methods, 2005, Section 3.1.2"
  ],
  "qa": "scipy.interpolate._bsplines:BSpline.from_power_basis",
  "arbitrary": [],
  "local_refs": [
    "b",
    "bc_type",
    "pp"
  ]
}