% 1.731 Monte Carlo approximation to derived distribution function derived_dist2 % Program for deriving distribution of z=g(y) when y is lognormally distributed close all nrep=10000 zmax=1 yhs=0.3 y=lognrnd(0,1,1,nrep); z=zmax*y./(y+yhs); % compute histogram normalization (so area of sample PDF = 1) close all nbin=50; [n,zout]=hist(z,nbin) dzout=zout(2)-zout(1) figure bar(zout,n/(nrep*dzout),1) ymean=mean(y) zmean=mean(z) figure cdfplot(z) return