forum.alglib.net

ALGLIB forum
It is currently Mon Dec 23, 2024 5:39 am

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  [ 6 posts ] 
Author Message
 Post subject: 2d cubic spline interpolation on scattered data
PostPosted: Mon Feb 27, 2012 3:24 pm 
Offline

Joined: Sat Oct 16, 2010 1:37 pm
Posts: 7
Hello Sergey.

I have 2 questions for you.

=> I would like to implement 2d cubic interpolation on scattered data.
I have successfully tested your ALGLIB module for 2d-dimensional splines but it is working on regular grid. I have also tested the Inverse distance weighting interpolation/fitting but the results were not in line with my expectation.

I am just wondering if you are planning to implement 2d cubic interpolation on scattered data? Or if you could may be guide me on how I could implement such algorithm?

=> Also I have tested the 1d cubic interpolation with penalized regression spline fitting. And I am very impressed by the results. But I would like to implement it for 2d cubic interpolation.

I am wondering if you are planning to implement 2d cubic interpolation with penalised regression spline on regular grid (or scattered data)? Or do you have some ideas on how I could implement this algorithm?

Thank you very much for your assistance.
Kind regards,
Antoine


Top
 Profile  
 
 Post subject: Re: 2d cubic spline interpolation on scattered data
PostPosted: Wed Feb 29, 2012 5:28 am 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
Scattered 2D interpolation is a tricky question. 2D splines are good for regular distribution of points. You can build spline with regular distribution of nodes and fit it to scattered points, but ill-conditioning-related issues will arise. So it is hard to use iterative solvers, and direct solvers will work for too long.

Right now we investigate performance of various RBF models. Some preliminary results will be released with ALGLIB 3.5.0. We already have working RBF model, which is capable of solving problems as large as 100.000 points in dataset, but this model is limited to approximately uniformly distributed points. It means that model performance will deteriorate in case you have clustered points, small-scale structures like contours, or something similar.

I think that one day we will implement 2D splines too, but as for now we focus on getting fully functional RBF.

Regarding your second question... If you want to solve small scale problem (underlying spline was built on 10x10 grid, or, at most, 20x20 grid), you can try linear least squares. Build 100=10*10 basis splines (splines which are equal to 1.0 at one node, and 0.0 at another nodes), calculate their values at dataset points, build linear least squares model, add several hundreds of rows corresponding to nonlinearity penalty - and then use ALGLIB least squares solver to solve it. It will work, but will be slow, memory consuming, and won't take into account sparsity of the linear system.


Top
 Profile  
 
 Post subject: Re: 2d cubic spline interpolation on scattered data
PostPosted: Wed Feb 29, 2012 8:34 am 
Offline

Joined: Sat Oct 16, 2010 1:37 pm
Posts: 7
Thank you Sergey for you reply which are very helpfull.

I am impatient to test the Radial Basis Functions model that you planned to release with ALGLIB 3.5.0.

In the meantime I will try to implement 2d cubic interpolation with penalized regression spline fitting.

Kind regards,
Antoine


Top
 Profile  
 
 Post subject: Re: 2d cubic spline interpolation on scattered data
PostPosted: Wed Feb 29, 2012 11:32 am 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
If you want, I can send you a snapshot of the development version of the ALGLIB with new RBF's. It will be sent to e-mail you used when registering at this forum. What programming language do you need?

I am interested in your feedback because real-life use cases are always more tricky than ones we (ALGLIB Project) can come up with.


Top
 Profile  
 
 Post subject: Re: 2d cubic spline interpolation on scattered data
PostPosted: Wed Feb 29, 2012 6:40 pm 
Offline

Joined: Sat Oct 16, 2010 1:37 pm
Posts: 7
Thank you. If you don' mind I would be glad to test ALGLIB with new RBF's model. You can sent it to my registered mail.

I use C# language. I integrated your ALGLIB net library with excelDNA and I tested it through excel VBA.

I am not really a mathematical expert but I should be able to test your model. I would like to apply your model to calibrate caps and swaptions gaussian volatility. My axes are maturity, tenor, and strikes. Some points are missing on the surface and I need to interpolate quite smoothly.

I have already used your 1D cubic spline with the penalized tikonov factor to calibrate caps gaussian volatility. And I was quite happy with the results.

Many thanks again for your assistance.

Kind regards,
Antoine


Top
 Profile  
 
 Post subject: Re: 2d cubic spline interpolation on scattered data
PostPosted: Fri Jul 20, 2012 11:04 am 
Offline

Joined: Fri Jul 20, 2012 10:10 am
Posts: 1
Antoine

I hope you don't mind me asking if you managed to expose the RBF function to Excel?

I am desperately looking for an RBF function for Excel to perform smoothing/interpolation in 2D (x, y, z). I was hoping that the later versions of ALGLIB (with the RBF functions) would have been made available in VBA format, as was the case for version 2.6.0.

I have had some minimal experience of compiling Xongrid XLL (http://zible.free.fr/?page_id=1493) from source using XLW (a wrapper for C+, C# and VB.net - http://xlw.sourceforge.net/). I followed the instructions, on the XonGrid website, without really understanding what was going on, and it worked. I read about Excel DNA when I was looking at ALGLIB before but never really got close to understanding what to do.

If you have managed to do this could you supply the output so I could try it out? If not, do you have any idiot guides to compiling the ALGLIB source using Excel DNA?

Any help would be appreciated.

Regards

Scott


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 14 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group