How do I find the expected value of power in random variable?

Is there any mathematical induction to make it easier to calculate the expected value manually? I am not familiar to higher level of mathematics.
Thanks.

 Risposta accettata

There is no simple formula (that does not involve an integration) to compute the expected value of the square of a random variable, where the random variable can have any arbitrary distribution. Or, perhaps I should say, the expected value is computable using an integration, which may or may not be simple to do.
If all you want to do is compute the SAMPLE mean of the squares of a list of random elements from some given distribution, then mean will do so very nicely. Just generate a set of numbers that follow the desired distribution, square the elements, and then use mean.
HOWEVER, this is NOT an expected value!!!!!!!!! Mean produces a SAMPLE mean, so only an approximation to the true population mean.
For example, it is not difficult to compute the expected value of the square of a variable from a uniform distribution. That is, if X is uniformly distributed on the interval (0,1), as produced by rand, then the expected value of the square of x is theoretically:
syms u
int(u^2,[0,1])
ans = 
Is that what we get from a sampling?
x = rand(1,100);
mean(x.^2)
ans = 0.3366
As we increase the sample size, the error in that estimate decreases.
x = rand(1,10000);mean(x.^2)
ans = 0.3319
x = rand(1,100000);mean(x.^2)
ans = 0.3337
x = rand(1,1000000);mean(x.^2)
ans = 0.3337
As you can see, the error gets smaller as the sample size increases.
But the true expected value is not always easy to compute. For example, it is not too difficult to compute the expected value for the square of a Gaussian random variable. Again, it is just an integration. For a standard normally distributed random variable, we get 1.
int(u^2*1/sqrt(2*sym(pi))*exp(-u^2/2),[-inf,inf])
ans = 
1
But, for a Weibull, or Poisson random variable, you may need to work a little harder to determine the expected value. Again, it requires nothing more than an integration. But you just said you are not familiar with mathematics.

Più risposte (1)

That formula can be written in MATLAB as
P_hat = mean(u.^2);
It is valid only for the case where each u value has the same probability

Community Treasure Hunt

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

Start Hunting!

Translated by