How to stabilize the edge effects in a cubic B-spline?
3 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
John D'Errico
2025 年 1 月 4 日
編集済み: John D'Errico
2025 年 1 月 4 日
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 件のコメント
John D'Errico
2025 年 1 月 4 日
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.
その他の回答 (1 件)
Matt J
2025 年 1 月 5 日
This FEX file allows you to specify extrapolation conditions on the B-spline coefficients,
but it only permits equi-spaced knots.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Splines についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!