How to filter out 1sigma data

7 ビュー (過去 30 日間)
Mekala balaji
Mekala balaji 2017 年 9 月 18 日
コメント済み: Star Strider 2017 年 9 月 18 日
Hi,
I have below data:
1.02
1.06
1.10
1.06
1.02
1.05
1.12
1.50
1.01
I want to filter-out the data which is >1sigma values (if 1sigma is standard in Matlab, using that function), if there is no such standard, then 1sigma is by 1sigma mean value.
my desired output:
1.02
1.06
1.10
1.06
1.02
1.05
1.01

回答 (1 件)

Star Strider
Star Strider 2017 年 9 月 18 日
I can’t produce your desired output, since that does not match the criterion of data being less than 1 standard deviation of the mean:
v = [1.02
1.06
1.10
1.06
1.02
1.05
1.12
1.50
1.01];
vm = mean(v);
vs = std(v);
v_result = v(v < vm+vs);
The mean+std value is 1.2573, so only 1.50 fails to meet the criterion.
  3 件のコメント
Mekala balaji
Mekala balaji 2017 年 9 月 18 日
I also want the row index of outliers
Star Strider
Star Strider 2017 年 9 月 18 日
If you set 1 sigma (standard deviation) as the criterion, then none are acceptable, since the standard deviation is 0.1528. All the values are above that.
The row index of the outliers is easy:
outlier_idx = find(v >= vm+vs);

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

カテゴリ

Help Center および File ExchangeStatistics and Machine Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by