Interpolation over an array (or two)

后端 未结 8 643
闹比i
闹比i 2020-12-10 15:27

I\'m looking for a java library or some help to write my own interpolation function. That is I have two arrays of doubles which are potentially different sizes, but are ord

8条回答
  •  南笙
    南笙 (楼主)
    2020-12-10 16:12

    The other answers give you linear interpolations -- these don't really work for complex, nonlinear data. You want a spline fit, (spline interpolation) I believe.

    Spline fits describe regions of the data using a set of control points from the data, then apply a polynomial interpolation between control points. More control points gives you a more accurate fit, less a more general fit. Splines are much more accurate than linear fits, faster to use than a general regression fit, better than a high-order polynomial because it won't do crazy things between control points.

    I can't remember names off the top of my head, but there are some excellent fitting libraries in Java -- I suggest you look for one rather than writing your own function.


    **EDIT: Libraries that might be useful: **

    • JMSL
    • JSpline+
    • Curfitting library (hope you can read German)

    ** Theory/code that may be useful: **

    • Spline applets with code: link
    • Arkan spline fitting for poly-lines to bezier splines
    • Theory of splines, and some math for fitting. More math, less code, might help if the libraries don't.

提交回复
热议问题