forum.alglib.net

ALGLIB forum
It is currently Sun Dec 22, 2024 2:20 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: Can not make Penalized regression spline flexible enought
PostPosted: Fri Feb 04, 2011 8:57 am 
Offline

Joined: Wed Oct 06, 2010 7:02 am
Posts: 7
Hello, Sergey.

Some time ago you advised me to use penalized regression splines http://forum.alglib.net/viewtopic.php?f=2&t=73
It was not implemented at that time but now it has been .

I'm trying to buld a spline using spline1dfitpenalized() and getting "not enought flexible" spline even with very small Rho value. (m = n*3 as you advised).

Generally origin points are quite "spased" but there are "ranges" where they are close.
And there are no cases when the are making smth like a "cloud".

Is there any way to make this spline more flexible?

If it metters I'm trying to build a "2D spline". I have 2D points, make two series of points (L, X) and (L, Y) where L is polyline length from start of 2D points series. Then I build to splines using spline1dfitpenalized() routine.

Any way, thank you and sorry for horrible English in your forum.


Top
 Profile  
 
 Post subject: Re: Can not make Penalized regression spline flexible enough
PostPosted: Fri Feb 04, 2011 8:58 pm 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
You can't build 2D spline as combination of two 1D splines. That is the root of your problem. Even with very flexible spline you won't get good results - just because you can't decompose general 2D function into sum of two 1D functions.

Your problem with penalized spline is a consequence of what was said above. Points which are close at one axis (X or Y) are in fact far away from each other at the XY-plane, and you will always have problems with wild oscillations in the function.

P.S. As for English - it is OK, my English isn't perfect too.


Top
 Profile  
 
 Post subject: Re: Can not make Penalized regression spline flexible enough
PostPosted: Sat Feb 05, 2011 3:14 am 
Offline

Joined: Wed Oct 06, 2010 7:02 am
Posts: 7
I used a cubic smoothing spline from this book before exactly the same way (two slines for X and for Y coordinates of origin 2D) and got relativle good results. The problems were:
(1) spline was sensitive to "frequency" of points and local single deviations.
(2) I could not find fast way to solve system of linear equations with "pentadiagonal" matrix.

I'm not trying to cast a doubt on your message before, but could you explane a "nature" of difference in this two cases? ("wrong way" of using Smoothed cubic and Regression splines)
And could you advise smth to read about how to build smoothing 2D splines?

Thank you!


Top
 Profile  
 
 Post subject: Re: Can not make Penalized regression spline flexible enough
PostPosted: Sat Feb 05, 2011 11:07 am 
Offline

Joined: Wed Oct 06, 2010 7:02 am
Posts: 7
I'm realy sorry.
I was using small "m" value (not n*3 as I wrote). Now it works relativle fine. Thank you for greate library.

Could you advise somthing about fast solving system of linear equations with 5 non-zero diagonals (the main one and 2 above and below)?


Top
 Profile  
 
 Post subject: Re: Can not make Penalized regression spline flexible enough
PostPosted: Mon Feb 07, 2011 9:41 am 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
If you need direct algorithm, you can take a look at LAPACK. It contains functions for factorization of band matrices. Another solution is to use linear conjugate gradient, but it can be less precise than direct algo.


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 48 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