How to remove outliers before prediction

1 回表示 (過去 30 日間)
Mekala balaji
Mekala balaji 2015 年 2 月 26 日
コメント済み: Mekala balaji 2015 年 2 月 28 日
Dears, I want to predict current End value based current Start values using previous historical data as I have shown below. I am using the below mention code, but I want to remove outlier if the start (or end) value >=0.28 (or if you have some better idea like if R2 is <0.9, and to make it 0.98 or more by removing suitable outliers). Please suggest me how can I remove outlier(s).
data = [0.25 0.256
0.24 0.24
0.29 0.33
0.224 0.24
0.26 0.27
0.24 0.26
0.26 0.31
0.29 0.34];
clc;
clear all;
scatter(data(:, 1), data(:, 2));
polystartend = polyfit(data(:,1), data(:, 2), 1);
todaystart = 21;
todayend = polyval(polystartend, todaystart)
Many many thanks in advance,

回答 (1 件)

the cyclist
the cyclist 2015 年 2 月 26 日
編集済み: the cyclist 2015 年 2 月 26 日
Here is a technical way to remove the outliers based on your suggestion:
removeIdx = any(data >= 0.28,2);
data(removeIdx,:) = [];
The identification of outliers is a rich and complex subject. Iglewicz and Hoaglin have written a 90-page book on the subject.
  8 件のコメント
Image Analyst
Image Analyst 2015 年 2 月 28 日
Maybe...
R = corrcoef(data(:,1), data(:,2))
R2 = R(1,2)^2
Mekala balaji
Mekala balaji 2015 年 2 月 28 日
Thank you sir,

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

カテゴリ

Help Center および File ExchangeFit Postprocessing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by