Is it possible to specify the 'order' of a smoothing spline?

28 views (last 30 days)
Hello,
I need to use smoothing splines. The matlab command 'csaps' can only be used for the case of a cubic smoothing
spline. On the other hand, the command '[...] = spaps(x,y,tol,[],m)' might be helpful to choose the order. But, there are a
range of difficulties with this command. First, we have to specify the tolerance 'tol' (I do not like to specify anything like tolerance or
smoothing parameter and woulds like the algorithm to choose the default). Second, m can only be 1(linear case), 2(cubic case), or 3 (
the quintic case). In my work I really need to use the 'quadratic smoothin splines'.
If I would like to do 'spline interpolation', instead, I could use the command 'spapi(k,x,y)' and choose k=3 for the case of quadratic spline interpolation. Is there a similar matlab command for smoothing splines? Something like 'spaps(k,x,y)' with no extra inputs like 'tolerance' or 'smoothing parameter' or 'weight'?
If MATLAB does not have the above-mentioned capability then this is a really 'annoying problem' which could be easily prevented by
the developers of spline toolbox. You might think that cubic smoothing splines are sufficient and there really is no need for a parabolic smoothing splines. If you are interested I can give you some important mathematical problems which really need the quadratic smoothing splines.
Any idea?
Thanks in advance!
Babak
  13 Comments

Sign in to comment.

Accepted Answer

Bruno Luong
Bruno Luong on 14 Aug 2022
  6 Comments
Mohammad Shojaei Arani
Mohammad Shojaei Arani on 15 Aug 2022
Hi Torsten,
You are right. The computational difference between a linear, quadratic, cubic, quartic, quintic, etc are just nothing. I agree with you.
But, my problem has a completely different nature. In short, imagine you wish to estimate a function f which should satisfy an equation like F(f,df,d2f,d3f,d4f, ...,dnf)=0 . A smart idea is to approximate f with a spline. If I use a cubic spline then I have to deal with an equation of type F(f,df,d2f,d3f) = 0 while if I approximate f with a parabolic spline then I only need to deal with F(f,df,d2f) = 0 (well, linear spline is not very nice, so I avoid it).
Now, imagine that I also have to design a global optimization problem to estimate the parameters of f where I cannot benifit from typical optimization procedures which work based on gradient descent (the reason is long, so I skip this), so I have a non-smooth objective function and therefore am only limitted to use non-gradient based optimization algorithms like genetic algorithm which are not fast unfortunately.
Long story short, if I use parabolic splines life is much better!
but with a quantum computer life is perfect!

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!