forum.alglib.net
http://forum.alglib.net/

How can I do scatered data interpolation using alglib
http://forum.alglib.net/viewtopic.php?f=2&t=137
Page 1 of 1

Author:  arunbaruah [ Tue Dec 07, 2010 5:23 am ]
Post subject:  How can I do scatered data interpolation using alglib

Hi,
I am new to alglib. I want to do cubic interpolation on scattered data. Please guide me how to do 1 Dimensional, 2 dimensional and 3 dimensional cubic spline interpolation using alglib.
Thank you,
Regards,
Arun

Author:  Sergey.Bochkanov [ Tue Dec 07, 2010 8:09 am ]
Post subject:  Re: How can I do scatered data interpolation using alglib

You can use spline1d subpackage for 1-dimensional spline interpolation. As for 2-dimensional splines, only interpolation on regular grid is supported. If you need scattered multidimensional fitting, you can try http://www.alglib.net/interpolation/inv ... ghting.php - it is hard to tune, but sometimes gives good results.

Author:  arunbaruah [ Tue Dec 14, 2010 6:23 am ]
Post subject:  Re: How can I do scatered data interpolation using alglib

Thank you Sergey. I tried 1 d spline, but do not know how do I solve the 2 and 3 d. It is because I am totally new in interpolation, I understand that spline interpolation is to find an unknown value between x & y, but really do not know how to solve it in computer. Please help me in the below code:
public void spline2d_cubicExample()
{
double[] x = new double[] { 1980, 1990, 2000, 2010, 2020 };
double[] y = new double[] { 50, 100, 175, 200, 240 };
double[,] f; //what to do with this field? I am simply trying to pass it to the function below,
//but do not know the purpose
double findAtThisValue = 2012;
double interpolatedValue;

//instantiate the spline2d interpolant
alglib.spline2dinterpolant spline;

//build 2 dim cubic spline interpolant
alglib.spline2d.spline2dbuildbicubic(x, y, ref f, x.Length, y.Length, spline);
//getting compile error
}
//I am stuck here, if I know what is in the third parameter i.e., f then propably I could solve.

Please help me.
Thank you
Arun

Author:  arunbaruah [ Wed Dec 29, 2010 12:40 pm ]
Post subject:  How can I do scatered data interpolation using alglib?

Hi,
Can any one help me how to use the alglib for 2D and 3D cubic spline interpolation? I am very new in alglib as well as to methematics.
Thanks in advance
Arun

Author:  Sergey.Bochkanov [ Thu Dec 30, 2010 6:34 pm ]
Post subject:  Re: How can I do scatered data interpolation using alglib

As for 2D interpolation, you should fill f with values of function on a regular grid.

3D interpolation with cubic splines is not supported by ALGLIB.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/