%stat351_introduction3.m %order statistics >>X= exprnd(1,10,1) X = 0.4995 0.7216 0.1151 0.2717 0.7842 3.9898 0.1967 0.8103 0.4854 0.2333 >>max(X) ans = 3.9898 >>min(X) ans = 0.1151 >>median(X) ans = 0.4925 >>Y=sort(X) % Y is the order statistics of X. Y = 0.1151 0.1967 0.2333 0.2717 0.4854 0.4995 0.7216 0.7842 0.8103 3.9898 >>Y(2) ans = 0.1967 >>Z = expcdf(Y,1) Z = 0.1087 0.1786 0.2081 0.2379 0.3846 0.3932 0.5140 0.5435 0.5553 0.9815 % probability integral transform X=exprnd(1,10000,1); >> help hist HIST Histogram. N = HIST(Y) bins the elements of Y into 10 equally spaced containers and returns the number of elements in each container. If Y is a matrix, HIST works down the columns. N = HIST(Y,M), where M is a scalar, uses M bins. hist(X,100) Z = expcdf(X,1); hist(Z,100) % random number generator Y= unifrnd(0,1,10000,1); X= -log(1-Y); hist(X,100)