How to exclude bilateral tail

2 views (last 30 days)
Arthur Santos
Arthur Santos on 22 Jan 2021
Commented: Arthur Santos on 27 Jan 2021
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
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.
Arthur Santos
Arthur Santos on 27 Jan 2021
I would like to exclude extreme values by taking 0.05 from each tail... did you understand me?

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!