lognrnd Function does not work properly at high variance
Risposte (2)
0 voti
I suspect there is no problem at high variance -- but that you would need an astronomically large number of samples to verify the empirical power is equal to 1 (on average).
Here is a less extreme example. I ran your code, except that I set v = 0.9. I actually ran it 5000 times, and stored the resulting value of P = VX + MX^2 from each run. Each time, P is a little different from 1 -- sometimes quite different. The mean value of P was about 0.999, and the variance of P was about 0.005, so the values are fairly tightly clustered around 1. Here's what the distribution of P looked like:

Now look what happens when I set v = 0.99.

Notice a few things. The extent of the x-axis is much greater, because that's needed to capture the whole distribution (which now has variance 5.2). I am much more likely to get a value far from 1 because of the wide distribution. Also, because the distribution is also skewed, I am much more likely to get a value below 1 -- but I might get one much greater than 1. (However, the mean value is about 0.993, very close to 1.)
This effect will get more and more exaggerated as v gets large, leading to the result you found.
2 Commenti
Frankly, I'm not sure what you expect, or what you mean by a "good result". The facts are the facts.
Here is another run, where I used v=0.9999, increased the number of samples from 1e6 to 1e8, and calculated the empirical power 500 times.

You see that even with 100 times larger sampling, the mode is pretty far from 1. These are immutable facts. 1e6 is just not a "large number" of iterations for your distribution.
Categorie
Scopri di più su Creating and Concatenating Matrices in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!