필터 지우기
필터 지우기

Simple question about Standard Deviation.

조회 수: 21 (최근 30일)
Helen Kirby
Helen Kirby 2017년 1월 8일
댓글: Walter Roberson 2017년 1월 9일
I have a number of data points, lets say in a vector v, and lets say there are "num" of them. If I write sd = std(v) did it assume a sample i.e. it used num-1 (in the denominator) or did I get a population standard dev i.e. it used num? How can I request one or the other?

채택된 답변

the cyclist
the cyclist 2017년 1월 8일
편집: the cyclist 2017년 1월 8일
By default, it will give the sample standard deviation. Call it as
std(x,1)
to get the population. That is explained in the documentation for std, in the section describing the input argument weight.
  댓글 수: 2
Helen Kirby
Helen Kirby 2017년 1월 8일
Thank you very much. I did actually look under "doc standard deviation" and couldn't find the answer. But thank you for answering my question.
John BG
John BG 2017년 1월 8일
look for standard deviation or std

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

추가 답변 (1개)

Helen Kirby
Helen Kirby 2017년 1월 8일
Could I ask yet another question on this theme - and yes I have read the documentation and it doesn't answer this question. Say if you have x = [1,2,3,4,5,6] and w = [5,7,10,8,12,3] and we want to find the weighted std for a population, how do I write the command for a POPULATION? I understand for a sample it is:
StdSamp = std(x,w) If you put the 1 as the 3rd parameter, it does not interpret it as pop.
  댓글 수: 1
Walter Roberson
Walter Roberson 2017년 1월 9일
You cannot combine the two weighting schemes.
std(x) is normalized by N-1. std(x,1) is normalized by N. std(x,1) works out to be the same as std(x, ones(size(x)) .
std(x,w,1) means to proceed along dimension 1. Your data was row vectors, so that did not work. But you could use
std(x(:), w(:), 1)
if you had particular reason for wanting to specifically process along the first dimension.

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

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by