Adding outlier to a matrix

조회 수: 4 (최근 30일)
Niki
Niki 2014년 5월 22일
댓글: Star Strider 2014년 5월 22일
Hi , I have a matrix of intensities (n*p). I want to add an outlier to it. Do you have any idea about how to simulate an outlier? I was thinking to take the mean of matrix and then multiply it to some very high value?
Do you have any idea ?

채택된 답변

Star Strider
Star Strider 2014년 5월 22일
I suggest:
M = rand(4,5); % Create data
Msts = [mean(M(:)) std(M(:))];
Outlier = Msts(1)+5*Msts(2);
Define the outlier by a multiple of the standard deviation from the mean. An value of 5*std is quite far out.
  댓글 수: 8
Niki
Niki 2014년 5월 22일
Not that one but this one helps
OutsXR = mean(X,1) + 5*std(X,[],1);
however, I accept your answer Thanks
Star Strider
Star Strider 2014년 5월 22일
My pleasure, and thanks!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Roger Wohlwend
Roger Wohlwend 2014년 5월 22일
Actually you answered your question yourself. Instead of the mean I would use the maximum value of the matrix. Multiply that number by a certain value. That's all. It is quite easy.
  댓글 수: 1
Niki
Niki 2014년 5월 22일
In fact, I want to know whether it is scientifically correct or not? It is not a number. As I explained it is a matrix of n*p so I wont have a value as outlier but a row which corresponds as an outlier
On the other hand, do you know any way to show it as a outlier ?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by