Does Z-score calculate Anomalies ??
2 views (last 30 days)
Show older comments
Hello,
I am using Precipitation data where i need to calculate Anomalies in Data, i am using Z-score for that purpose. i change the data as
data1=reshape(data,[],22);
then i used
data2=zscore(data1,[],2);
and finally i changed the data again as
data3=reshape(data2,100,150,22);
my output file only contain very strange values, the answer supposed to be changing both spatially and temporally.
Regards and Thanks in advance
0 Comments
Accepted Answer
John D'Errico
on 30 May 2017
Edited: John D'Errico
on 30 May 2017
Does zscore calculate anomalies? Um, what do you mean by that? I know what the words mean, but without seeing your data, how can we know what you think is strange? zscore does exactly what it is designed to do.
I might point out that you first say your array is called Data, but then you show what you did to an array named data. There is a difference. Or maybe you are just a sloppy typist in your question. Or possibly you have written files of your own called zscore or reshape, that do something strange. Hard to know without seeing the data.
It is quite easy to save that array (data, or is it Data) into a .mat file. Then attach it to your question, using the paper clip button. Even better, save both data and data3 into a .mat file. Then we know exactly what you saw, and can determine if you did something strange.
Perhaps I can make a guess though. If you have very wild outliers in your data, then you will see something like this:
zscore([randn(1,5),1e6])
ans =
-0.40825 -0.40825 -0.40825 -0.40825 -0.40825 2.0412
Note that the first 5 numbers are entirely random. Yet no matter what they were originally, after zscore is used, the corresponding values will appear as if they are constant.
This happened because the outlier was so far out that zscore essentially had a numerical overflow. If I make the outlier not so strange, then things appear a bit more natural.
zscore([randn(1,5),100])
ans =
-0.44257 -0.37207 -0.39324 -0.40046 -0.43221 2.0406
But this is only a wild guess as to what you did. If you want a better answer, then you need to attach your data to your question, or to a comment on my answer.
More Answers (0)
See Also
Categories
Find more on 假设检验 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!