Expected value in matlab?

70 ビュー (過去 30 日間)
Raviteja
Raviteja 2011 年 3 月 24 日
コメント済み: Muhammad Yasir 2021 年 8 月 5 日
How to find expected value E[X]=_____ for a given data set X ?
suppose take X=[5 7 8 4 5 2 1 0 -5 -9 0 -7 1 2 -3 -7 -9 0 1 4 2 7 5 6 1 3]
Does matlab mean() is equal to expected value E[X] ?

回答 (1 件)

Andrew Newell
Andrew Newell 2011 年 3 月 24 日
In general, no. It depends on the statistical distribution for these numbers (see, for example, the Wikipedia article). Do you know what your distribution is?
EDIT: Suppose your distribution is that you are equally likely to have any integer from -9 to 9. That's 19 numbers. The expectation for the random number would be
E = (-9:9)/19
ans =
0
However, if you have a set of numbers like your X that are sampled from this distribution, the mean of these numbers estimates E. In this case,
mean(X)
ans =
0.9231
The estimate is, of course, not exactly equal to the expected value because the sample is random.
  2 件のコメント
Raviteja
Raviteja 2011 年 3 月 24 日
Ok, if suppose if you consider two cases,
1. Gaussian distribution
2. Uniform distribution
Then how to calculate ?
Muhammad Yasir
Muhammad Yasir 2021 年 8 月 5 日
how to calculate the expected value of a random matrix like this one (copied from matlab workspace):

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by