Is the description of mvnrnd a little bit misleading?

1 次查看(过去 30 天)
Input SIGMA is said to be the covariance, but in case of uncorrelated variables this means that SIGMA = sigma^2, isn't it?
  1 个评论
Jochem Bonarius
Jochem Bonarius 2019-7-19
编辑:Jochem Bonarius 2019-7-19
Only for a single vaiable. If more, then it's
SIGMA = I^N * [sigma_1^2 sigma_2^2 ... sigma_N^2] or diag([sigma_1^2 sigma_2^2 ... sigma_N^2])

请先登录,再进行评论。

回答(4 个)

Walter Roberson
Walter Roberson 2017-6-18
In this situation, it is confusing unless you read and think about the small print. I hit exactly this problem myself and spent a good hour trying to figure out it before I read the documentation more carefully. It might make sense to people with a lot of experience in statistics, but for the rest of us, the term "sigma" is strongly associated with standard deviation, not with variance.

John D'Errico
John D'Errico 2017-6-17
编辑:John Kelly 2017-6-22
"covariance matrix SIGMA."
"SIGMA is a D-by-D symmetric positive semi-definite matrix"
"If the covariance matrix is diagonal, containing variances along the diagonal and zero covariances off the diagonal, SIGMA may also be specified as a 1-by-D matrix..."
So SIGMA is stated to be a covariance matrix in multiple places, or at least, a vector of variances. The diagonal elements of a covariance matrix are known to be VARIANCES, not standard deviations. That some people may often use the lower case greek letter sigma to indicate a standard deviation means you need to be careful. But a variable name like this means nothing out of context.

Gregory Canal
Gregory Canal 2019-7-18
The other concern I have with this notation is that you would expect the behavior of mvnrnd in 1 dimension to reduce to normrnd. But 'sigma' in 1 dimension is defined differently in both functions (variance vs standard deviation).
  1 个评论
Steven Lord
Steven Lord 2019-7-18
There is a note in the Tips section on the mvnrnd documentation page describing this difference in behavior between mvnrnd and normrnd.
If you feel that information should be made more prominent, or if you have other feedback about that page, I recommend using the "How useful was this information?" box at the bottom of the page to rate the page and offer feedback about what you feel should be added, removed, or reworked in the documentation. [For feedback about the functionality, you should probably send that to Technical Support.]

请先登录,再进行评论。


Jochem Bonarius
Jochem Bonarius 2019-7-19
编辑:Jochem Bonarius 2019-7-19
So the problem is actually in mathematic notation. I will use Wikipedia for my explanation, as it is accurate enough.
The standard deviation is often represented by the lower case Greek letter σ.
The covariance matrix is often represented by the upper case Greek letter Σ.
What the software developer did, probably in attempt to mimick scientific notation, is use lower case "sigma" to represent σ and upper case "SIGMA" to represent Σ. But this is of course very confusing. And it misses the purpose of using a single character to represent a value, by changing it into a full word.
What the software developer should have done, from a UI perspective, is just call the inputs "standard_deviation" and "covariance_matrix".

类别

Help CenterFile Exchange 中查找有关 Descriptive Statistics 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by