How can i remove outliers from a 3d array using median standard deviation?

4 ビュー (過去 30 日間)
Joseph
Joseph 2018 年 7 月 3 日
コメント済み: Joseph 2018 年 7 月 4 日
Hi everyone, I have a 3d array E(i,j,k) in which k is the number of data in the dimension i and j. how can I remove the outliers from this 3d array using MAD(median absolute deviation)?
thank you in advance
  6 件のコメント
Image Analyst
Image Analyst 2018 年 7 月 4 日
編集済み: Image Analyst 2018 年 7 月 4 日
MAD is either the mean absolute deviation, or median absolute deviation - see wikipedia. Never heard of mean standard deviation, but I guess you could compute it if you had a population size. Which do you want? MAD is a very common outlier metric so you probably want that, but which MAD?
And what do you mean by removing outliers in a 3-D array. You cannot just get rid of those elements, but you can assign them to something, like the overall global mean, or zero, or the local median, or NAN, or something. What do you want?
Joseph
Joseph 2018 年 7 月 4 日
apology, I meant median absolute deviation.

サインインしてコメントする。

採用された回答

KSSV
KSSV 2018 年 7 月 4 日
A = rand(30,36,100) ; % some random data
[nx,ny,nz] = size(A) ;
for i = 1:nx
for j = 1:ny
T = squeeze(A(i,j,:)) ;
themean = mean(T) ;
sigma = std(T) ;
idx = T>themean+3*sigma ;
T(idx) = NaN ;
idx = T<themean-3*sigma ;
T(idx) = NaN ;
A(i,j,:) = T ;
end
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by