How to Delete entries for which the mid-quote deviated by more than 10 mean absolute deviations from a rolling centered median (excluding the observation under consideration) of 50 observations (25 observations before and 25 after).

3 Ansichten (letzte 30 Tage)
I have a cell array of midquotes split on days. I need to Delete entries for which the mid-quote deviated by more than 10 mean absolute deviations from a rolling centered median (excluding the observation under consideration) of 50 observations (25 observations before and 25 after) for EACH DAY. How to do it with R2016a.

Antworten (1)

KSSV
KSSV am 7 Jan. 2019
Let A be your data vector, which has outliers and you want to remove:
idx = abs(A - mean(T)) > 3*std(T); % get indices
A(idx) = [] ; % remove them
YOu can run a loop or use Cellfun to use the above lines of code to remove outliers in a cell.
  4 Kommentare
NS
NS am 7 Jan. 2019
I have a cell array A which is indexed to DATETIME index idx and i need to perform this function on 8th column of each cell of cell array . I ran this code and got Index exceeds matrix dimension error .
[idx1] = cellfun(@(x){abs(x - mean(x) > 3*std(x))},A(:,8),'UniformOutput',false);
Kindly help how to remove the outliers from each cell within this code ?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by