B-Spline least squares (spap2)

조회 수: 4 (최근 30일)
JC
JC 2014년 6월 10일
답변: Unai San Miguel 2016년 9월 29일
Hello,
I am trying to construct a B-spline equation to fit some data points. I am rather new to B-splines, even though I had done some work previously on simple cubic splines. What I am really struggling with is how spap2 gives me so few coefficients. For example, spap2(3,4,x,y) only gives me 6 coefficients when I expect 3*4 = 12 coefficients. How can I construct 3 piece wise cubic equations with only 6 coefficients? What form should it be?
As an aside,it would be great if someone can provide a reference to a good tutorial or reference guide on the Internet on in text for B-splines. I am currently reading de Boor's tutorial ("a practical guide to splines") and find too much emphasis on the derivation rather than practical usages, despite its appealing title.
Thanks!

답변 (1개)

Unai San Miguel
Unai San Miguel 2016년 9월 29일
Hi,
spap2 returns the B-form of the spline, and if you don't supply a knot vector it will use C2 continuity (k-2 = 4-2 in your example) in the breaks.
The coefficients you were expecting are those of the pp-form of the spline, the coefficients of the power basis of the polynomials which form the spline. But because of the continuity conditions the 12 coefficients are not independent, there are 3 * 2 constraints, which give you only 6 independent coefficients (in the B- basis).
You can do fn2fm(spap2(3, 4, x, y), 'pp') to see the (3,4)-array of coefficients you were expecting.
Regarding the information on splines, the documentation in the Splines part of Curve Fitting Toolbox is a good companion to PGS. The notes in this link are useful, but the summations start in 0, not in 1, and that is a bit confusing (for me).

카테고리

Help CenterFile Exchange에서 Spline Postprocessing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by