Re: Problem with random variable generation




E.S. wrote:
> Hi Greg!
> Thank you for your prompt reply. I will try to answer the questions
> you have posted in your message.
>
> "How do you define the standard deviation of a complex random
> variable?"
> For a complex random variable, Z=X+jY, the variance is defined as
> E{Z*conj(Z)}=E{X^2}+E{Y^2}, assuming X and Y are independent.

Not quite.

If E{Z} = Z0, it must be E{ (Z-Z0)*conj(Z-Z0)} =
E{(X-X0)^2}+E{(Y-Y0)^2}
even if X and Y are correlated.

> If E{X^2}=E{Y^2}=sigma^2/2 then E{Z*conj(Z)}=sigma^2. This is in an
> agreement with your simulation results. Initially, you assumed the
> variance of 1, and for 10^6 iterations you achived the result.
> However, the problem lies in the fact that for E{Z^2}, theoretically,
> the result should be equal to zero, and in MATLAB we get some value
> approx. equal to 10^-4 (both of us got very similar results).
>
> "You are forgetting about the perennial problems of roundoff and/or
> truncation errors."
>
> This is what I am wondering about. Is it a problem with rounding off
> or some problem with a random generator? I am not sure! It seems to
> me that the random generator employed in MATLAB is producing somewhat
> correlated "random" variables, that is, different runs do not ensure
> independent random variables. In my simulations, the value I was
> getting for E{Z^2} is exactly equal to j*2*E{X*Y}.

"exactly"? That sounds fishy. Did you print the results using format
long?

> "I'm not sure what you did, but my derivations were less than 10
> lines."
>
> I am doing this huge derivations for the IF estimation.

IF? What is that?

> They are
> very, very long, not the derivation for the expected value of
> Z*conj(Z) and Z^2.
>
> "It's not MATLAB. You have to adjust your expectations (no pun
> intended) when dealing with finite computation machines."
>
> Again, going back to the previous comment. This is what I am
> wondering about. But, thanks anyway for your time!

Roger has pointed out that it is probably just probabilistic estimation
error. Calculations of

sqrt(VAR(E{Z^2})) and sqrt(VAR(E{|Z|^2}))

are in order.

Hope this helps.

Greg

.



Relevant Pages

  • Re: Problem with random variable generation
    ... > Hi Greg! ... > independent random variables. ... > I am doing this huge derivations for the IF estimation. ... You have to adjust your expectations (no pun ...
    (comp.soft-sys.matlab)
  • Re: Problem with random variable generation
    ... me that the random generator employed in MATLAB is producing somewhat ... independent random variables. ... I am doing this huge derivations for the IF estimation. ... You have to adjust your expectations (no pun ...
    (comp.soft-sys.matlab)
  • Re: Problem with random variable generation
    ... > derivations are correct, but MATLAB has a problem. ... > generating improper random variables. ... You have to adjust your expectations ...
    (comp.soft-sys.matlab)
  • Re: Problem with random variable generation
    ... > derivations are correct, but MATLAB has a problem. ... > generating improper random variables. ... You have to adjust your expectations ...
    (comp.soft-sys.matlab)
  • Re: Problem with random variable generation
    ... However, if you try to numerically determine the expected value of Z^2, the result is equal to j*2*E, which demonstrates that MATLAB is only capable of generating improper random variables. ... If you drew one value from a standard normal distribution, would you expect that value to be exactly zero, simply because the mean of its distribution is zero? ... But you aren't computing theoretical means, you are computing a Monte-Carlo approximation, and those MC approximations are random variables and have a mean and variance of their own. ... ans = 0.0056569>> ans = ...
    (comp.soft-sys.matlab)