How to filter out multiple outliers from a gradually changing dataset?
    조회 수: 3 (최근 30일)
  
       이전 댓글 표시
    
I have a set of arrays which should show a gradually increasying pattern. However, there are some instances where the gradual increase is not observed. I used filloutliers command with linear but it was found that there were multiple outliers. I will demonstrate a few instances of them in the figure below: Figure 1 shows a gradual increasing data. However, in Figure 2 and 3, there are multiple points that are outliers. Figure 4 has multiple instances of outliers. And, in figure 5 and 6, there are 7 points (out of 15) that are out of the trend.
I tried findchangepts but it also works only for a single point. I would appreciate if there can be a way to transform these lines to gradually changine lines. It should be noted that all the set of data points are always 15. 
I am trying to reconstruct the rest of the data points similar to figure 1. I would appreciate if there is a possibility of achieving it.
Thanks in advance.
load("a_data.mat")
figure
tiledlayout(3,3)
for i = 1:9
    nexttile
    title(string(i))
    hold on
    adata = a(:,i);
    plot(adata,'b-')
    bdata = filloutliers(adata,"linear");
    plot(bdata,'r.:')
    box on; grid on
    hold off
end
댓글 수: 0
채택된 답변
  Chunru
      
      
 2024년 3월 13일
        Adjust the threshold:
websave("a_data.mat", "https://www.mathworks.com/matlabcentral/answers/uploaded_files/1641186/a_data.mat");
load("a_data.mat")
figure
tiledlayout(3,3)
for i = 1:9
    nexttile
    title(string(i))
    hold on
    adata = a(:,i);
    plot(adata,'b-')
    bdata = filloutliers(adata, "linear", "percentiles", [20 80]);
    plot(bdata,'r.:')
    box on; grid on
    hold off
end
추가 답변 (0개)
참고 항목
카테고리
				Help Center 및 File Exchange에서 Curve Fitting Toolbox에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



