Simple question about Standard Deviation.
69 ビュー (過去 30 日間)
古いコメントを表示
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?
0 件のコメント
採用された回答
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 件のコメント
その他の回答 (1 件)
Helen Kirby
2017 年 1 月 8 日
1 件のコメント
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 Center および File Exchange で Numerical Integration and Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!