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 visualizaciones (últimos 30 días)
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.

Respuestas (1)

KSSV
KSSV el 7 de En. de 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 comentarios
NS
NS el 7 de En. de 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 ?

Iniciar sesión para comentar.

Categorías

Más información sobre Data Type Conversion en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by