views:

167

answers:

2

I have some matlab code which requires time series data that is uniformly distributed in time to produce an answer. The driver matlab code which reads the data file also runs an interp1( x, y, xi, 'cubic') on the data after it reads the file because the data is not uniformly distributed in time.

Now I have to port this process to Java to add to some production process. The matlab version isn't anemiable to large numbers of data files and can't be used in production.

My actual question is where can I find a Java library that already implements the interp1 'cubic' method to use when the data is read into the process?

According to the MATLAB docs, 'cubic' is the same as piecewise cubic hermite interpolating polynomial (pchip) interpolation. 'spline' produces unacceptable results. I have already looked at Apache commons-math and JAMA.

A: 

Have you checked Java LAPACK? http://www.netlib.org/java/f2j/

jorgeu
It appears to just be the FORTRAN LAPACK code run through their f2j compiler. Is there a PCHIP interpolator in LAPACK?
Jay R.
+1  A: 

DREJ.

http://www.gregdennis.com/drej/

Nonlinear least squares via regression on data sets. You can specify the lamda value ( goodness of fit) and get a cheaper fit to the data.

It will interpolate and extrapolate, but don't extrapolate too far;

If you want some specific extrapolated far-field behavior add another point out there somewhere!

It uses kernel regression so you can get different kinds of fits pretty easily. Kardi Teknomo has a good page on kernel regression.

It works.

Tim Williscroft
Could you add some details about the kind of curve fitting it can do? Can it extrapolate and interpolate or just one them? Does it do linear, quadratic, cubic, hermite?
Jay R.