Liking cljdoc? Tell your friends :D

fastmath.interpolation

1d, 2d interpolation functions.

See more:

Note: Smile interpolators also extrapolate values outside range.

Input data

You provide data as sequence or double array.

1d interpolation

You provide two sequences:

  • xs - x axis coorditanes, strictly monotonic (increasing)
  • ys - function values

See [[kriging-spline-interpolator]]

2d interpolation

This is grid based interpolation.

  • xs - x axis coordinates, strictly monotonic (increasing)
  • ys - y axis coordinates, strictly monotonic (increasing)
  • vs - sequence of sequences of values (2d array) for all possible pairs. Array is column-wise: [ [first column] [second column] ...].

See [[cubic-2d-interpolator]]

Examples

Examples below use following functions:

1d

1d

2d

2d

1d, 2d interpolation functions.

See more:

* [Apache Commons Math](http://commons.apache.org/proper/commons-math/javadocs/api-3.6.1/org/apache/commons/math3/analysis/interpolation/package-summary.html)
* [Smile Interpolation](http://haifengl.github.io/smile/api/java/smile/interpolation/package-summary.html
* [SSJ B-Spline](http://umontreal-simul.github.io/ssj/docs/master/classumontreal_1_1ssj_1_1functionfit_1_1BSpline.html)

Note: Smile interpolators also extrapolate values outside range.

### Input data

You provide data as sequence or double array.

#### 1d interpolation

You provide two sequences:

* `xs` - x axis coorditanes, strictly monotonic (increasing)
* `ys` - function values

See [[kriging-spline-interpolator]]

#### 2d interpolation

This is grid based interpolation.

* `xs` - x axis coordinates, strictly monotonic (increasing)
* `ys` - y axis coordinates, strictly monotonic (increasing)
* `vs` - sequence of sequences of values (2d array) for all possible pairs. Array is column-wise: `[ [first column] [second column] ...]`.

See [[cubic-2d-interpolator]]

### Examples

Examples below use following functions:

#### 1d
![1d](images/i/1d.png)

#### 2d
![2d](images/i/2d.jpg)
raw docstring

akima-splineclj

(akima-spline xs ys)

Create cubic spline interpolator using Akima algorithm. Minimum number of points: 5

xs[n] < xs[n+1] for all n.

Source: Apache Commons Math.

Create cubic spline interpolator using Akima algorithm.
  Minimum number of points: 5

  xs[n] < xs[n+1] for all n.

Source: Apache Commons Math.
sourceraw docstring

b-splineclj

(b-spline xs ys)
(b-spline degree-or-knots xs ys)

B-spline for given points, default degree equals samples count - 1.

more

B-spline for given points, default degree equals samples count - 1.

[more](http://umontreal-simul.github.io/ssj/docs/master/classumontreal_1_1ssj_1_1functionfit_1_1BSpline.html)
sourceraw docstring

b-spline-interpclj

(b-spline-interp xs ys)
(b-spline-interp degree xs ys)
(b-spline-interp degree h xs ys)

B-spline interpolation.

See:

  • 2 or 3 arity - exact interpolation using b-spline, default degree = 3 (more)
  • 4 arity - approximated b-spline interpolation with precision parameter h (more)
B-spline interpolation.

See:

* 2 or 3 arity - exact interpolation using b-spline, default degree = 3 ([more](http://umontreal-simul.github.io/ssj/docs/master/classumontreal_1_1ssj_1_1functionfit_1_1BSpline.html#a364fa9e72b7cdc0457140d79b2249530))
* 4 arity - approximated b-spline interpolation with precision parameter `h` ([more](http://umontreal-simul.github.io/ssj/docs/master/classumontreal_1_1ssj_1_1functionfit_1_1BSpline.html#a0892c41fc64e14a58e7f17208e05289a))
sourceraw docstring

bicubicclj

(bicubic xs ys vs)

Bicubic 2d.

Grid based.

Source: Apache Commons Math.

Bicubic 2d.

Grid based.

Source: Apache Commons Math.
sourceraw docstring

bicubic-smileclj

(bicubic-smile xs ys vs)

Bicubic 2d.

Grid based.

Source: Smile.

Bicubic 2d.

Grid based.

Source: Smile.
sourceraw docstring

bilinearclj

(bilinear xs ys vs)

Bilinear 2d.

Grid based.

Source: Smile.

Bilinear 2d.

Grid based.

Source: Smile.
sourceraw docstring

cubic-2dclj

(cubic-2d xs ys vs)

Cubic spline 2d.

Grid based.

Source: Smile.

Cubic spline 2d.

Grid based.

Source: Smile.
sourceraw docstring

cubic-splineclj

(cubic-spline xs ys)

Cubic spline interpolation.

Source: Smile.

Cubic spline interpolation.

Source: Smile.
sourceraw docstring

divided-differenceclj

(divided-difference xs ys)

Create Divided Difference Algorithm for interpolation.

Source: Apache Commons Math.

Create Divided Difference Algorithm for interpolation.

Source: Apache Commons Math.
sourceraw docstring

interpolators-1d-listclj

Map of 1d interpolation functions

Map of 1d interpolation functions
sourceraw docstring

interpolators-2d-listclj

Map of 2d interpolation functions

Map of 2d interpolation functions
sourceraw docstring

kriging-splineclj

(kriging-spline xs ys)

Kriging interpolation.

Source: Smile.

Kriging interpolation.

Source: Smile.
sourceraw docstring

linearclj

(linear xs ys)

Create Divided Difference Algorithm for inqterpolation.

Source: Apache Commons Math.

Create Divided Difference Algorithm for inqterpolation.

Source: Apache Commons Math.
sourceraw docstring

linear-smileclj

(linear-smile xs ys)

Linear interpolation from Smile library.

Source: Smile.

Linear interpolation from Smile library.

Source: Smile.
sourceraw docstring

loessclj

(loess xs ys)
(loess bandwidth robustness-iters xs ys)
(loess bandwidth robustness-iters accuracy xs ys)

Local Regression Algorithm

  • bandwidth: 0.2-1.0 (optimal: 0.25-0.5, default: 0.4)
  • robustness-iters: 0-4 (optimal: 0, default: 2)
  • accuracy: double (default: 1e-12)

Source: Apache Commons Math.

Local Regression Algorithm

* bandwidth: 0.2-1.0 (optimal: 0.25-0.5, default: 0.4)
* robustness-iters: 0-4 (optimal: 0, default: 2)
* accuracy: double (default: 1e-12)

Source: Apache Commons Math.
sourceraw docstring

microsphere-2d-projectionclj

(microsphere-2d-projection elements
                           max-dark-friction
                           dark-threshold
                           background
                           exponent
                           shared-sphere?
                           no-interpolation-tolerance
                           xs
                           ys
                           vs)

Microsphere projection interpolator - 2d version

Grid based.

Source: Apache Commons Math.

Microsphere projection interpolator - 2d version

Grid based.

Source: Apache Commons Math.
sourceraw docstring

microsphere-projectionclj

(microsphere-projection elements
                        max-dark-friction
                        dark-threshold
                        background
                        exponent
                        shared-sphere?
                        no-interpolation-tolerance
                        xs
                        ys)

Microsphere projection interpolator - 1d version

Source: Apache Commons Math.

Microsphere projection interpolator - 1d version

Source: Apache Commons Math.
sourceraw docstring

monotoneclj

(monotone xs ys)
Monotone interpolation

https://gist.github.com/lecho/7627739
sourceraw docstring

nevilleclj

(neville xs ys)

Neville algorithm

Source: Apache Commons Math.

Neville algorithm

Source: Apache Commons Math.
sourceraw docstring

piecewise-bicubicclj

(piecewise-bicubic xs ys vs)

Piecewise bicubic 2d.

Grid based.

Source: Apache Commons Math.

Piecewise bicubic 2d.

Grid based.

Source: Apache Commons Math.
sourceraw docstring

polynomialclj

(polynomial xs ys)

Polynomial interpolation.

more

Polynomial interpolation.

[more](http://umontreal-simul.github.io/ssj/docs/master/classumontreal_1_1ssj_1_1functionfit_1_1PolInterp.html)
sourceraw docstring

rbfclj

(rbf xs ys)
(rbf rbf-fn xs ys)
(rbf rbf-fn normalize? xs ys)

RBF (Radial Basis Function) interpolation.

Default kernel: :gaussian

Source: Smile

RBF (Radial Basis Function) interpolation.

Default kernel: `:gaussian`

Source: Smile
sourceraw docstring

shepardclj

(shepard xs ys)
(shepard p xs ys)

Shepard interpolation.

Source: Smile.

Shepard interpolation.

Source: Smile.
sourceraw docstring

splineclj

(spline xs ys)

Cubic spline interpolation

Source: Apache Commons Math.

Cubic spline interpolation

Source: Apache Commons Math.
sourceraw docstring

stepclj

(step xs ys)

Step function.

Step function.
sourceraw docstring

step-afterclj

(step-after xs ys)

Step function.

Step function.
sourceraw docstring

step-beforeclj

(step-before xs ys)

Step function.

Step function.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close