Defining boundaries of a curve
3 次查看(过去 30 天)
显示 更早的评论
Context: I have attached some example histograms I've extracted from my data. As a simple/quick form of data clustering, I would like to find the boundaries of the curves present in the histograms (I've changed the raw counts to percentages).
Problem: None of the methods I have used thus far (gradient, findchangepts) have given me precise or robust solutions. This not being my area of expertise, I'm not really sure how to refine my questions beyond the following:
Question: How can I set up an algorithm which will approximately ID the following indecis as pairs for the given data sets
Dat1: [3, 18], [21, (24 or 25)], [25, 31], [33, 37]
Dat2: [6, 17], [52, 54]
Dat3: [(4 or 5, even 6 would be acceptable in a pinch), 15].
I will emphasise that these are the examples I've pulled out of my data thus far. Ideally, the algorithm I want to create will be able to operate over an arbitrary number of curves with 0 a priori knowledge. It is entirely possible, though unlikely, that a data set might have no curves/clusters, or very weakly-defined/low-prominence ones.
1 个评论
Stephen23
2023-9-12
S = load('HistogramData.mat')
scatter(S.Dat1(:,1),S.Dat1(:,2))
scatter(S.Dat2(:,1),S.Dat2(:,2))
scatter(S.Dat3(:,1),S.Dat3(:,2))
采纳的回答
Stephen23
2023-9-12
S = load('HistogramData.mat')
P = 8e-4; % prominence
D1 = diff([false;S.Dat1(:,2)>P;false]);
D2 = diff([false;S.Dat2(:,2)>P;false]);
D3 = diff([false;S.Dat3(:,2)>P;false]);
M1 = [find(D1>0),find(D1<0)-1]
M2 = [find(D2>0),find(D2<0)-1]
M3 = [find(D3>0),find(D3<0)-1]
4 个评论
Stephen23
2023-9-14
"I will add the "curve shape matching" term to my self-education."
You might find something useful in this toolbox:
Another option might be to try some kind of machine learning to classify those curves:
更多回答(1 个)
Image Analyst
2023-9-14
编辑:Image Analyst
2023-9-14
"what I'm trying to do is akin to density-based clustering"
You might like to learn about dbscan
help dbscan
Wikipedia description with diagram:
I've also attached a demo.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 AI for Signals 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!