forum.alglib.net

ALGLIB forum
It is currently Sat Apr 27, 2024 11:17 pm

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: How can I do scatered data interpolation using alglib
PostPosted: Tue Dec 07, 2010 5:23 am 
Offline

Joined: Sun Dec 05, 2010 6:01 pm
Posts: 3
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


Top
 Profile  
 
 Post subject: Re: How can I do scatered data interpolation using alglib
PostPosted: Tue Dec 07, 2010 8:09 am 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 906
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.


Top
 Profile  
 
 Post subject: Re: How can I do scatered data interpolation using alglib
PostPosted: Tue Dec 14, 2010 6:23 am 
Offline

Joined: Sun Dec 05, 2010 6:01 pm
Posts: 3
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


Top
 Profile  
 
 Post subject: How can I do scatered data interpolation using alglib?
PostPosted: Wed Dec 29, 2010 12:40 pm 
Offline

Joined: Sun Dec 05, 2010 6:01 pm
Posts: 3
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


Top
 Profile  
 
 Post subject: Re: How can I do scatered data interpolation using alglib
PostPosted: Thu Dec 30, 2010 6:34 pm 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 906
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 318 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group