How to exclude bilateral tail
2 views (last 30 days)
Show older comments
Hello all,
I am using this code to generate random numbers and I would like to know how I can exclude the bilateral tail (extreme values). I would like to set a range of 0.05:0.95. Anyone could help me with this?
Thanks in advance,
Arthur
%MEAN
mu=[0.0021 0.46 0.307 1.57 0.235 -2.17];
%/** convert correlation matrix to covariance matrix **/
R = [1.0000 0.2008 0.1561 0.0530 0.4697 0.3865
0.2008 1.0000 0.7806 -0.3242 0.6049 -0.0772
0.1561 0.7806 1.0000 -0.8276 0.3765 -0.4989
0.0530 -0.3242 -0.8276 1.0000 0.0297 0.7812
0.4697 0.6049 0.3765 0.0297 1.0000 0.5794
0.3865 -0.0772 -0.4989 0.7812 0.5794 1.0000];
%/** standard deviations of each variable **/
c = [0.17035e-1 0.48517e-1 0.20748 0.36239 0.39731 0.20431e+1];
D = diag(c);
Sigma = D*R*D %/** covariance matrix **/
rand('seed') % For reproducibility
R = mvnrnd(mu,Sigma,10000)
4 Comments
dpb
on 27 Jan 2021
Or do you mean the 0.95 to be 1-0.05 tails, not an absolute value of 0.95?
That would be a much different result although again the resulting distribution will not be normally distributed.
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!