using randn within an interval
11 ビュー (過去 30 日間)
古いコメントを表示
Hey Does anyone know of a way to create an mxn matrix of random normals where each entry is within an particular bound. For example each entry is a random normal greater than -1 but less than 2. Thanks
0 件のコメント
採用された回答
Walter Roberson
2011 年 6 月 27 日
a priori bounded numbers never have normal distribution. normal distributions always have infinite tails in both directions.
When people ask this question, the common suggestion is to use a beta distribution instead.
3 件のコメント
Walter Roberson
2011 年 6 月 27 日
"approximately bell shaped curve" together with a lower bound and an infinite positive tail, sounds roughly like the shape of a poisson distribution to me.
Your proposal sounds a bit shaky to me, as it presumes price independence of different stocks, but that is seldom the case. Large scale forces affect large number of stocks, some in contrary directions to the forces (e.g., after a major hurricane, many stocks might go down, but disaster-cleanup stocks go up.)
I am, though, not an economist nor a statistician.
その他の回答 (1 件)
Andrei Bobrov
2011 年 6 月 27 日
v1 = randn(m,n);
rndn12=1+(v1-min(v1(:)))/(max(v1(:))-min(v1(:)))
EDIT (06/27/2011 22:58 MSK)
itl = [-1 4]; % interval
v1 = randn(m,n);
rndn12=itl(1)+diff(itl)*(v1-min(v1(:)))/(max(v1(:))-min(v1(:)))
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!