C3: exponential probability mass
C3: exponential probability mass
The plos shown in Figures C.5 are all simply variations of the plot described above for the uniform distribution, and we will accordingly show only what need be changed to obtain the new plots. In particular, the only necessary changes will occur in the first five lines of code from the previous PA. The remainder of the calculations and the plotting will be identical.
Thus, for the exponential function plotted in Fig. C5a the range is from 0 to 5 rather than 0 to 3, and we must update the definitions of the pdfnow and cdfnow functions, along with the calls to these functions. The first five lines of code will therefore be:
tau=1; range=[0 5]; truncation=[0 inf];
rangeextended=[range(1) range(2)]+.065*diff(range)*[-1 1];
t=linspace(rangeextended(1),rangeextended(2),5001);
pdfnow=@(tnow,taunow) (taunow^-1)*exp(-tnow/taunow);
cdfnow=@(tnow,taunow) 1-exp(-tnow/taunow);
pd=pdfnow(t,tau); cpd=cdfnow(t,tau);
Where we have added a new tau variable and set it to 1. Note that here the second term of the truncation variable changes to inf, which will prevent any truncation of the righthand side of the distribution. The second line actually has no changes; it simply must occur prior to the 5th line and so is included. Note that the second input to the pdfnow and cdfnow functions has changed to a scalar tau variable (from the two-element range variable above). Also, of course, we have changed the pdfnow and cdfnow functions to those of the exponential density.
Similar modifications to the above five lines (changing the range, adding location, scale or other appropriate variables, and changing the definitions of the pdfnow and cdfnow functions would allow us to examine other densities (e.g, the Gaussian and Cauchy densities in C5b,c).