package scipy

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type tag = [
  1. | `BarycentricInterpolator
]
type t = [ `BarycentricInterpolator | `Object ] Obj.t
val of_pyobject : Py.Object.t -> t
val to_pyobject : [> tag ] Obj.t -> Py.Object.t
val create : ?yi:[> `Ndarray ] Np.Obj.t -> ?axis:int -> xi:[> `Ndarray ] Np.Obj.t -> unit -> t

The interpolating polynomial for a set of points

Constructs a polynomial that passes through a given set of points. Allows evaluation of the polynomial, efficient changing of the y values to be interpolated, and updating by adding more x values. For reasons of numerical stability, this function does not compute the coefficients of the polynomial.

The values yi need to be provided before the function is evaluated, but none of the preprocessing depends on them, so rapid updates are possible.

Parameters ---------- xi : array_like 1-d array of x coordinates of the points the polynomial should pass through yi : array_like, optional The y coordinates of the points the polynomial should pass through. If None, the y values will be supplied later via the `set_y` method. axis : int, optional Axis in the yi array corresponding to the x-coordinate values.

Notes ----- This class uses a 'barycentric interpolation' method that treats the problem as a special case of rational function interpolation. This algorithm is quite stable, numerically, but even in a world of exact computation, unless the x coordinates are chosen very carefully - Chebyshev zeros (e.g. cos(i*pi/n)) are a good choice - polynomial interpolation itself is a very ill-conditioned process due to the Runge phenomenon.

Based on Berrut and Trefethen 2004, 'Barycentric Lagrange Interpolation'.

val add_xi : ?yi:[> `Ndarray ] Np.Obj.t -> xi:[> `Ndarray ] Np.Obj.t -> [> tag ] Obj.t -> Py.Object.t

Add more x values to the set to be interpolated

The barycentric interpolation algorithm allows easy updating by adding more points for the polynomial to pass through.

Parameters ---------- xi : array_like The x coordinates of the points that the polynomial should pass through. yi : array_like, optional The y coordinates of the points the polynomial should pass through. Should have shape ``(xi.size, R)``; if R > 1 then the polynomial is vector-valued. If `yi` is not given, the y values will be supplied later. `yi` should be given if and only if the interpolator has y values specified.

val set_yi : ?axis:int -> yi:[> `Ndarray ] Np.Obj.t -> [> tag ] Obj.t -> Py.Object.t

Update the y values to be interpolated

The barycentric interpolation algorithm requires the calculation of weights, but these depend only on the xi. The yi can be changed at any time.

Parameters ---------- yi : array_like The y coordinates of the points the polynomial should pass through. If None, the y values will be supplied later. axis : int, optional Axis in the yi array corresponding to the x-coordinate values.

val to_string : t -> string

Print the object to a human-readable representation.

val show : t -> string

Print the object to a human-readable representation.

val pp : Format.formatter -> t -> unit

Pretty-print the object to a formatter.

OCaml

Innovation. Community. Security.