espdev / csaps

Cubic spline approximation (smoothing)
https://csaps.readthedocs.io
MIT License
164 stars 27 forks source link

Question: smoothing clamped spline #34

Closed shipengfei92 closed 3 years ago

shipengfei92 commented 3 years ago

Hi! Thanks for this great package. Currently the smoothing spline is based on natural boundary, is there any possibility we can smooth a clamped spline?

espdev commented 3 years ago

Hi @shipengfei92,

De_Boor's smoothing cubic spline for p=1 converges to the "natural" spline interpolant. It seems we cannot change boundary conditions in proposed approach and used solution method.

See https://en.wikipedia.org/wiki/Smoothing_spline#De_Boor's_approach

Maybe the solution can be found in the following document: http://monoceros.physics.muni.cz/~jancely/NM/Texty/Numerika/CubicSmoothingSpline.pdf

But I haven't looked in detail yet.

shipengfei92 commented 3 years ago

Thanks @espdev , I went through this paper, and it has the same idea with De_Boor's method, it will use the natural boundary to create a symmetric parameter matrix R, which can be used to simply the optimizing function, will try to generate a similar symmetric matrix based on the clamped constraints.

espdev commented 3 years ago

Thanks @shipengfei92 ,

If you find a solution for smoothing cubic spline with clamped boundary, PR welcome!

shipengfei92 commented 3 years ago

Sure @espdev , thanks for your efforts!