Removing outliers for a matrix

7 visualizaciones (últimos 30 días)
Kwasi Boateng
Kwasi Boateng el 3 de Oct. de 2020
Comentada: Sulaymon Eshkabilov el 3 de Oct. de 2020
How can I remove outliers of a large matrix where an outlier is defined as a point more than three standard deviations from the mean of each column of the matrix.
I have this code but it works for a single vector, my data is in a matrix form
threshold = 3 * std( BQ);
validRange = mean(BQ) + [-1 1] * threshold;
dataWithoutOutliers = BQ(( data >= validRange(1) & data <= validRange(2) );

Respuestas (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov el 3 de Oct. de 2020
Use logical indexing.
  3 comentarios
Kwasi Boateng
Kwasi Boateng el 3 de Oct. de 2020
Editada: Kwasi Boateng el 3 de Oct. de 2020
I have this code but it works for a single vector, my data is in a matrix form
threshold = 3 * std( BQ);
validRange = mean(BQ) + [-1 1] * threshold;
dataWithoutOutliers = BQ(( data >= validRange(1) & data <= validRange(2) );
Sulaymon Eshkabilov
Sulaymon Eshkabilov el 3 de Oct. de 2020
In this case, you had better employ MATLAB's builtin function to remove outliers. See this help doc:

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by