DataInterpolations.jl
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.
Installation
To install DataInterpolations.jl, use the Julia package manager:
using Pkg
Pkg.add("DataInterpolations")
Available Interpolations
In all cases, u
an AbstractVector
of values and t
is an AbstractVector
of timepoints corresponding to (u,t)
pairs.
ConstantInterpolation(u,t)
- A piecewise constant interpolation.LinearInterpolation(u,t)
- A linear interpolation.QuadraticInterpolation(u,t)
- A quadratic interpolation.LagrangeInterpolation(u,t,n)
- A Lagrange interpolation of ordern
.QuadraticSpline(u,t)
- A quadratic spline interpolation.CubicSpline(u,t)
- A cubic spline interpolation.AkimaInterpolation(u, t)
- Akima spline interpolation provides a smoothing effect and is computationally efficient.BSplineInterpolation(u,t,d,pVec,knotVec)
- An interpolation B-spline. This is a B-spline which hits each of the data points. The argument choices are:d
- degree of B-splinepVec
- Symbol to Parameters Vector,pVec = :Uniform
for uniform spaced parameters andpVec = :ArcLen
for parameters generated by chord length method.knotVec
- Symbol to Knot Vector,knotVec = :Uniform
for uniform knot vector,knotVec = :Average
for average spaced knot vector.
BSplineApprox(u,t,d,h,pVec,knotVec)
- A regression B-spline which smooths the fitting curve. The argument choices are the same as theBSplineInterpolation
, with the additional parameterh<length(t)
which is the number of control points to use, with smallerh
indicating more smoothing.
Extension Methods
The follow methods require extra dependencies and will be loaded as package extensions.
Curvefit(u,t,m,p,alg)
- An interpolation which is done by fitting a user-given functional formm(t,p)
wherep
is the vector of parameters. The user's inputp
is a an initial value for a least-square fitting,alg
is the algorithm choice to use for optimize the cost function (sum of squared deviations) viaOptim.jl
and optimalp
s are used in the interpolation. Requiresusing Optim
.RegularizationSmooth(u,t,d;λ,alg)
- A regularization algorithm (ridge regression) which is done by minimizing an objective function (l2 loss + derivatives of orderd
) integrated in the time span. It is a global method and creates a smooth curve. Requiresusing RegularizationTools
.
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:
:linear_interp
:quadratic_interp
:lagrange_interp
:quadratic_spline
:cubic_spline
By and large, these accept the same keywords as their function counterparts.
Contributing
Please refer to the SciML ColPrac: Contributor's Guide on Collaborative Practices for Community Packages for guidance on PRs, issues, and other matters relating to contributing to SciML.
See the SciML Style Guide for common coding practices and other style decisions.
There are a few community forums:
- The #diffeq-bridged and #sciml-bridged channels in the Julia Slack
- The #diffeq-bridged and #sciml-bridged channels in the Julia Zulip
- On the Julia Discourse forums
- See also SciML Community page
Reproducibility
The documentation of this SciML package was built using these direct dependencies,
Status `~/work/DataInterpolations.jl/DataInterpolations.jl/docs/Project.toml`
[82cc6244] DataInterpolations v4.4.0 `~/work/DataInterpolations.jl/DataInterpolations.jl`
- [e30172f5] Documenter v1.1.1
+ [e30172f5] Documenter v1.1.2
[429524aa] Optim v1.7.8
[91a5bcdd] Plots v1.39.0
[29dad682] RegularizationTools v0.6.0
@@ -12,15 +12,15 @@
Official https://julialang.org/ release
Platform Info:
OS: Linux (x86_64-linux-gnu)
- CPU: 2 × Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
+ CPU: 4 × AMD EPYC 7763 64-Core Processor
WORD_SIZE: 64
LIBM: libopenlibm
- LLVM: libLLVM-14.0.6 (ORCJIT, skylake-avx512)
- Threads: 1 on 2 virtual cores
A more complete overview of all dependencies and their versions is also provided.
Status `~/work/DataInterpolations.jl/DataInterpolations.jl/docs/Manifest.toml`
+ LLVM: libLLVM-14.0.6 (ORCJIT, znver3)
+ Threads: 1 on 4 virtual cores
A more complete overview of all dependencies and their versions is also provided.
Status `~/work/DataInterpolations.jl/DataInterpolations.jl/docs/Manifest.toml`
[a4c015fc] ANSIColoredPrinters v0.0.1
[1520ce14] AbstractTrees v0.4.4
- [79e6a3ab] Adapt v3.6.2
- [4fba245c] ArrayInterface v7.4.11
+ [79e6a3ab] Adapt v3.7.1
+ [4fba245c] ArrayInterface v7.5.1
[d1d4a3ce] BitFlags v0.1.7
[49dc2e85] Calculus v0.5.1
[944b1d66] CodecZlib v0.7.3
@@ -30,7 +30,7 @@
[5ae59095] Colors v0.12.10
[bbf7d656] CommonSubexpressions v0.3.0
[34da2185] Compat v4.10.0
- [f0e56b4a] ConcurrentUtilities v2.2.1
+ [f0e56b4a] ConcurrentUtilities v2.3.0
[187b0558] ConstructionBase v1.5.4
[d38c429a] Contour v0.6.2
[a8cc5b0e] Crayons v4.1.1
@@ -42,7 +42,7 @@
[163ba53b] DiffResults v1.1.0
[b552c78f] DiffRules v1.15.1
[ffbed154] DocStringExtensions v0.9.3
- [e30172f5] Documenter v1.1.1
+ [e30172f5] Documenter v1.1.2
[460bff9d] ExceptionUnwrapping v0.1.9
[c87230d0] FFMPEG v0.4.1
[1a297f60] FillArrays v1.7.0
@@ -60,7 +60,7 @@
[1019f520] JLFzf v0.1.6
[692b3bcd] JLLWrappers v1.5.0
[682c06a0] JSON v0.21.4
- [b964fa9f] LaTeXStrings v1.3.0
+ [b964fa9f] LaTeXStrings v1.3.1
[23fbe1c1] Latexify v0.16.1
[0e77f7df] LazilyInitializedFields v1.2.1
[50d2b5c4] Lazy v0.15.1
@@ -98,7 +98,7 @@
[29dad682] RegularizationTools v0.6.0
[05181044] RelocatableFolders v1.0.1
[ae029012] Requires v1.3.0
- [6c6a2e73] Scratch v1.2.0
+ [6c6a2e73] Scratch v1.2.1
[efcf1570] Setfield v1.1.1
[992d4aef] Showoff v1.0.3
[777ac1f9] SimpleBufferStream v1.1.0
@@ -113,7 +113,7 @@
[3783bdb8] TableTraits v1.0.1
[bd369af6] Tables v1.11.1
[62fd8b95] TensorCore v0.1.1
- [3bb67fe8] TranscodingStreams v0.10.1
+ [3bb67fe8] TranscodingStreams v0.10.2
[5c2747f8] URIs v1.5.1
[3a884ed6] UnPack v1.0.2
[d9a01c3f] Underscores v3.0.0
@@ -125,7 +125,7 @@
[83423d85] Cairo_jll v1.16.1+1
[2702e6a9] EpollShim_jll v0.0.20230411+0
[2e619515] Expat_jll v2.5.0+0
-⌃ [b22a6f82] FFMPEG_jll v4.4.2+2
+ [b22a6f82] FFMPEG_jll v4.4.4+1
[a3f928ae] Fontconfig_jll v2.13.93+0
[d7e528f0] FreeType2_jll v2.13.1+0
[559328eb] FriBidi_jll v1.0.10+0
@@ -149,11 +149,11 @@
[89763e89] Libtiff_jll v4.5.1+1
[38a345b3] Libuuid_jll v2.36.0+0
[e7412a2a] Ogg_jll v1.3.5+1
-⌅ [458c3c95] OpenSSL_jll v1.1.23+0
+ [458c3c95] OpenSSL_jll v3.0.12+0
[efe28fd5] OpenSpecFun_jll v0.5.5+0
[91d4177d] Opus_jll v1.3.2+0
[30392449] Pixman_jll v0.42.2+0
- [c0090381] Qt6Base_jll v6.5.2+2
+ [c0090381] Qt6Base_jll v6.5.3+0
[a44049a8] Vulkan_Loader_jll v1.3.243+0
[a2964d1f] Wayland_jll v1.21.0+1
[2381bf8a] Wayland_protocols_jll v1.25.0+0
@@ -244,4 +244,4 @@
[8e850b90] libblastrampoline_jll v5.8.0+0
[8e850ede] nghttp2_jll v1.48.0+0
[3f19e933] p7zip_jll v17.4.0+0
-Info Packages marked with ⌃ and ⌅ have new versions available, but those with ⌅ are restricted by compatibility constraints from upgrading. To see why use `status --outdated -m`
You can also download the manifest file and the project file.