필터 지우기
필터 지우기

Std in matlab different from stdevp in excel

조회 수: 15 (최근 30일)
Maggie
Maggie 2011년 11월 15일
댓글: DGM 2022년 7월 25일
I have an array of prices i calculated the standard deviation and the mean in matlab but the results are very different from what i calculated using excel. any reason why this is the case?
  댓글 수: 1
DGM
DGM 2022년 7월 25일
@Mehri Mehrnia's comment-as-answer moved here:
Hi,
Today while submitting a last minute paper, I found out that discrepancy.

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

채택된 답변

Thomas
Thomas 2011년 11월 15일
I get the same answer for stddev and mean from MATLAB and Excel
a = [ 1 1 1 1 1 3 2 4 5 6 2 6 2 6 1]
>> std(a)
ans =
2.04
>> mean(a)
ans =
2.80
From Excel the results are
stdev(a1:a15) = 2.042407543 and mean 2.8
do not know why you are facing a discrepancy. Are you certain that you are using the same identical data sets.
  댓글 수: 1
Allen
Allen 2018년 5월 1일
I have run into the same issue with standard deviation results between MATLAB and Excel. The reason is due to using STDEV.P (standard deviation of a population) instead of STDEV.S (standard deviation of a sample). Excel does not do a very good job of explaining the differences in the Tooltips, but it simplifies down to this. Unless you are certain of the need to use STDEV.P in Excel use STDEV.S or STDEV.

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

추가 답변 (1개)

Daniel Shub
Daniel Shub 2011년 11월 15일
There are two ways to calculate the standard deviation. In Excel these are stdev and stdevp. In MATLAB they are std(x) and std(x, 1). The difference is the normalization factor (N or N-1). Look in the documentation of each to figure out which does which.

카테고리

Help CenterFile Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by