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

Can not make Penalized regression spline flexible enought
http://forum.alglib.net/viewtopic.php?f=2&t=292
Page 1 of 1

Author:  mamitko [ Fri Feb 04, 2011 8:57 am ]
Post subject:  Can not make Penalized regression spline flexible enought

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.

Author:  Sergey.Bochkanov [ Fri Feb 04, 2011 8:58 pm ]
Post subject:  Re: Can not make Penalized regression spline flexible enough

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.

Author:  mamitko [ Sat Feb 05, 2011 3:14 am ]
Post subject:  Re: Can not make Penalized regression spline flexible enough

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!

Author:  mamitko [ Sat Feb 05, 2011 11:07 am ]
Post subject:  Re: Can not make Penalized regression spline flexible enough

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)?

Author:  Sergey.Bochkanov [ Mon Feb 07, 2011 9:41 am ]
Post subject:  Re: Can not make Penalized regression spline flexible enough

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.

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