Interpolation (cmlabs.interpolate)

The cmlabs.interpolate module provides a collection of interpolation methods and related utilities.

Lagrange/Newton interpolation

lagrange

Lagrange interpolation polynomial value at \(x\).

remainder

Remainder in interpolation formulas.

divided_differences

Return the ordered divided differences list.

newton

Newton interpolation polynomial value at \(x\).

Finite differences interpolation

finite_differences

Return the finite differences table.

forward_differences

Return the forward differences list for \(f(x_0)\).

backward_differences

Return the backward differences list for \(f(x_n)\).

newtonfd

Newton's forward interpolation formula.

newtonbd

Newton's backward interpolation formula.

gaussfd

Gauss’s forward interpolation formula.

gaussbd

Gauss’s backward interpolation formula.

stirling

Stirling's interpolation formula.

bessel

Bessel's interpolation formula.

interpolate

Interpolate the value of a function at a given point.

Splines

CubicSpline

Cubic spline data interpolator.

Tests

test_lagrange_degree

Calculate Lagrange interpolation polynomial of degree 1 at \(x^*\).

test_lagrange_remainder_1

Estimate the derivative and remainder degree 1.

test_lagrange_degree_2

Calculate Lagrange interpolation polynomial of degree 2 at \(x^*\).

test_lagrange_remainder_2

Estimate the derivative and remainder degree 2.

test_lagrange_compare_with_newton

Compare Lagrange and Newton interpolation.

test_interpolate_remainder

Estimate the remainder of interpolation.

test_cubic_spline

Cubic spline interpolation/differentiation.

test_lagrange_from_docs_example

Lagrange interpolation from docs example.

test_remainder_from_docs_example

Remainder from docs example.

test_newton_from_docs_example

Newton interpolation from docs example.

test_finite_differences_from_docs_example

Finite differences from docs example.

test_forward_differences_from_docs_example

Forward differences from docs example.

test_backward_differences_from_docs_example

Backward differences from docs example.

test_newtonfd_from_docs_example

Newton's forward interpolation formula from docs example.

test_newtonbd_from_docs_example

Newton's backward interpolation formula from docs example.

test_gaussfd_from_docs_example

Gauss’s forward interpolation formula from docs example.

test_gaussbd_from_docs_example

Gauss’s backward interpolation formula from docs example.

test_cubic_spline_from_docs_example

Cubic spline interpolation from docs example.