Azzera filtri
Azzera filtri

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).

2 visualizzazioni (ultimi 30 giorni)
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.

Risposte (1)

KSSV
KSSV il 7 Gen 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 Commenti
NS
NS il 7 Gen 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 ?

Accedi per commentare.

Categorie

Scopri di più su Data Type Conversion in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by