To reproduce fits which have been done in the framework of a standard, I was reviewing the Interpolation engine of Mathematica (for InterpolationOrder -> 3) to get more information about the mechanics Mathematica is using for Interpolation.

Currently there is limited control especially for the "Hermite" Interpolation method to control the way the Splines are fitted. My interpretation is that with the "Hermite" setting the default parameter boundaries are resulting in natural Splines, whereas the PeriodicInterpolation->True setting enforces periodic boundary conditions. However there are many more methods to Spline Interpolation of 3rd order like Not-a-Knot spline or Quadratic Spline boundary conditions (see Link) Taking a simple interpolation example in Mathematica as:

data = {{0, 21}, {1, 24}, {2, 24}, {3, 18}, {4, 16}};
intf1=Interpolation[data, Method -> "Spline"];
intf2=Interpolation[data, Method -> "Hermite"];

I was wondering how the underlying interpolation expressions generated by the Interpolation routine could be accessed.

InputForm[intf1[[4, 1]]]

 BSplineFunction[1, {{0., 4.}}, {3}, {False}, {{21., 22.61111111111111, 30.166666666666664,  13.055555555555554, 16.}, {}}, {{0., 0., 0., 0., 2., 4., 4., 4., 4.}}, {0}, MachinePrecision, "Unevaluated"]

yields at least a BSpline function description, but intf2 hides it's Hermite Spline implementation from the user


 InterpolatingFunction[{{0, 4}}, {5, 3, 0, {5}, {4}, 0, 0, 0, 0, Automatic, {}, {}, False}, {{0, 1, 2, 3, 4}}, {{21}, {24}, {24}, {18}, {16}}, {Automatic}]

Does anyone know how to get more information about the parameters resulting from Hermite Spline interpolation of order 3 in Mathematica?

(*{"Coordinates", "DerivativeOrder", "Domain", "ElementMesh", \
"Evaluate", "GetPolynomial", "Grid", "InterpolationMethod", \
"InterpolationOrder", "MethodInformation", "Methods", \
"OutputDimensions", "Periodicity", "PlottableQ", "Properties", \
"QuantityUnits", "Unpack", "ValuesOnGrid"}*)

gives you information concerning the interpolation object


With the hint from Ulrich Neumann, I found this post, which provides a nice encapsulated function "convertToPiecewise" in the post by "J. M.'s discontentment" (I like the name!), which is providing exactly what I'm looking for.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.