SciML / DataInterpolations.jl

A library of data interpolation and smoothing functions
MIT License
203 stars 43 forks source link

DataInterpolations.jl

Join the chat at https://julialang.zulipchat.com #sciml-bridged Global Docs

codecov CI

ColPrac: Contributor's Guide on Collaborative Practices for Community Packages SciML Code Style

DataInterpolations.jl is a library for performing interpolations of one-dimensional data. By "data interpolations" we mean techniques for interpolating possibly noisy data, and thus some methods are mixtures of regressions with interpolations (i.e. do not hit the data points exactly, smoothing out the lines). This library can be used to fill in intermediate data points in applications like timeseries data.

API

All interpolation objects act as functions. Thus for example, using an interpolation looks like:

u = rand(5)
t = 0:4
interp = LinearInterpolation(u, t)
interp(3.5) # Gives the linear interpolation value at t=3.5

We can efficiently interpolate onto a vector of new t values:

t′ = 0.5:1.0:3.5
interp(t′)

In-place interpolation also works:

u′ = similar(u, length(t′))
interp(u′, t′)

Available Interpolations

In all cases, u an AbstractVector of values and t is an AbstractVector of timepoints corresponding to (u,t) pairs.

Extension Methods

The follow methods require extra dependencies and will be loaded as package extensions.

Plotting

DataInterpolations.jl is tied into the Plots.jl ecosystem, by way of RecipesBase. Any interpolation can be plotted using the plot command (or any other), since they have type recipes associated with them.

For convenience, and to allow keyword arguments to propagate properly, DataInterpolations.jl also defines several series types, corresponding to different interpolations.

The series types defined are:

By and large, these accept the same keywords as their function counterparts.