Defining boundaries of a curve
7 ビュー (過去 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.
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]