How to stabilize the edge effects in a cubic B-spline?
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Spatika Jayaram
am 4 Jan. 2025
Kommentiert: Spatika Jayaram
am 5 Jan. 2025
I have been attempting to model a dataset using a P-spline in MATLAB and despite changing the knot placings, and smoothness parameters, the spline has sudden shifts near the edges due to limited data in those regions. I am plotting metabolite values across age and early and old age groups have the least data. I tried repeated knot positioning as well and it doesn't appear to work very well. Is there any way to stabilize the edge effects better?
0 Kommentare
Akzeptierte Antwort
John D'Errico
am 4 Jan. 2025
Bearbeitet: John D'Errico
am 4 Jan. 2025
You don't show any data, so there is little we can actually do in a constructive way. But you don't have a great deal of control on the shape of a curve with the MATLAB supplied spline tools.
I would suggest you try my SLM toolbox. It gives you a huge amount of control on the shape of a curve.
Again, lacking seeing any data, I can't suggest more than that. If you want a B-spline out the end, it can create a spline in a pp-form, which can then be converted into a B-form using fnform.
3 Kommentare
John D'Errico
am 4 Jan. 2025
Not a heck of a lot of signal in that data. ;-) At least not relative to the noise component. With no information there, the curve will get dragged around due to the last few points, and there is one outlier on the right end that will drag the curve up.
But also, it looks like the curve should be increasing on the right end. Look at the data near x = 30, compared to the average of the data near x==25. It looks to me as if the curve is doing something consistent with the poor data you have.
Again, using my SLM toolbox, you can control the shape of the curve in a few ways. You might, for example, choose to place relatively few breaks. That gives the curve less flexbility. And given the very low signal to noise ratio, relatively few breaks would be a good idea.
You might decide to use weights, downweighting that singleton high point on the upper right end. I can think of a few things you might try. Better data would be the very best you could do of course.
If you are willing to post the data in a .mat file, I could show some examples.
Weitere Antworten (1)
Matt J
am 5 Jan. 2025
This FEX file allows you to specify extrapolation conditions on the B-spline coefficients,
but it only permits equi-spaced knots.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Splines finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!