Curve fitting and scatter plots
이전 댓글 표시
Hi all,
This may not be possible but is there a function or a way you can fit a curve to a select number of points within a scatterplot? Looking specifically to fit a curve around the 'lower boundary' of a scatterplot. For example say I had a scatterplot of hundreds of points that made up a circle. Is there a way to fit a curve around the bottom perimeter?
If you need any more info please ask.
Best
댓글 수: 1
dpb
2013년 9월 22일
How do you define what is the "bottom perimeter", specifically?
One (probably crude) choice would be to pick all values in the data set whose y-values<=mean(y)
채택된 답변
추가 답변 (2개)
Image Analyst
2013년 9월 22일
0 개 추천
If you know the indexes of those points, then, sure. Just put the arrays with those indexes into polyfit() or whatever you're using.
SCADA Miner
2013년 11월 13일
0 개 추천
Hi Craig, Did you ever figure out how to do this? I want to do the same thing. I have a bunch of measurements which form a scatter plot, I want to fit a curve which is the lower bound for say 95% of those points. I can think of a really inefficient way to do it but surely something already exists? Cheers Tom
댓글 수: 3
Image Analyst
2013년 11월 13일
Why can't you also just use polyfit()? Then calculate your residuals by subtracting the fit from the data and sorting and taking the lowest 5%. I mean, that's the simple, intuitive way that I'd use. Would that work for you?
Craig
2013년 11월 22일
dpb
2013년 11월 22일
The polynomial is only of the order you select.
Fit the data; if there's any way to know a priori to subset it at least some beforehand that would be a_good_thing (tm) but not mandatory. Then evaluate the result over the same fitted range, compute the residuals and as IA says, find the smallest group. You could then selectively refit those to improve the fit w/o the others polluting the estimates.
See
doc polyfit % and friends for more details
카테고리
도움말 센터 및 File Exchange에서 Lengths and Angles에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!