Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Java, does an implementation exist for interpolating non-uniformly distributed time series data?

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.

like image 879
Jay R. Avatar asked Sep 29 '10 17:09

Jay R.


1 Answers

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.

like image 186
Tim Williscroft Avatar answered Oct 19 '22 11:10

Tim Williscroft