Conpvtrrr k Gmchu Vd. 6. pp. MI-396 @Pc.mmmRarLfd..1910. PriedinGnrlBli&
DISCRIM: A COMPUTER PROGRAM USING AN INTERACTIVE APPROACH TO DISSECT A MIXTURE OF NORMAL OR LOGNORMAL DISTRIBUTIONS NANCYJ. BRIDGES U.S. GeologicalSurvey, Denver, CO 80225U.S.A. and RICHARD B. MCCAMMON U.S. GeologicalSurvey, Reston.VA22Q92, U.S.A. (Recked 19July 1979) A~~~M-DWRI~~ is an interactive computer graphics program that dissects mixtures of normal or lognormal distributions. The program was written in an effort to obtain a more satisfactory solution 10 the dissection problem than that offered by a graphical or numerical approach alone. It combines graphic and analytic techniques using a Tektronix’ terminalin a tune-sharecomputingenviromncnt.The main programand subroutineswerewritten in the FORTRAN language. Key M&K
Computergraphics,Mixturesof distributions,Dissection. tNTRoDucnoN
graphics terminal. This decision was made because the
The dissection of a mixed frequency distribution long has been a problem for statisticians. Two basic approaches to solving this problem have existed-one numerical and the other graphical. Each of these approaches had its own disadvantages, which are summarized here. A more detailed explanation was given by McCammon(1976a,1976b). The numerical approaches met with dirticulty in that prior knowledge of the number of subpopulations or initialparameter estimates were required. These methods were complicated, and estimate selection became a critical factor. Methods to eliminate the problem of initial estimation met with severe problems also. Even when calculationswere done by a large computer, the methods did not work with complex data. Graphical approaches provided solutions in which the theoretical distributions were hard to compare. Goodnessqf-fit tests were difficult to evaluate because they required calculations.These problems introduced a large degree of uncertainty to the dissection. For this reason, the approach was less than ideal. The graphical and numerical approaches were combined in DISCRIM in an attempt to eliminate some of the major problems encountered in the individual approaches. DISCRIM first was written in I%9 by R. B. McCammon. It was rewritten later for use on INFONET with a Princeton 801 graphics terminal. In 1977,it was decided that the program should be rewritten for use on the Honeywell Multics System using a Tektronix 4014
Princeton 801 was not available widely in the U.S. Geological Survey and because part of the Survey had converted to the Honeywell MulticsSystem. The details of the method and applicationsof DISCRIMin geological problems have been described previously (McCammon, 1976a,1978; McCammonand others, 1979).The purpose of this paper is to provide a description of the dissection program, a current listing, and a worked example.
‘Any trade names in this report purposes only and do not. constitute Geological Survey.
are used for descriptive endorsement by the U.S.
DATA INPUC PoluuT
DISCRIMrequires the followinginformationabout the input data: (1) the total number of observations, (2) the observed proportion of observations, and (3) the corresponding endpoints of the interval in the original histograms. To provide this information, a program was written (Appendix)that accepts the original data to be dissected and generates an output filt that contains this information. Four option types are available for calculating proportions of observations and the associated endpoints. Option 1: the endpoints are calculated for a standard set of observed proportions. Option 2: for situations where the number of observations is large or where it is necessary to dissect populationshavinga high degreeof overlap,the use of an expandedset of proportions of observationsis recommended.Option 3: if the data are reported as grouped observations, the proportions of observationsare selected on the basis of grouped interval bouadPrie~.Option4:aptesekctednum&r(n)ofobsmed proportionsof observationsis entered. For example,if you wantedto use observed proportions(expressedas percentages) of 25,50,75,90,95, and 98, you would enter 6.
361
N. J. Bruffi~s
362
and R. B. MCCAMMON
location, the user types a character followed by a carriage return. The following is a brief explanation of the menu: a
The display generated on the screen of the terminal is designed to keep the user informed at all times of the status of a particular dissection (Fig. 1). The screen is divided into four sections. The upper left section is for messages. Messages are displayedto verify that an action has been taken, to note an error, or to prompt the user. The upper right section contains the name of the data set and a code indicatingwhether the data are assumed to be a mixture of normal or lognormal distributions. Both pieces of informationare suppliedby the user prior to dissection. The main leftmost part of the screen is reserved for plotting. It is used initially to display the cumulative frequency function for the original data. The endpoints of the intervals in the originalhistogramare plotted along the abscissaand the observed proportion of observations are plotted along the ordinate. The axes are left unmarke< as the user does not need to he concerned with the actual values. Later, computed curves and other options requested by the user are plotted on this part of the screen. The rightmost section of the screen contains the “menu.” The “menu” is a list of labels used to describe the options available.By selectingdifferent combinations of labels.the user defines a particularoption. To select a label, the user positions the crosshair cursor on the label name and signalsthat location to the computer. To signal
Components a
d b e c
Eachcomponentdistribution is identifiedby analphabetic character.Components maybc selectedin any orderbut mustbe arranged
f
in alphabetic sequence for dissection. Parameters Parameters associated with each component. Estimates are entered as graphic input, either as a scalar or vector quantity.
intltction pt threshold
display erase delete
Display, erase, or delete the graphic estimates of parameters for specified components.
Brafit
Fit a theoretical curve based on the current set of graphic estimates.
besfitfn)
Fit a theoretical curve with the current graphic estimates by nonlinear least-squares analysis.
pdf cdf
Display the probability-density curves or cumulative frquency curves of the components.
A
D
B
i!
c
P
. . . .
PARMETSIIS SLoPE
. INFLECTION FT
. . . . .
TIiMSHOLD DISPLAY BaASE DEWCE
.
CaAFIT
.
aSsF II
. .
PDF
.
W) CDP
STATISTICS(D) KJZSTAKI hlxr END
Figure 1. Initial display.
DISCRIM a computer statistics(d)
restart next end
program of normal or lognormal distributions
Clear the work space and provide a statistical summary of the dissection or a more detailed summary. Restart the dissection process, ask for next set of data, or end the procedure.
PROGRAMUSE
DISCRIMwas
designed
to: (1) provide a graphic display of a cumulative frequency curve on an arithmetic (or logarithmic) probability scale, (2) permit the graphic estimation of initial values of parameters, (3) allow the selective display, erasure, or deletion of graphic estimates, (4) permit the selection of an arbitrary number of normal (or lognormal) components, (5) generate a graphic display of the theoretical compound distribution for a specifkd number of components, given the values of the parameters of the distribution, (6) produce an algorithm
363
for a least-squares solution which determines an acceptable fit nearest to a set of initial estimates of the parameters, (7) produce a graphic display of component probability density and cumulative-frequency curves, (8) allow a graphic input of threshold values for determining the separability of inferred subpopulations, (9) produce a statistical summary which displays the final values of the parameters, the results of goodness-of-fit test, and the quantitative measures of the separability of the subpopulations, and (10) provide the ability to restart, to advance to the next set of data, or to end the program. As a result, the use of the program is highly flexible. The flowchart (Fig. 2) gives an overview of the basic logic used in dissecting any given curve. A detailed system description (Fig. 3) shows the actual interrelation of the FORTRAN subroutines. A more detailed explanation of the different routines is given later.
Figure 2. Flowchart of DISCRIM
program.
Figure 3. Detailed system description.
DISCRIM
a computer program of normal or lognormal distributions
INlTlALCUAPElCINpvIANDANDl’lON
The dissection process begins with the input of the graphic estimate of the slope of each subpopulation. The program assumes that the leftmost distribution will be labeled component a, the next b, and so on. The assumed input order is: the component label; the chosen parameter, in this example the slope: and the location of two representative points on the screen. As mentioned previously, the information to be input is indicated by the cursor. The user positions the crosshair cursor at the desired location, then signals this location by typing a character and then returning the carriage. The slope, represented by a line, then is displayed on the screen. If the user has assumed a single population, this completes the graphic input. For two or more populations, the slopes of each subpopulation must be estimated in the same manner. For two or more populations, estimates of inflection points are required. To input an inflection point, the user selects a component label, the inflection point parameter, and the screen location that he thinks indicates an inflection point on the curve. The leftmost inflection is associated with component a, the next with component b, and so forth. Once the graphic estimates of the slopes and inflection points have been made, the grafit subroutine is executed. This routine calculates a theoretical cumulative curve using the estimated slopes and inflection points to obtain initial estimates of the mean, standard deviation, and mixing fraction of each subpopulation. The curve is superposed on the data set and allows the user to judge the fit between the estimated curve and the data. The trial fit should be reasonably good because the nonlinear least-squares algorithms require reasonably accurate initial values. If the solution is judged to be unsatisfactory, the graphic estimates are adjusted and new fits are obtained until one fit is judged satisfactory. NoNLWEULEAsr-sQuAuESFlT Two nonlinear least-squares routines exist. The fist is the routine originally used by McCammon (1969). To use this routine, the option besfit is chosen. The second routine is one described by Clark (1977). To use this routine, the option (n) to the right of besfit is chosen. Either routine can be used to obtain a least-squares solution for any given data. Experience has shown that when the distributions have thin tails, McCammon’s routine generally gives the better solution. When the distributions have fatter tails, Clark’s routine is preferable. The curve resulting from either routine is superposed on the original data expressed as points on the screen. If the fit is adequate, the user can proceed by requesting the summary statistics; otherwise, the user trys again to make suitable initial graphics estimates. OTBER INFORMATION If the fit is judged to be adequate, the user can obtain other graphic information. The user can request a display of the probability-density curves by moving the cursor to the label pdf and signailing that location. Further, the user can request a display of the cumulative probability-
365
distribution curve by moving the cursor to the label cdf and signalling that location. If pdf is chosen first and cdf is chosen second, the curves are produced simultaneously on the screen. Another graphics option is available to assess the separability of the inferred sub populations. To do this, threshold values must be chosen. Threshold values are chosen in the same manner as inflection points. The cursor is positioned at the point of separability after indicating the components and threshold parameter on the menu. STATISTICAL
SUMMARY
Once dissection is performed, the summary statistics can be evaluated. When the statistics option on the menu is selected, the mode, median, mean, standard deviation, and mixing fraction for each subpopulation are displayed. The results of a chi-square goodness-of-fit test are also provided. These results consist of the &i-square value, the number of degrees of freedom, the p-value of the chi-square distribution, and the critical value at the 95 percent confidence level. Additional details of the besfit solution are available as an option. To exercise this option, the user moves the cursor to the label (d), which immediately follows the label statistics, then signals this location. The detailed summary provides information on the least-squares fit of the data. The initial and final estimates of the parameters, the mean, the standard deviation, and the mixing fraction of each subpopulation are displayed. Also, the initial and the final error sum-of-squares and the number of iterations for the iterative least-squares fit is provided. In addition, the observed and calculated values for each reported interval for the &i-square goodness-of-fit test are displayed. CiUPmfJCAPAmLJTW At different stages of a dissection, the user may wish to recall the graphics performed earlier, to erase parts of the displayed graphics, or to delete the graphics entirely. Three commands can be used in combination with the appropriate components and parameters to display, erase, or delete any graphics element. The order of input is: (1) enter command (display, erase, or delete), (2) enter corresponding component when applicable, then (3) enter corresponding parameter. For exampk, if the user wished to display the besfit curve along with the prob ability-density-function curves, the display label and the besfit label would be selected. WORKED_ The
following is a sample dissection applied to a set of geochemical data derived from altered rock &ples collected near Ely, Nevada. The data were studied in an effort to understand the zoning patterns associated with a porphyry-type copper deposit. Figure 4 is a plot of the data for the manganese content in gossan material. The x-axis represents the manganese content expressed as the logarithm of the concentration and the y-axis represents the cumulative frequency expressed on an arithmetic normal-probability scale. The first step in the dissection process involves esti-
N. J. BR~DGE.S and R. B. MCCAMMON
A
D
B
E
c
P
.
. .
.
I
I
.
PARAMETERS
1
SLOPE
I
.
INPLECTION PT TWSUDLD
. .
DISPLAY EWE
.
DEu%TE .
CRAFIT
BESFIT PDF
(N) CDP
STATISTICS(D) RESTART NEXT 1 END
Figure4. Initialplot of manganesecontent.
the standard deviation for a single population. The graphic estimate of the standard deviation obtained by choosing a particular slope is indicated by the line in FIgure 5 labeled a. On the basis of this estimate, a theoretical cumulativecurve of the distributionis shown beside the slope. The graphic estimate is used as an initial estimate, and a least-squaressolution obtained by usingthe besfit is shown in Figure 6. In this example, the change in slope is slight. To test the hypothesis that a single lognormal distribution provides an adequate fit to the data, a goodnessof-fit test is performed by using the statistics command. The results are given in Figure 7. For the 258 samples,a chi-squarevalue of 15.41based on 7 degrees of freedom is obtained. Because the critical value at the 95 percent confidence level is 14.07,the hypothesis is rejected. To see what caused the hypothesis to be rejected, a more detailed statistical summary shown in Figure 8 can be displayed. The more detailed summary shows that intervals three, five, and eight contribute most to the total &i-square statistic. With such information,the user can decide where best to position an assumed second population. From the original data, graphic estimates of the standard deviationsof two subpopulationsare obtained along with the selection of the inflection point which best separates the two populations. The theoretical curve produced by these estimates is shown in Figure 9. Note that subpopulation(I has been located to accomodatethe
mating
third interval which had a large chi-square contribution. The Clark algorithmfor nonlinearleast-squareswas used to obtain a best fit. The result is shown in Figure IO.The fit seems to be acceptable. A next step is to obtain the probabilitydensity-function curves shown in Figure 1I. In addition, a threshold value is selected and is represented by the location la&led A in Figure Il. The threshold a best separates the two populations. Figure 12 contains the statistical summary. Because the chi-square value is 8.25 with 4 degrees of freedom and the critical value is 9.49, the hypothesis that the observed distributionis a mixture of two longnormalpopulations is accepted. Moreover, the detailed statistical summary shown in Figure 13 reveals that the third, fifth, and eight intervals contribute considerably less than before. Althoughthe hypothesis of two subpopulationscan be accepted, further study of the data would be necessary to verify the geological meaningfulnessof such a conclusion. Such a study, however, is beyond the scope of this paper. LtMlTArtoNs The user should be aware of complications that can arise when running the program. For instance, grouped data are treated differently from ungrouped data. If the user treats the data as being ungroupedwhen, in fact, the data are grouped, an acceptable solution is unlikely to result.
DISCRIMa computerprogramof normalor lognormaldistributions
367
gommc
LN
ADJUST;ELSE PKOCEED
COWONE~S A
D
m
E
C
F
.
a .
l
PARAMETERS SLOPE
INFLECTION FT THRESHOLD DISPLAY ERASE
__il/_
DELETE .
MAFIT BESFIT PDF
(N) CDf
STATISTICS(D) RESTART NEXT
END Fiie 5. Estimatedslope and theoreticalcumulativecurve for one-populationhypothesis.
@.WIC tQJUST;ElSE
P&OCE~D
LN mH)NEms
.
A
D
B
E
C
F
PARAMETERS SLOPE
INFLBCTIDN PI THBESHOLD DISPLAY ERASE DEUXE
CUAFIT BBSfIT PDF
(N) CM
‘STATISTICS(D) RfsTNtT NEXT WID
Figure6. Least-squans solution for one-populationhypothesis.
N. J. BRNYZSand R. B. hkcAMMON gormc LN CDWONENT0
0;6
-.
critic8l
PBAC. 1.0003
A
D
B
e
c
P
15.41 with 7 D.F. - 31.6 for 10 intorvala
PAUAKEBW
value - 14.07 for p-valru - 0.050
SLOPI
pet. concrm.
p-ml\u
S.D. 2578&S
- 0.03115
II4mFxTIoilFY TIISSSHOLD DISPLAY ERASE DSLBTt GWIT MSIIT
(N)
PDF
CDF
STATlBTICS(D) BBSTMT Nuxf END
Fiie
7. Statisticalsummaryfor one-populationhypothesis.
go8mc LN CDnFONcwrS INITIAL WT. MMN a b95.70 Se
S.D. PIUC. 1905.76 1.000 0.11196c-Ol
FINAL S.D. PMC. 2578.00 l.OOOOOO 0.6425OwO2
A
D
B
E
C
F
MBAN 832.84
Number of iterations - 12 PMANSTSRS SLOPS INTPVL 1 2 3 4 5 6 7 0 9
10
00s.
21.9 31.9 31.9 17.9 31.9 2b.9 20.9 24.9 16.9 22.9
EXP. 19.3 31.7 21.6 21.1 23.6 31.1 24.0 35.0 11.0 17.7
CONTPIB. 0.36 0.00 4.83 0.40 2.07 0.56 0.60 3.M 0.87 1.53
)
INILSCTION rr THRESUDLD DISPLAY ellASB DglBTS WIT SSSFIT PDF
W CDF
STATISTICS(D) RBSTART NCXT
Figure8. Detailed summaryfor one-populationhypothesis.
369
DISCRIM a computerprogramof normal or lognormaldistributions
osmc N
0nPONsNrs A
D
B
E
C
F
'ARMETERS SLOPE INFLECTION F-I THUSHOLD DISPLAY E&GE DELETE CRAPIT BESFIT
(N) CDF
PDF
STATISTICS(D) UESTABT NEXT CND
Figure 9. Theoretical curve for two-populationshypothesis.
8OSPnC
ADJUST;ElSE
PROCEED
LN UX4poNENCS A
D
B
E
C
F
PAnA?fEmus swpe
INFUCTION PT THRESHOLD DISPLAY ERASE DELETE CRAFIT BESFIT PDF
(N) CDF
STATISTICS(D) L
RESTART NEXT END
Figure 10. Least-squaressolution for two-populationshypothesis. CAGEOVol.6,No.4-D
I
N. J. BRIDGES and R. 8. MCCAMMON
370 C
goeEIc
ADJUST;ELSE PBOCEED
LN WnPONEKS A
D
B
E
SLOPS LNFLFCTION
PI
THRESHOLD
DISPLAY
BESFIT
(N)
PDF
CDF
STATISTICS(D)
END
L
Figure Il. Probability-density-function curves, threshold value.
LN *tatiatlcal summary CPT. l
b
MODE MDIAN HEAN S.D. FBAC. 49.22 162.08 294.11 445.33 0.7963 1293.57 2151.34 2774.39 2259.22 0.2043
C~~DNBBS-OF-F~T aample site - 258 chi-square value - 8.25 with I D.F. max. pet. contrlb. - 24.6 for 10 intervals p-value - 0.08275 critical value - 9.49 for p-value 0.050
COWONFXTS A
D
B
E
C
F
PARAMETERS
SLOPE INFLECTION PI
SEPAnMILIlY THBESWLD A B
TlUUiSHOLD VALOE 1014.18
EBHOB OF WiCLASSIFICATION 0.037 0.030 0.067
DISPLAY ERASE CELETE GRAFIT
WSFIT PDF
(N) CDF
STATISTICS(D) RESTART NJXT END
Fwe
12. Statistical summary for two-populations hypothesis.
371
DISCRIMa computerprogramof normal or lognormaldistributions
LN detailed
INITIAL CFT. KEAN t 1625.84 101.06
ma-ry
COWONENTS
FINAL S.D. 4736.65 08.44
Fit&.
0.379 0.621
FRAC. 0.204621 2259.22 445.33 0.796379
A
D
B
E
C
F
S.D.
WAN
2774.39 294.11
Number of iterations - 11 PARANRTERS GOODNESS-OF-FIT SLOPE INTRVL
OBS.
ExP.
21.9 31.9 31.9 17.9 31.9 26.9 20.9 24.9 14.9 22.9
16.5 36.4 26.4 25.1 26.0 29.5 19.7 27.2 11.9 24.9
CONTRIB.
INFLRLTION FT 1 2 3 4 5 6 7 8 9 10
1.75 0.56 1.W 2.03 1.33 0.23 0.08 0.19 0.80 0.16
TRRRSHOLD DISPLAY ERASE LEIETE CRAFIT BESFIT PDF
00 CDF
STATISTICS(D) RESTART NEXT
&UC
13.D~t~ikdSummay
for two-populationshypothesis.
Secondly, a problem arises when the user attempts to dissect a mixture when the data are grouped into a few intervals. It can happen, for instance, that the degrees of freedom will vanish. The calculated degrees of freedom is the number of intervals minus three times the number of subpopulationsminustwo.Thecurrentprogramprovides for up to 30 intervals in the originalhistogramand up to 6 subpopulationsinto which a mixed popu@ion can be dissected. Third, the-user must decide beforehand upon the type of subpopulations.At present, the program is written to handle data for mixtures of either normal or lognormal distributions.Thus, the user is required to specify which of these two mixtures are present. Fourth, the program uses two commercial software packages: IMSL (InternationalMathematicaland Statistical Libraries, Inc., 1976)and Plot 10 TCS (terminal control software) (Tektronix, Inc., 1977).If the user’s facility does not have these available, much rewritingof the program will be necessary.
DISCRIMis a graphic-analyticapproach to dissection that successfullycombinesinteractive computer graphics with an analytic method of solution to the problem of mixed-frequencydistributions.It offers a rapid, accurate,
and convenient method for handlii a di@cultproblem frequently encountered in data analysis. The Appendixcontains the FORTRANcoding for the program and subprogramsused.
Ckuk, I., 1977,ROKE, A computerprogmmfor nonlinearkastsquaresdecomposition of mixtures of distributions: Cornputers & Geos&nces, v. 3, no. 2, p. 245-256. International Mathemakl and Statktical Libraries, Inc., 1976, SWoutks m&h, n&hi, mdnttr, and a&is, in IMSL Library (3rded.): Houston,Texas, 3 vols, misc. pr&a&. McCammon,R. B., 1969,FORTRANIV programfor no&near estimation:Kansas Geol. Survey ComputerConk v. 34,20 p. McCammon,R. B., 1976a.An interactive computer Brapbics approach for dissectinga mixtureof normal(or loswrmal) dhhtions, in Pm. %dArm. Cord. on ComputerGraph&, Interactive Techniaues. and Imafre Processina. SIGGRAPH -’ 76: ComputerGra&c;. v. IO,p. i12. McCammon,R. B., 1978, An interactive computer graphics program for dissecting a mixture of normal (or lognormal) distriins, in Proc. 9th Interface Symp. on Computer Scienceand Statistics:Harvard Univ. and M.I.T.,p. 3614. McCammon.R. B., Bridges,N. J., M-y, J. H., Jr., and Gott, G. B.. 1979,E&mate of mixed ge&amkd popukticms in rocks at Ely, NevadazGeochemkal Exploration 1978.Proc. 7th Intern. Geochem.Exul. Assoc.ExD~.Gc~cbcmi~ts. . Symo.. p. 385-390.’ Tektronix, Inc., W77,4OlOAOl PLOT 10Terminal Control System: Tektronix,Inc., Beaverton,Oregon,71 p.
N. J. Brums
372
and R. B. MCCAMMON
APPENDIX1
Program listing
:: 3 b 5 6
c c c
7 8 9 30 11 12 13 IL 15 16 17 16 19 20 21 22 23 2A 2s 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 LA 45 46 47 48 49 so 51 52 s3 54 55 56 57 58 59 60 61 62 63 65 65 8;
c c c c c
68 69 70 71 72 73 7c 75 76 77 78
CUWUL.fORTRAN
PROGRAM
c PRl5--STANOARD PR27--EXPANDED
TO
GENERATE
PERCENTILE PERCENTILE
PERCENTILES
FROM
RAY
DATA.
TABLE TABLE
INTEGER TERMIN~TERROUT CHARACTER*8 FILEIN~FILEOIJT
PR27/.01~.02~.03~.04~.05~.1r.lSr. .6r.65r.tr.75,.8r.85,.9~.95~.96~.97~.98t.99~~LD~~~~~ESl-~-f~ TERWOUT/6/,TERWINISI IUNIN=9 I UOU*B YR!TE(TERMOUTIS) FORMAT
2 5 7
C c C 8
READ
999
SORT
12 IPEC=N
THE
D4TA
THERE
ARE 1) 2) 31 4)
TO
10
4 OPTIONS ON CALCULATIYG THE PERCENTILES AND INTERVALS. USE STANDARD TA@LE OF PERCENTILES TO CALCULATE INTERVALS USE EXPANDED TABLE OF Dl?RCENTILES TO CALCULATE INTERVALS ENTER ENOPOINTS OF INTERVALS AND HAVE PERCENTILES CALCULATED ENTER PERCENTILES AND HAVE ENDPOINTS OF INTERVALS CALCULATED
FORWAT(IXI’*ENTER
PERCEITILE
“) RFAD(TERWIN,75)ITYP
C C C
20
C c c 22
24 c C
“)
BUFFER
INTO
DO I0 J=Il#N IF(X(J).GF.XN)GO XW=X(J) XT=X(I) X(X)=X(J) X(J)=XT CONTINUE REYIND IUNIN
10 c c c c c C C
DATA
NAME:
READ(IUNINr9.ENO=999)x(w) w=r*1 FORRAT GO TO R N=N-1 Nl=N-1 DO 10 I=lrNl XN=X(I) 11=1*1
9
c c c
INPUT
2*.25*.3~.359.C~.ASr.5~.359
STANOARD
PERCENTILES
USED
IC(ITVP.NE.l)GO NP=15 DO 20 I’lrNP PROR(I)=PRlS(I) GO TO 7I, EXPANDED
VFRSION
IF(ITYP.NE.2)60 NP=27 DO 24 181,NP PROS(I)*PR77(1) GO TO 28 INTERVAL
ENDPOINTS
TO
22
TO
25
USED
ENTERED
CODE:
STb=l,
EXPD=Z;
INTRVL’3:
X
DISCRIM a computer promm of normal or lognormal distributions 79
c
80 81
75
IF(ITYP.NE.T)GO WRITE(TER~OUT,?O) FORMATtlX, “ENTFR READ(tERMIN,?5)NP FORMAT(V) WRTTE(TERMOUT~80) FORMAl(lX,“EYTER REAn(TERnIN,75)(P(I)rI+lrNP) TN=N+l I(=1 DO 60 I=l,NP IF(X(K).LE.P(I))GO PROO(I)=(K-l)/TN GO TO 60 tF(K.LT.N)GO TO PROR(I)=N/TN GO TO 60 K=K+l GO TO 62 CONTINUE GO TO 64
82 70 33 84 a5 86 87 R3 89 90 91
75 R3
62
92 93 94 95 96 97 98 99 100 101 102 103 104 105
106 107 10s 109 ‘110 111 112 113 114 115 116 117 119 119 120 121 122 123 12L 125 126 127 178 129 130 131 132 133 1 Tl 135 136 137 13R 139 140 161 142 143 164 lL5 166 147 148 149 150 151 152 153 154
61
63 60 c c c 26
85 27 29 30
37
34 35
36
35 LP C c c
OWN
PERCENTILES
OUTPUT
NUWBFR
OF
ENDROINTS
TO
INTERVALS:
“)
OF
INTERVALS:
TO
BE
“)
61
63
USEOr
N=NUMRER
FILE
IN
FORMAT
USED
WRITE(TFR*OUT,90) FORMAT(lXr”ENTER OUTPUT READ(TER~IN,7)FILEOUT CALL OPNFLE(IUOU~FILEOUT,“SO IF(ITYP.LE.Z)GO TO 50 DO 41 I=lrNP PROA(I)=PRO9(1)*100. NP2=2+NP WRITE(IUOU,9)N,NP2r(PRO~~I),P~I~~I=l~NP) GO TO 52 WRITE(IUOU~9)N~NP~(P~I~~I=l~NP)
90
Al
1003
26
ENTERED
NP=ITYP YRITE (TERWOUTARS) FORMAT(lX.“ENTER PERCENTAGES: ‘) READ(TERMIN,75)(PROB(I),~=l,NP) D9 27 I=l#NP PROR(I)=PROR(I)/lOtl. XD=N+l DO TO I=l#N Y(I)=I/XD Jfl K=l IF(PROS(J).GT.Y(K))GO TO 34 P(Jq=X(K) J+J*l GO TO 32 U=K+l DO 40 I+JeNP IF(PROB(I).GT.Y(K))GO TO 36 P~I~=X~K-l~+~X~K~-X~~-l~~~~PRO~~I~-Y~K-l~~/~Y~K~-Y~K-l~~ GO TO LO IF(K.EO.N)GO TO 38 U=K+l GO TO 35 P(I)=X(K) CONTlNUE
64
5n c c c 52 55
TO
OPTION
TO
LOOP
BACK
WRITE (TERMOIIT,55) FORMAT{1 X,” DO READ(TERMINt1003)4NS FORFlAT CALL CLSFLE(IlJNIN) CALL CLSFLE(IUOU) IF(ANS.EQ.YES)GO STOP EN0
TO
YOU
THE
WISH
TO
2
RI
DISCRIM
DATA
SET
NAME:
“1
“)
BEGINNING
TO
ENTER
MORE
DATA?“)
313
N. J. Bnmm and R. B. MCCAMMON
314
APPENDIXII 1
c
2 3 L 5 6 7 a 0 10 11 12 13 14 15 16 17 18 19 7C 21 22 23 2c 2s 26 27 28 29 3u 31 32 33 3c 3s 36 37 38 39 co 41 42 L3 44 LS Lb 47
c C c c c c c c c
49 so 51 s2 53 54 5s 56 57
c c c c c c c c c
59 60 61 62 63 64 65 66 67 68 b9 70 71 72 73
c C c c c c c c c c C c c C c
7c 7s
c c
DISCRIH.FORTRAN
THIS IS THE MAIN PROGRAM IT CURVt I’ISSECTING PPOCESS. THE TEKTRDNIX TERMINAL CONTROL
C&TA DATA c c c c c c c i c c c c c
ca c
58 c
AND
1CHA~/97r9A,99.100~101,102/,KCHAR/6~,66~6?,68,69,70/ JYL/3069~2331r2190~2046/rIPARIZOL6r1758r1611~1~70/ VARIABLE
DESCRIPTION
JYL--SCREEN LOCATIONS --USED IN DETERMINING UHICH COMPONENTS CHCSEN IPAR--SCREEN LOCATIONS --USED IN DETERMINING YHICH PARAMETERS CHOSEN LOL--SCREEN LOCATIONS--USED IN DETERMINING WHICH OPTION CHOSEN FIRST’!---USED TO STORE STATUS OF DRAYING OF AXES8 PANEL, MENU, AND KCMD--3SEO TO STORE STATUS OF OPTION CHOSEN OFF OF MENU KSEL--USED TO STORE STATUS OF COMPONENT ENTERED KCAL--USED TO STORE STATUS OF MESSAGES TO BE PRINTED OUT ISL--USED TO STORE STATUS OF SLOPES INPUTTED ISLD--USED 10 STORE STATUS OF SLOPES DRAUN IFL--USED TO STORE STATUS OF INFLECTION POINTS INPUTTED IFLD--USED TO STORE STATUS OF INFLECTION POINTS DRAUN ITH--JSED TO STORE STATUS OF THRESHOLD POINTS INPUTTED ITHD--USED TO STORE STATUS OF THRESHOLD POINTS DRAUN KPAR--USED TO STORE STATUS OF PARAMETER CMOSEN ILOG--USED TO STORE DATA TYPE--LOGNORMAL OR NORMAL IAXD--USED TO STORE STATUS OF AXES DRAUING IPTD--USED TO STORE STATUS OF POINTS DRAYINC N--NUMBER Of POINTS IN ORIGINAL DATA X--DATA INPUT PROB--CUMULATIVE PERCENTILES P--INTERVAL ENDPOINTS PRlS--STANDARD PERCENTILE TABLE PRZT--EXPANDED PERCENTILE TABLE PVB--USED TO STORE STATUS Of THREE OPTIONSCbISPLAYrERASEIDELETE) ICHAR--CHARACTERS USED FOR LAOELLING SLOPES AND INFLECTION POINTS KCHAR--CHARACTERS USED FOR LANELLING THRESHOLDS NP--NUWBER OF INTERVALS IPXIIPY--SCALED AND TRANSFORMED POINTS FOR PLOT CRV--USED TO STORE STATUS OF CURVE CREATION CRVD--USED TO STORE STATUS OF CURVE ORAYING IFCR--USED TO STORE STATUS OF PDF CREATION IFCRD--USED TO STORE STATUS OF PDF DRAYING ISSCl)--INITIAL ERROR SUM OF SPUARES ISSC2)--FINAL ERROR SUM OF SQUARES IFCMR--USED TO STORE STATUS OF CDF CREATION IFCMRD--USED TO STORE STATUS OF CDF DRAUING
76 77
c 78 c
USED AS THE DRIVER IN THE USES THE IMSL SUAROUTINFS SOFTWARE.
ERR=.FALSi. SET
UP
THE
SIZE
OF
THE
PLOTTING
AREA
ON
THE
SCREEN
POINTS
375
DISCRIMa computerprogramof normalor lognormaldistributions 79 80
c YBRrYBZ-Y61 XBR=XB2-XBl URITE(TERbO’JT,l) READ(TERCIN,ll)ITERP CALL INITT(ITERM) fORMAT(lXr”ENTER TERr;INAL FORFAT (V) CALL TERM<2140961 JRITE(TER~OllT~200l) FORMAT (1 X,“ENTER DATASET kEAD(TERMIN,1033)FILENA~E FDRMAT (A81 IF(FILENAIE.EP.PllIT)STOP CALL OPNFLE (IUNITrFILENANE,“SI READ(IUNITrlOOl)N,NDATIorl=)rNDAT) FORMAT(V)
81 82 83 84 a5 E6 67 88 t; 91 92 93 94 95 96 97 PA 99 lOti 101 102 103 104 105 106 107 108 109 110 111 112 113 114 11s 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 13s 136 137 13b 139 14G 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
1 11 2 2oci1 1033
1001 c c c c c c 2002
CONVERT
PROM
6
9 587 012 585 5867 5866 1003
CALL
TO
I’ISL
CALL
“)
TO
PERCENTILE NDAT IS IS NDAT VlJST
OR BE
27
SETTING
ROUTINE--
DECIMAL
587
~=LOCNORMALI
COMPUTES
PROBABILITY
INVERSE
NORNAL
SCALE
MDbRIS(PROB(1 )rYl NDNRIS(PROB(NP)ry2eIDUfl) UP
SCALING
FACTORS
YDIF=YZ-Yl YSC’YBRlYDIF DO 10 I=lrNP CALL YDNRIS(PROB(I),TINORM~IDUM) IPY(I)=Y~.~+YSC*(TINORM-yl) TRANSFORM
O=NORCIAL”)
MDN~IS(PROB(I)rIYT(I)~IDU~)
TRANSFORR CALL CALL
10 c c c
PERCENT
PROB(K)=XCI)/l00. P(K)=X(I+l) GO TO 585 NP=NDAT DO 6 I=lrNP +(1)=x(I) IF(NP.EP.27)tO TO DO 9 I=leNP PROB(I)=PRlS(I) GO TO 585 DO 812 I’lrNP PROBCI)=PR27(1) CONTINUE YRITE(TERROUTISW~) FORMAT(lX,“ENTER* READCTERMINI~~~~)ILOG FORMAT EYC0DE(DATN~1003)FILENAME FORMAT (A81 IF(PROB(l).EP.O)PROB(l~=~./(N*l) DO 8 I=lrNP IXT(I)=P(I) IF(ILOG.EQ.l)IXT(I)‘ALOG~P(I))
4
c c c
“)
ITYP=HOD(~QDAT,~)*~ G3 TO (3rb)ITYP NP=NDAT/Z K=O DO S I=lrNDATat U=K*l
5
c c C e C c c
NAME:
30r120r960rETC.“)
CHECK TO SEE IF USING THE STANDARD OR EXPANDED TARLES OR ENTERING PERCEkTILES DIRECTLY----IF THEN IT REFERS TO PERCENTILE TABLES, OTHERUISE EVE& AND PERCENTILES ARE ENTERED DIRECTLY.
3
C c c
SPEED.
PERCENTILES
l IDUN)
FOR
THE
Y-AXIS.
PROBABILITY
DISTRIBUTION
376
N. J. BRIDGESand R. B. MCCAMMON
158 159 160 161 lb2 163 164 lb5 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 la3 184 la5 la6 187 168 18.9 190 191 192 193 19L 195 196 107
c C c
SETTING
20 C C C ae
RESTART
12 120 121 c C
SCALING
FACTORS
FOR
THE
X-AXIS.
iDIF=X2-Xl xSC'XYR/XDIF DO 20 I=lrNP IPX(I)=XBl+XSc*(IXT(x~-xl) OPTION
CALL RESET CALL ERASE CALL PANEL CALL MENU CALL AXES STX=.FALSi. IAXD=.TRUE. CALL POIN~S(IPXIIPY~NP) IPTD=.TRUE. FIRSTI=.TRUE. CRV=.FALSZ. CRVD=.FALSE. KCTIl KCAL'l DO 12 I=lr6 IFLD(I)*.FALSE. ISLD(I)'.FALSE. IFCR(I)'.FALSE. IFCRD(I)=.FALSE. IFC?lR(I)=.FALSE. IFCMRD(I)=.FALSE. IlH(I)=.FALSE. IlHD(I)=.FALSE. ISL(I)=.FALSE. IFL(I)=.FALSE. CALL '~ESSAGE~KCALIPVB) FIRSTY=.FALSE. FIRST
c 1vm 304
199 200 201 202 203 204 705 226 7U 7 2UR 2 (J 9 210 211 212 213 214 215 716 217 218 219 220 221 222 223 22L 225 226 227 228 229 230 231 232 233 23C 235 236
UP
CURSOR
INPUT
CALL SCURSR(ISCRIJX~~JYI) IF(JXl.NE.O.AND.JYl.NE.O)GO TO 305 KCAL*7 CALL ERASE CALL RESTORE CALL YESSAGE(KCALIPVB) GO TO 3OC DO 317 I=lrlZ IF((JY~.GT.LF!L(I)).OI?.~JY~.LT.LRL~I+~~~)GO
305
TO
317
KC’lC’I
342 J=1r3 IF(PVB(J))
3L2 317
c c C 318
COMPONENT
TO
SEE
UHICH
COMPONENT
03 307 I=lr3 IF((JYl.GT.JYL(I)).OR.~JY1.LT.JYL~I+1)))GO KSEL=I GO TO 309 C3KTINUE
307 c
c
IkPJT--CHECK
CHECK
FOR
GRAFIT
WAS
TO
Et+TERED
307
OPTION
C IF((JYl.LE.LPL(6)).AND.(JYl.GE.LbL(7)))CO C C C 309 705
CHECK
FOR
BESFIT
145
TO
Cl2
OFTIOh
IF((JYl.LE.LBL(7)).ARD.tJYl.GE.LBL(A)))CO JXl.GT.27CO)KSELfKSEL*3 CALL SCURSR(ISCRIJXZIJYZ) IF(JX2.Nt.O.AND.JY2.t4E.0~GO TO 706 KCAL.7 CALL ERASE CALL RESTORE CALL MESSAGE(KCALePV8) ti0 TO 705 IF(
TO
DISCRIM 237 23P. 239 2&O 241 242 243 2&L 245 246 247 2L8 249 250 251 252 253 254 25 5 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 2so 2bl 282 283 284 285 286 287 28P 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315
706 C C c
311 c c c
DO CHECK
SEE
UHICH
PARAMETER
SELECTED
IFCCJY2.GT.IPARCI)).OR.CJY2.Ll.IPARCI*l)~~GO hPAR=I GO TO Cl30,140,114)KPAP CONTINUF CHECK
FOR
INCDRRECT
TO
PROBABILITY
C C C 312 c c C A12
414 C C c
DENSITY
TO
FUNCTION
319
ROUTINE
CALL PDFCKPDF) CALL RESTORE GO TO 121 KCALf3 CALt RESTORE GO TO 121
319
c C C 313
311
CHOICE
IFCCJY2.GT.LBLC8)).0R.(JYZ.LT.LBL(9)))GO KPDF=KSEL IFCJXZ.GT.2?00)KPDF=KPDF+? C c C
3n
I=103
311 TO
a computer program of normal or lognormal distributions
ERROR
MESSAGE
FOR
INCORRECT
SELECTION
OF
PARAUETERS
KCAL=4 CALL RESTORE GO TO 121 DISPLAY
OPTION--SET
STATUS
TO
TRUE
THEN
RETURN
FOR
MORE
INFO
PVBCl)=.TRUE. GO TO 304 BESFIT
OPTION--NONLINtAR
LEAST
SQUARES
ROUTINES
IFCJXl.GE.2850)CAtL BESFITZ IFCJXl .LT.ZISO)CALL BESFIT IFCKCAL.EP.5)CAtL RESTORE IFCKCAL.ER.S)GO TO 121 DO 41C I=183 IFCPVBCI))CALL RESTORE IFCPVBCI))GO TO 121 CONTINUE ENTRY
INTO
GRAFIT
ROUTINE
CALL GRABSF CALt RESTORE GO TO 121 C C C 712
STATISTICS
IFCNCPT.EP.O)GO KSEL=0 IFCJXl .GE,2850)KSEt=1 CALL STATCKSEL) STX=.TRUE. KCAL=3 GO TO 716 KCAL=5 CALL RESTORE GO TO 121
715 716 c C c 857 c c C 858 c C c 912
OPTION--BOTH
ERASE
OPTION--SET
TYPES TO
715
STATUS
TO
TRUE
THEN
RETURN
FOR
MORE
INFO
PVBCZ)=.TRUE. GO TO 304 DELETE
OPTION--SET
STATUS
TO
TRUE
THEN
RETURN
FOR
FlORE
INFO
PVBC3)=.TRUE. GO TO 304 NEU
OPTION--DELETE CALL CALL
ERAS: CLSFLECIUNIT)
ALL
REFERENCES
TO
OLD
DATASET
AND
REENNTER
N. J. BIUEGES andR. B. MCCMNON
378 FILENAME'BLANK GO TO 2
316 317
318
c
319 320 321 322 323 324 325 326 327 328 329 3'0 331 332 333 334 335 336 337 338 339 34c 341 312 3L3 341, 345 346 347 348 349 350 351 352 353 35L 355 356 357 356 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 3&O 3P.l CP2 3P3 3ec 3c5 IPt 31,7 359 3P.9 3Vcl 391 3v2 393 594
c C 130
SLOPE
INPlJT
250 C c c 252 299 c c C
TkO
DATA
POINTS
FOR
SLOPE
C4LL SCURSR(ISCRIJX~(KSEL),JY~(KSEL)) IF(JX3(KSiL).NE.O.AND.JY3(KSEL).NE.O)CO KCAl_=7 CALL ERASE C4LL RESTORE CALL YESS~GE(KCALIPVB) LO TO 736 CALL SC'JRSR(ISCRIJX~(KSEL)~J~~(KSEL)) IF(JX4(KSIL).NE.0.AND.JrC(KSEL).NE.O)CO KCAL'7 C4LL ERAS: CALL RESTORE CALL !lFSS4GE(KCAL,PVB) GO TO 237
237
c c c 2377 2&O
SELECTED
J'1 DO 135 I=163 IF(PVB(I))J=I*1 CONTINUE CO TO (236r299r23br239)J
135 c c C 236
PARAMETER
DRAUS
282
c c C 239
224 2Sb
c c c 160
2bC
237
TO
2377
SLOPE ISL(KSEL)=.TRUE. CALL flOVA6S(JX3(KSEL)rJV3(KSEL)) CALL DRUA~SCJX~(KStL)rJYC(KSEL)) CALL AfdCHO(ICHAR(kSEL)) ISLD(KSFL)'.TRUE. D3 252 I=lr3 RESET
DISPLAYr
ERASE,
PJB(I)=.FALSE. GO TO 304 IF(ISL(KS:L))GO OPTIOY
TO
TO
DISPLAY
AND
DELETE
240
SLOPE
KCAL=5 CALL RESTORE G3 TO 121 C C C 238
TO
OPTION
TO
ERASE
SLOPE
IF(ISL(KSEL))GO UCAL=3 CALL RESTORE GO TO 121 ISLD(KSEL)'.FALSE. CALL RESTORE GO TO 304 OPTION
TO
DELETE
TO
SLOPE
IF(ISL(KSEL))GO TO KCAL=5 CALL RESTORE GO TO 121 IF(.NOT.ISLD(KSEL))GO ISCD(KSEL)=.FALSE. ISL(KSEL)=.FALSE. &CAL=6 C4LL RESTORE GO TO 121 INFLECTIOV
PCINT
282
284
PAPAKETER
J=l DO 260 I=lr3 IF(Pva(I))J=I*l CJ:TINUE C3 TO (3~br138e33br333)J
TO
296
SELECTED
STATUS
CHECKS
DISCRIM 39s ‘96 397 39.5 399
c c c 336
coo 401 4u2
4G3 434 405 406 4117 4LR 409 410 411 412 413 414 415 416 417 41b 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 L42 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473
337 440 c c c
13.5 c c c
338 c c C
380
382
c c c 339
3a4 386
c c c 144
560
INPUT
a computer program of normal or lognormal distributions
INFLECTION
POINT
CALL SCUHSRCISCR,JJXCKSEL)rJJI(KSEL)) IfCJJXCKS:L).hE.O.AUD.JJYCKSEL).NE.0)GO LCAL'7 CALL tRASE CALL RESTORE CALL MESS~GECKCALIPVR) 60 TO 330 IFLCKSEL)=.TRUE. CALL YOVABSCJJXCKStL)rJJYCKSEL)) INFLECTIOV
POINT
TO
337
DRAWN
CALL ANCHOCICHARCLSEL)) IFLDCKSEL)=.lRUE. GO TO 250 IFCIFLCKSEL))GO TO 440 OFTION
TO
DISPLAY
KCAL=5 CALL RESTORE GO TO 121 IFCIFLCKSEL))GC' OPTION
TO
ERASE
TO
TO
DELETE
TO
THRESHOLD
POINT
382
INFLECTION
IFCIFLCrSEL))GO 10 KCAL'5 CALL RESTORE GO TO 121 IFC.NOT.IFLDCKSEL))GO IFLDCKSEL)=.FALSE. IFLCKSEL)=.FALSE. KCAL'6 CALL RESTORE GO TO 121 ROUTINE
POINl
3RO
INFLECTION
KCAL=S CALL RESTORE GO TO 121 1FCIFLDCKSEL))GO KCAL=3 CALL RESTORE GO TO 121 IFLDCKSEL)=.FALSE. CALL RESTORE to TO 304 OPTION
INFLECTION
POINT
362
PARAHETER
TO
386
SELECTED
J=l DO 560 I=183 IFCPVBCI))J=I+l CONTINUE GO TO (5368537#538#539)J
c C
INPUT
THRESHOLD
POINT
c 536
5366
CALL SCURSRCISCR,JJX2CKSEL)rJJIZ(KSEL)) IFCJJXZCKSEL).NE.O.AND.JJY2CKSEL).NE.O)CO KCAL'f CALL ERASE CALL RESTORE CALL MESSAGECKCALIPVR) GO TO 536 ITHCKSEL)=.TRUE.
c C C 540
c
DISPLAY
THRESHOLD
POINl
CA-L 'lOVABSCJJX2CKSEL)rJJIZ(KSEL)) CALL ANCWOCKCHARCKSEL)) ITHDCKSEL)'.TRUE. GO TO 250
TO
5366
379
380
N. J. BIUDGES and R. B.
47b b75
c c
676 477
537
482 463 Lab Aa5 486 ca7 Aaa ba9 APO 491 492 493 494 495 496 497 498 499 500 501 502 so3 504 SO5 506 507 50s 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 52a 529 530 531
c 53b
478 479 LAO c 401 c
100 105 c C c 110
C C C 604
5 6
c C
c c 4 c
:: 13 14 15 lb 17 18
TO
OPTION
THRESHOLD
ERASE
TU
TO
TO
GRAFIT
POIhl 580
TO
DELETE
582
THRESHOLD TO
POINT
540
THRESHOLD
IFCITHCKSEL))GO KCAL=5 CALL RESTORE GO TO 121 IF~.NOT.IIHD~KSEL~~GO ITHDCKSEL)=.FACSE. ITHCKSEL)*.FALSE. KCAL=b CALL RESTORE GO TO 121
586
c c c 145
DISPLAY
IFCITHCKS:L))GO KCAL’C, CALL RESTORE GO TO 121 1FCITWDCKSEL))GO KCALM3 CALL RESTORE GO TO 121 ITHOCKSEL)=.FALSh. CALL RESTORE GO TO 304
584
c
10
OPTION
582
c c C 539
TO
IFCITHCKSEL))GO KCAL’5 CALL RESTORE GO TO 121
5ao
1 2 3
x 0
OPTION
hkch&lON
POINT
584
10
586
OPTION CALL GRAFIT CALL RESTORE GO TO 121 NRITECfERHOltT,105) F3RMAT Cl XI” ERROR
PROBABILITY
DENSITY
IN
TINORH”)
FUNCTION
AN0
CUMULATIVE
FREPUENCY
CURVE
KPD FM0 IFCJXl .GT.270O)KPDF=? IFCJX2.GT.2700)KPOF=f CALL PDF CKPDF) CALL RESTORE GO 10 121 END
OPTION CALL CALL CALL STOP END
RESET CLSFLECIUNIT) FINITTCO~O)
THE PANEL AREA FROM
SURROUTINE THE MESSAGE
SUBROUTINE PANEL CALL NOVABSCOI~) CALL bRuABS(3ObVrO) CALL DRYA8SC3obVr3069) CALL DRYABSCoe3069) CALL DRYABSC~I~) CALL MOVABSCoe2700) CALL DRYABS(3ObV~2700) CALL MOvABSC24OOr3069) CALL DRUAtJSC2Aoo~o) RETURN EYD
DRAUS AND
LINES TO SEPARATE MENU AREAS.
THE
GRAPHICS
DISCRIM 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 3c 31
c c c c c c
THIS SUBROUTINE PRINTS THAT THE USER CHOOSES THESE ARE PRINTED OUT
OUT THE NAMES OF ALL THE OPTIONS FROM PLUS THE FILENAME AND DATA TYPE. ON THE RIGHT SIDE OF THE SCREEN.
~llrIPT~4/8O,68r?0r32,32,32,32~6?,68~?~~~IPTl5f83~8~~6S~8~t?3~83~0~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ IPT18/69r?8,681r1PT19176r78/rlPT20~?8~ CALL CHRSIZO) CALL MOVABSC~SOOI~~~~) CALL AOUTSTC6rOATN) CALL MOVABSC2500,2?04) IFCILOC.EQ.l)CALL ANSTRCZIIPTT~) IFCILOG.EQ.O)CALL ANSTR(lrIPT20) CALL YOVABSC2500r2568) CALL ANSTRClO#IPTl) CALL MOVA~SC25?2,2424) CALL ANSTRC~IIPTZ) CALL MOVAbSC2572t2280) CALL ANSTRC6rIPT3) CALL MOvAbSC25?2,2136) CALL A?JSTRC6rIPT4) CALL MOVABSC2500r1992) CALL ANSTRC~OIIPTS) CALL MOVAbSC25?281F,&8) CALL ANSTRCSrIPT6) CALL YOVAbSC25?2,1?01) CALL ANSTEC13rIPT7) CALL NOVABSC2572~1560) CALL ANSTRCP,IPTI) CALL MOVABSCZS00,1416) CALL ANSTRC?,IPTP) CALL MOVABSC2SOOrl252)~ CALL ANSTRCSrIPTlO) CALL NOVABSC2SOOr1128) CALL ANSTRC6rIPTll) CALL MOVAbSC2500r984) CALL ANSTRC6,IPTlZ) CALL MOVABSC2500,840) CALL ANSTRC13rIPT13) CALL NOVABSC2500r696) CALL ANSTRClO,IPTlL) CALL MOVA8SC2500,552) CALL ANSTRC13rIPTlS) CALL MOVABSC25CJOrL08) CALL ANSTRC?,IFT16) CALL NOVAbSC2500r264) CALL ANSTRC4rIFT17) CALL MOVAbSC2500~120) CALL ANSTRC3rIPT18) RETURN END
:: 34 35 36 37 38 39 40 41 42 43 44 45 16 17 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
1c 2 3 4 5 6 7 8 9 10 11
a computer program of normal or lognormal distributions
c c c c
DRAYS
DATA
AXES
011 THE
SUbROUTINE AXES CALL MOVAbSC2250,3CIC) CALL DRUAHSC~OCI~~OCJ) CALL DRUAbSC3O!lr21UU) RETURN END
SCREEN
381
N. J. BRICGESand R. B. MCCMN 1c 2 3 L 5 b 7 A 9 10 11 12 13 1L
c c c c c c
1c
1c 2 3 4 5 6 7 8 9 10 11 12 13 11 15 lb 17 18 19 20 21 22 23 21 25 26 27 28 29 30 31 32 33 34 3s 36
1c 2 3 cc 5 6 7 8 9 10 11 12 13 1C 1s lb 17 1R 19 20 21 22 ?3 2L 25
THIS ROUTINE PLOTS OUT THE DATA POINTS RtPRESENlS TIIE INTERVCLS AND THE Y-AXIS CuIV,Ul_ATIVE PERCENTILES.
c c c c c
10 2i-J 30 cc 50 60 65 70 80
c c c c c C
WHERE THE REPRESENTS
X-AXIS THE
SuBROUTINE POINTSCIPX,IPYrNP) DIXENSION IPX(301rIPYC30) DO 10 I=lrNP CALL PNTAdS(IPXCI)sIPY(I)) C3NTINUE RETURN tND
ROUTINE WHICH PRINTS OUT ANY TOP LEFT CORNER OF THE PANEL.
FESSAGES
AT
THE
CALL *OVABS(lOFe2784) GO TO C10,20,30rlO.50rb0rbS)YCAL CALL ANSTR(35rIMSl) GO TO 70 ,CALL ANSTRClY,IMS2) GO TO 70 CALL ANSTRC?rIMS3) GO TO 70 CALL ANSTRCZlrIflS4) GO TO 70 CALL ANSTR(Z~IIMSS) GO TO 70 CALL ANSTRClSrI!'lSb) GO TO 70 CALL ANSTRCPIIKS~) DO 80 I=lr3 PVB(I)=.FALSE. RETURN END
THIS ROUTINE CHECKS THE STATUS OF ALL POSSIBLE OPTIONS FOR OUTPUT ONTO THE SCREEN. IT WAS WRITTEN TO RESTORE OUTPUT AFTER A CHANGE IN THE MESSAGE TO BE DISPLAYEDa A DELETION OR ERASURE OF SOME PORTION OF THE GRAPH.
DISCRIM 26 27 2h 29 30 31 32 33 3-i 35 36 37 38 39 40 41 L2 43 CL 45 Lb L7 4F L9 50 51 52 53 54 55 56
lfi
20
30
LO 50
60
70 Bf!
10 11 12 13 14 15 lb
17 1E 19 cc' !, 21 22 23 24 25 26 27 1:I
;s ,'c 3c 31 32 33 34 35 36 37 3E 39 LO 41 &2 L3 LL 25 46
15
21
c c c 2L 2s
a computer program of normal or lognormal distributions
CALL MFNU IF(IPTD)CALL POINTS(IPXIIPYINP) IFCIAXD)CALL AXES CALL -+ESSAGECKCALtPVR) DO 60 K=lrb IF(.NOT.ISLDCK))CO TO II-I CALL NOVARS(JX3CK)rJY3(K)) GILL DRWAdS(JX4CK)rJY4CK)) CALL ANChOCICHARCK)) IFC.NOT.IFLD(K))GO TO 20 CALL MOVAeSCJJXCK)rJJYCK)) CALL ANCHOCICHARCk)) IFC.NOT.ITHDCK))GO TO 30 CALL MOVAtiSCJJXZ(K)rJJYZ(K)) CALL ANCHOCKCHARCK)) IFC.NOT.IFCRDCK))GO TO 50 CALL ~OVABSCIXFCRCK,l)rIYFCR(K~l~) DO 40 I=Z#NTOT CALL DRUABSCIXFCRCKrI)rIYFCR~K~I~) IFC.NOT.IFCHRD(K))GO TO 60 CALL MOVABS(IXFCMRCK,l)rIYFCMR~K~?)) GILL DRU66SCIXFCMR(K,2)rIYFCMttCK~2)) C3NTINUE IFC.NOT.CHUD)GC TO 80 CALL MOVABSCIX(l)~IYCl)) DO 70 I=ZtNPLT CALL DRWABSCIXCI)rIYCI)) CONTINUE CONTINUE RETURN EVD
PR00C30~rlPTDISCAL/XBl,X~2,Y~l,Y~2,YER~X~R,YSC~XSC~ YlrY2,XlrX2~YDIF,XDIF INTEGER TEQWOUT LOGICAL IFL,ISL,IFLD,ISLD,CRV,CRVD,IFCR,IFCRD~IPTD~PVR~FIRST~~ ITH,IT~'P,STX,IAXDIIFC~~~,IFCMRDIERR DhTA TCR'lGLIT/6/ i kQR=.FALSE. IFCNCPT.&ti.J)GP TO h KCAL'S kETURN IFC.NOT.STx)GC TO 18 CALL RESET C9LL ERAS; CALL PANkL C4LL MENU STX=.FALSI. FIRSTM=.THUE. CO:JTINUE IFCKSEL.Ed.3)GO TO lo lFCKSFL.ka.7)GO TG 30 J=l 00 15 I=lr3 lF(PVY(I))J'I*' C3NTINUE IFCKSEL.tiE.7)GO TO 31 GO TO ClO,2lr27,22)J 1FCIFCRCKSEL))CO TO 26 kCAL=5 RETURN PLOTS
PDF
CURVE
CALL ROVA~SCIXFCRCKSEL,l)rIrFCRCKSEL,l)) DO 25 1+2,'1TOT CALL DQW4BSCIXFCR(kSEL,I)rIrFCRCKSELII)) IFCRDCKSEL)=.TRUE. GO TO 180
383
N. J. Brumies and R. B. MCCAMMC~ 47 LP 49 50 51 52 53 54 55 56 57 59 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 7s 76 77 78 79 80 a1 a2 a3 a4 as 86 a7 aB 09 9c 91 92 93 94 95 96 97 98 99 100 1Gl lC2 103 104 lil5 106 11)? 108 109 110 111 112 113 114 115 ?lb 117 118 119 120 121 122
c c
ERASES
C 26
35 33
C C C 36
ERASES
CDF
21
CJRvE
TO
35
TO
36
CURVE
IFCHRD(KSLL-?)=.FALSE. GO TO 180 FWAX=PF(l)/STD(l) DO 150 J=lrNCPT FTrP=PF(J)/STD(J) IF~FTNP.GT.F~AX~C~AX=FTMP CONTINUE YSCF=YBR/FIAX IF(.NOT.(CRV.AND.CRVD))GO CRVD=.FALSE. IF(NCPT.EQ.l)GO TO 161 NCPTl=NCPT-1 DO 159 I=lrNCPTl IF(.NOf.IFLD(I))GO TO IFLD(I)=.FALSE. IF(.NOT.ISLD(I))GO TO ISLD(I)+.FALSE. CDNTINUE IF(.NOT.ISLD(NCPf))GO ISLD(NCPTl=.FALSE. IF(KSEL.GE.?)GO TO 74 DO 72 I=116 IF(.NOT.IFCR(I))GO TO IFCR(I)*.FALSE. CONTINUE
10
1so 30 157
163 159 161 164
72 C c c
PDF
TO
IFCRD(KSEL)=.FALSE. GO TO lb(J GO TO (30r32133r33)J IF(IFCHR(KSEL-?))GO KCAL=5 RETURN IFCMRD(KSiL-?)'.TRUE. GO TO 180 IF(IFCMR(KSEL-?))GO YCAL=5 RETURN
31 32
CALCULATES
TO
157
163 159
TO
164
72
PDF
DO 160 J=lrNCPT DO 170 I'l#NTOT lXFCR(J,I)'(XBltXSCr(X(I)-X1)) CHECK=(-((X(I)-XMN(J))/STD(J))~~2/2.) IF(CHECK.LE. -8a.O)CHECK=-85. IF(PF(J).LT.o.)PF(J)=O. IF(PF(J).GT.l.)PF(J)=l. IYFCR(J,I)'(YBltYSCF*PF~J~+EXP(tHECK)ISTD~J~~ CONTINUE IFCR(J)=.TRUE. IFCRD(J)=.TRUE. CDNTINUE GO TO 85 DO 75 1x186 IF(.NOT.IFCMR(I))GO TO 75 IFCFR(I)=.FALSE. CONTINUE DO 178 J=lrNCPT XC=XBl*XSC'(XCN(J)-Xl)
170
160 74
75
c
c
IMSL
ROUTINE
TO
COPPUTE
THE
C CALL PDNRIS(.S,TINORMrIDUM) YC=YtIl+YSC+(TINORM-Yl) XD=XBltXSi*(XilN(J)tSTb(J)-X1) CALL UDNRIS(.8413rTINORMrIDUM) YD=Y01tYSC*(TINORM-Ii) XA=(YD-YC)/(XD-XC) XB=((YDtYC)-XA+(XDtXC))IZ.
123 124 12s
IF(IFCR(KSEL))60 KCAL'5 PETURN
27
c c
CALCULATED
CDF
CURVE
INVERSE
NORMAL
PROB.
DEN.
FUNCTION
DISCRIM 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
1 2 3 4 s 6 7 a 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 21 25 26 27 ?S 29 3c 31 32 33 34 35 36 37 38 39 Ire 41 42 43 L4 &5 C6 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
a computer program of normal or lognormal distributions
385
c IXFCMR(Jcl)*300
178 a5 180
IF(IYFCMR(J,l).EG.30O)IXFCMR~J,l)=~~3OO.-XB~/XA~ IXFCNR(Je2)'2280 IYFCFdR(J,Z)=(XA*2280.+XB) IF(IYFCMR(J,2).GT.24OCl~IYFCMR~J~2~=24BU IF(IYFCMR(J,2).EQ.2400)1XFCMR(J,2~=((2~~O.-XB~/XA~ IFCFtR(J)*.TRUE. IFCMRD(J)=.TRUE. CDNTINUE CONTINUE KCAL=3 RETURN END
SUBROUTINE c c c c
PROGRAM CLARK'S
BESFITZ
10 ESTIMATE METHOD
PARAMETERS
BY
NONLINEAR
LEAST
SQUARES
LOGICAL ISFL~ISLIIFLD.ISLDICRV~CRVD~IFCRDIIPTD~PVB~ F1RSTRrITH~ITHDrSTX~IAXDIIFCnRlIFCnRD REAL IXT DOUBLE PRECISION AIBICIRFIFRACIRDCIXV~U~YV~U~F.?~F~FYILONST~PU rDFrAN,BMrV,FS,UF,EZ,EX,CHECKlftHECK,TCHECK2
68
c c c
99
163
c c c
167 16C
CAGE0 Vd. 6. No. 4-E
EZ(A,BIC)=DEXP(-((A-B)/C)~~~/~.DO) EX(AnBeC)=(A-B)/C DATA NTIM/SO/rNRDI9frFRAC/l.DO~,RDC/3.Dtl/ DATA CONSTf.39R94228040143268DGl IF(NCPT.EP.O)GO TO 74 IF(.NOT.STX)GO TO 68 CALL RESET CALL PANEL CALL MENU STX=.FALSE. FIRSTH=.TRUE. CALL AXES IAXD=.TRUE. CDNTINUE IF(.NOT.PJB(l))GO TO 163 IF(.NOT.CRJ)GO TO 167 IF(CRVD)GO TO 164 DISPLAYS
CURVE
CALL MOVABS(IX(l)rIY(T)) DO 99 I=Z#NPLT CALL DRUABS(IX(I)rIY(I)) CDNTINUE CRVD=.TRUE. GO TO 164 IF(.NOT.(PVB(Z).OR.PVB())))GO IF(.NOT.CRV)GO TO 167 IF(.NOT.C?VD)GO TO 164 ERASES
CURVE
CRVD=.FALSE. CALL RESTORE GO TO 164 KCAL=S RETURN KtAL'3 RETURN
TO
165
USING
386
N. b2
165
03
c
64
c
65
c
RESETS
PDF
STATUS
69
CHECKS
03
67
If(.NOT.IFCRD(I))GO
68
IFCRD(I)=.FALSE. C4LL
69
I=lr6
RESTORE
DO
9
K=Z,NRD
CF(K)=RF(K-l)/RDC
9
74
KCPTl=NCPT-1
75
NUY=NP
76
NPRM=3*NCPT-1
77
NPRMl=NPRM+l
7 h
DO
79
~=3*1-2
En
U(J)=XMN(I)
10
I'lrNCPT
U(J+l)=STD(I)
$1
lJ(J+2)=PF(I)
1n
53
FL=O.DO
84
D3
85
F=O.DO
1)6
DO
87
J=3*K-2
88
CHECKt((lXT(Il-U(J))/U(J+l))
12
I=lrNUfi
14
C=lrNCPf
-8t?.DOjCHECK=-85.00
89
IF(CHECK.LE.
90
CHK=SNGL(CHECK)
91
c
92
C
93
c
IMSL
SUOROUTINE C4LL
94 9s
69
tiF(l)=FRAC
72
82
TO
C3NTINUE
69
71 73
R.B.MCCAMMON
CONTINUE
66
70
J.B~m~sand
14
TO
EVALUATE
THE
NORMAL
PROB.
'!DNOR(CHK,RNORM)
F=F+U(J+2)*RNORM
FY(I)=F z12
FZ=FZ+~PRO6~I~-FY~I~~'tZ
98
XSS(l)=FZ
99
xss(2)=xss(1)
100
DO
101
PJ(K,3'NCPT)=U(3'NCPT) DO
102 103
16
K=lrNRD J+lrVPRM
16
PJ(K,J)=U(J)
24
IF(ITN.EU.NTIM)GO
104 105
16
ITN=O TO
106
DO
30
I=lr'iJY
107
DO
32
J=lrNCPT
108
K=3*J-2
109
TCNECKZ=((IXT(I)-U(K))/U(K+l))
1lC
CHECK=(-TCHECK2**2/2.Dr)
111
IF(CHECK.LE.
112
TCHECK=DEXP(CHECK)
113
CHK=SNGL(TCHECKZ)
74
-8R,DO)CHECT=-85.00
174
CALL
11s
DF(I,K)=
YDNOR(CHK,RNORA)
116
LF(IrKtl)=-
117
IF(J.EQ.hCPT)GO
11F
TCHECKZ=((IXT(I)-U(NPRP-l))/U(NPRM))
-U(K+2)+CONST+TCHECK/U(K+l~**2 U(K*Z)*(IXT(I)-U(K))*CONST*TCHECK/c(Ktl)**3
119
IF(TCHECKZ.LE
120
TCHKZ=SNGL(TCHECKZ) CALL
121
TO
.-!B.uO)TCHECKZ=-ES.DO
YDNOR(TCHK~,R~OR~'I~)
122
32
DF(I,KtZ)=(RNORR-RNORMZ)
123
30
C3kTINUE
124
co
34
I=lrP1PA~'
125
PO
33
J=lrNPRM
120
A*(I,J)=O.DO b0
127 128
33
33
K=lr'tJM
AY(I,J)=AM(I,J)tDF(CII)'DF(KIJ) J~(I)=C!.DL
129
DO
13v 131
34
34
K=lrVUY
LY(I)=P~(I)+DF(K,I)'(PPO~(K)-FY(K))
132
IECR=O
133
CALL
134
IF(IERR.NE.3)GO
135
lr3
130
v(I)=zl.Dc D3
137
~ATTITTAA,~JPRI~~rIFCP~ 42 42
I'lr'JPR" J=l,'lPRb
139
~~(I)=V(I)*AF(I,J)'L.~(J) CO 60 K=l,NRIa
14G
DO
138
30
42
60
J=l,NPRF:
TO
53
DEN.
FUNCTION
DISCRIM a computer program of normal or lognormal distributions 141 6C 142 163 164 lL5 lL6 b3 147 b2 l4E lL9 150 151 152 153 156 22 155 156 157 15R 159 160 lb1 162 lb3 161 165 t7 166 167 65 168 169 26 170 20 171 172 173 174 175 176 177 25 178 179 1RO 36 161 182 183 38 184 lR5 39 186 187 188 53 189 190 191 192 193 72 104 195 196 74 197 198
1 2 3 4 5 6 7 R 9 10 11 12 13 14 15 16 17 18 19
PJ(K,J)DFJCK.J)*RF(K)~V(J) D3 62 K=lrNRb PJCK,NPt?Ml)fT.DB IFCNCPT.EQ.l)GO TO 62 DO 63 I=lrNCPTT P~CK,NPRFll)=PUCUrNPRrl)-PU(KIJ+I) CONTINUE DO 20 K=lrNRD FSCK)+O.DO DO 22 I=lrNCPT ~=3*1-2 IFCPUCK,J+T).LE.O.DU)GD TO 26 IFCPUCY,J*2).LF.O.DB)GO TO 26 CONTINUE IFCFUCK,3*NCPT).GT.l.DC)tO 10 DO L5 J'lrNUY F=I;.D3 DO 67 JI=lrNCPT I=3*JI-2 CHECK=C(lXT(J)-PU(krI))/PU(KII*1)) -8e.DB)CO TO 61 IFCCHECK.LE. CHW=SNGLCCHECK) CALL '~DNORCCHKIRNORM) F=F+PUCK,I+2)+RNORM CONTINUE kFCKrJ)=F FS(K).FS(K)+(PWOBCJ)-UF(K,J))~~2 GO TO 20 FSCK)=FZ+l.DO CDNTINUE PIN=0 GO 25 K=lrNRD IFCFSCK).GE.FZ)tO TO 25
387
26
NIN=K FZ=FSCK) XSSCZ)=FZ CDNTINUE IFCMIN.EQ.O)GO DO 36 J=l,NPRWl UCJl=PUCFtIN,J) DO 38 K=l#NRD DO 38 J=lrNPRMl PJCKrJ)=UCJ) DO 39 K=lrNUM FYCK)'UFCMINIK) ITN=ITN+l GO TO 2L IFCITN.EO.3)tO DO 72 I*lrNCPT J=3*I-2 XMNCI)=UCJ) STDCI)=UCJ+l) PFCI)=UCJ+Z) KCAL=3 RETURN KCALf5 RETURN END
SUBROUTINE
TO
53
TO
74
BESFIT
c c
c
PROGRAM TO HCCAPFlON'S
ESTIMATE METHOD
PARARETERS
BY
NONLINEAR
LEAST
SWARES
c
DDiJBLE
PRECISION
A~B~C,RF~FRACIRDCIXV~U~YV~U~FZ~F~FY~CONST~PU
USING
N. J. BRIDGES and R. B. MCCAMMON
388
,DF,AMrI3HrV,FS,YF,EZIErrCHECKITCnECK~TCHECK2 DIMENSICN RF~9~rXV~3O~rU~30~~Vv~3O~rU~l~~~PU~9~la~~ DF~30,1?~,A~~17,17~,FY~30~,V~17~rTS~9~,UF~9~3~~~~~~17~ EZ(A,B,C)=DEXP(-((A-B)IC)+CZ/Z.DO) EX(AIBIC)=(A-B)/C DATA NTIMi50/rNRD/9/,FRACfl.DOlrADC13.bOl DATA CONSTf.39a9422a0401C32b8DOl IF(NCPT.EP.O)GO TO 74 IF(.NOT.STX)C9 TO 68 CALL RESET CALL PANEL CALL MENU STX=.FALSE. FIRSTM=.TRUE. CALL AXES IAXD=.TRUE. CONTINUE IF(.NOT.PVB(l))GO TO lb3 IF(.NOT.CRV)GO TO lb7 IF(CRVD)GO TO 164
20 21 22 23 24 2s 26 27 2a
29
30 31 32 33 34 35
36 37 38 39 40 41 42 43 44
68
c c c
45 46 L? Aa
49
50 51 s2 53 54 55 56 57 58 59 6@ 61 62 63 64 65 66 67
ba 69 70 71 72 73 74 7s 76 77 78 79 a0 a1 82 a3 a4 85 86 67
99
163
DRAYS
THE
CURVE
CALL MOVABS(IX(l)rIYC1)) CO 99 I'ZINPLT CALL DRYABS(IX(I)rlY(I)) CDNTINUE CRVD=.TRUE. CO TO 164 IF(.NOT.(PVB(2).OR.PVB(3))))GO IF(.NOT.CRV)GO TO 167
c IF(.NOT.CRVD)GO c c c
167 lb4 165
09
9
a
10
;"p 90 Pi 92 93 94 14 9s 96 12 97 98
ERASES
THE
TO
164
CURVE
CRvD=.FALSE. CALL RESTORE LO TO 164 kCAL=S hETURN KCAL=3 RETURN CIt!TINUE DO 09 I=lr6 IF(.NOT.IFCRD(I))GO TO 69 IFCRD(I)=.FALSE. CALL RESTORE CGNTINUE RF(l)=FRAC DO 9 K=Z,NRD RF(K)=RF(K-l)/RDC NCPTl=NCPT-l NiJMfNP-1 NPRM=S*NCPT-l NPHMl=NPRM+l F=G.DO DO 8 I=lrNUJ XV~I~=~IXT~I+~~+IXT~I~~/~.DO h(I)=IXT(I+l)-IXT(I) YV(~)=PROB(I+~)-PROB[I) F=F+YV(I) DO 10 I=lrNCPT J=3*1-2 U(J)=XMN(I) U(J*l)=STD(I) U(J+2)=PF(I) FL=O.DO DO 12 I=lrNUM F=O.DO DD 14 K=lrNCPT J=3*K-2 CHECK=(-((XV(I)-U(J))/U(J+l))~~2/2.DO) IF(CHECK.LE.8R.bO)CHECK=-85.00 F=F+U(J+2)*DEXP(CHECK)/UtJ+l) FY(I)=CONST*Y(I)*F FZ=FL+(YV(I)-FY(I))+rZ XSS(l)-FL XSS(2)=xSS(l)
TO
165
DlSCRlM DO
99
program
of
normal or bgnormai
distributions
K=l,NRD
16
CO
16
J=lrNPRM
16
PJ(K,J)=U(JI
24
IF(ITN.EId.NTIP)GO
IT\=0
10 3 lr,4
CbmpuIer
PJ(K,ScNCPf)rU(S~NCPf)
100 ICI 1 1'22
a
TO
11:s
DD
30
I=l,::il!l
lli6
~'0
32
J=l,?CPT
lC7
<=3*
74
J-2
1i;r;
CHECK=(-((XV(I)-U(~))/~(~+~))~~~/~.DO)
III Q
IF(CHECK.LF
110
TCHECKzDEXP(CNECK)
111
Df~I,K~=C3VST+~~l~'U~K*2~~EX~XV~l~,U~K~rU~Ktl~~~lCHECK/U~K+l~~~2
.-bR.DO)CHECK=-RS.DO
112
LF~~,U*l~=C3NST+Y~1~~U~K+2~~TCHECKI((EX~XV~l~,
113
U(K),U(K+l)))'C2-l.D~)/U(K+l)~~2 TC
3@
114
If1J.EO.CCPl)GO
115 IlL
TCHECK2+~-~~Xv~I~-U~NPRF-I))/U~NPRw~)~~2/2.D~~ IF(TChECKL.LF.-SB.DO)TCHECK2=-85.00
117
32
DF~l,K*2~=CCNST+~~I~~~TCH~CK/U~X+l~-DEXP~TC~ECK2~/U~NPRW~~
110 119 12c 121 122 123 124 12s 126 127 128 129 130 131 132 133 134 135
?,r)
COkT
136
61:
IPIIJE
LO
34
l=lrNPRR
DO
33
J=l,'lPRW
AY(IeJ)=O.DG 00
33
33
K=lrNU?
A~~I,J~=Al~lrJ~*DF~K,l~~DF~K,J~ ~~(l)+o.DG DO
34
34
KMlrNUM
~M(I)=9*(I)iDf(K,I)'(YV(K)-FYK)) ItRP=U CALL
IATI~~TLAMINPRY~IERR)
lF(IERR.NE.OIGO I,:, 42
TO
53
TO
62
l=l,NPRN
V(I)=D.DC' D3
42
42
J'lrVPRM
v(I)=~(I)+Aw(I,J)~~W(J) DO
60
KwlrNRD
DO
60
J'lrNPRT'
PJ(K,J)=PJ(KrJ)*Rf(K)~V(J)
137
DO
13e
PJ(K,NPRMII=~.DO
62
K=lrNRD
139
lF(NCPT.EU.l)GD
140
DO
63
l=lrNCPTl
141
63
PJ(K,NPRYl)=PU(K,NPRMlI-PU(K,3*1)
142 143 l&4 145
b2
CONTINUE
146 147 148 149
20 K=lrNRD FS(K)*O.DU DO 22 I=lrNCPT J=3*1-2 IF(PU(KrJ*l).LE.O.DO)GO IF(PU(KIJ+Z) .CE.O.DO)CO COhTlNUE lF(PU(Ke3*NCPT).GT.t.DC)GO DO 65 J’lrNUM F=C.DO DO 67 JI=lrNCPT DO
22
150 IS1 152 IS3
TO TO
26 26 TO
154 1ss
156 is7 158 159 160
67 65
161 162
26
163
20
164 165
166 167 168 lb9 l7O
171 172 173 ‘176
25
36
175
316 f77
38
-8d.D0)60 TO 67 IF(CHECK.LE. F=F+PU~K.I*2~~EZ~XV~J~~PU~K~I~~PU~K~~+l~~/PU~K~I+l~ COW1 INUE YF(KrJ)=C>NST*Y(J)*F FS(K)=fS(K)*(IV(J)-YF(K~J))r+Z GO TO 20 FS(K)=FZ*l.DO CONTINUE MIN=O DO 25 K=lrNRD IF(FS(K).GE.FL)tO TO 25 MlN=K FL=FS(K:) XSS(Z)=fZ CONTINUE IF(WlN.EO.O)CO TO 53 DO 36 J=lrNPR*l U(J )=PU(MINIJ) DO 38 K=lrNRD DO 38 J*leNPRWl PJ(krJ)=ll(J) DO 39 K=l.NUW
26
389
N. J. BRIDGESand R. B. MCCAMMON 178 179 180 181 182 183
39
53
104 185 186 187 188 la9 190 191
1 2 3 c 5 6 I 9 9 rn 11 12 13 14 15 16
72
74
c c c c
801
802
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 CO 41 42 43 44 45 46 47 co c9 50 51 52 53 54 55 56 57 58 59 60 61 62 63
803 8Ob
805
806
801
808
a09 810 811 812
813
811 a15 816
al7
FV(K)=YF(MIhrK) ITN=ITN+l GO TO 24 IF(ITN.LP.D)GO DO ?2 I’lrNCPT J=S*I-2 XMN(I)=U(J) SfD(I)=U(J+l) PFCI)=lJ(J*Z) KCAL=3 RETURN KCALIS RETURN END
USED IN FITTING
TO
CALCULATIONS ROUTINE.
74
FOR
SUIROUTILE BATINTCDIN~N,IERR) DOUbLE PRECISION 6rDIN LINENSION D:N~1?,17~rLC~17~,LR(17~ DO 801 I’lrk LC(I)=I LR( I)=1 DO 813 I-1rN B=O.DO DO a03 K’lrN 00 803 J=IrN ~F(DA9S~DIN(KrJ))-tt)803~aO2,RO2 KL=K JL=J B=DABS(DIN(KeJ)) CONTINUE IF(0)701~701r804 J=LR(I) LR(I)=LR(JL) LR(JLl=J K=LC(I) LC(I)=LC(KL) LC(KL)=K DO 805 J=lrN B=DIN
NON-LINEAR
LEAST
SQUARES
DISCRIM 64 65 66 c7 6.5 69
818 701
a computer program of normal or lognormal distributions
LCCJ)'LCCJl) LCCJl)=Jl co 70 815 CONTINUE RETURN IERR=l RETURN EYD
70 71
2 3 4 S
6 7 a 9 10 11
12 13 14 1s lb 17 18 19 2c 21 22 23 :: 26 27
28 29 30 31 32 33 34 3s 36 37 c '3e c 39 c 40 41 42 43 44 45 46 12 47 46 49 St 51 999 52 53 54 5s
56 57 58 59
60 61 62 63 b4 65 :; 60
1G
ERASE
ALL
GRAPHICS
PRESENTLY
co 12 1=lrb IFCIFLDCI))IFLDCI)+.FALSE. IFCISLDCI))ISLDCl)=.FALSE. 1FCIFCRDCI))IFCRDCI)r.FALSE. IFCITHDCI))ITHDCI)=.FALSE. lFCIFCRROCI))IFCRRDCI)=.FALSE. CDNTINUE CALL CHRSIZC3) CALL ERASE DO 999 I=lrb CALL RESET CONTINUE CALL PANE, CALL RENU FIRSTR=.TRUE. XMNCT=S. IFCN.LE.lOO)XRNCT=3. CALL ROVABSC540r256U) IFCKSEL.EP.O)GO TO CALL ANSTRC16rIRSGl) CALL 'TOVABSC250.2424) CALL ANSTRC7rIRSG2) CALL ROVRELCllOOrO) CALL ANSTRCSrIRSG3) CALL ROVABSC130r2352) CALL ANSTRC56rIRSG4) GO TO 11 CONTINUE CALL ANSTRClPsIRSGb)
10
ON
SCREEN
391
N.J. BRIDGES and R. B. MCCAMMON
392 69 70 71
CALL 11
ANSTRCS6rIMSG7)
ITEnP=2352 DO
72
73 74 75 76 77 7s 73 8 t'
LO
I=l,NCPT
IF(ILOG.EQ.l)GO
TO
41
XYOD=XMN(I) XIED=XMN(I) XYEAN=XMh(I) bXMEAN=BXMN(I) XSTD=STD(I) BXSTD=RSTD(I)
91
82 83 54 R5 A6 Y7
NOVABS(130e23S2)
CALL
GO
c c c c 41
TO
42
CALCULATE
YEAF!r
INITIAL
AND
f'?ObE#
FINAL
STANDARD
XqOD=EXP(XHN(I)-STD2)
Bd
XYED=EXP(XYN(I))
69 9(1
XflEAN=EXP(XMN(I)+STD2/2.)
91
dXSTD=SQRT(EXP(2~BXMN(I)+~SlD2)~(EXP(BSTD2)-1))
92 93 9L 95
aX,~EAN=EXPC3XnN(I)+BSTD2/2.) XSTD=SQRT(EXP(2'XMI~(I)+SlD2~*(EXP(STDZ)-l~~
42
IF(KSEL.EQ.l)GO
TO
43
tYCODE(~LINE~3R)ICHLRCI)8X~OO~XMED
38
F3CkATCAL,Fll.2,F13.2)
9b
ITEMP=ITE!lP-72
97 96 9v
CALL
'!OVAbSC13C~ITt~Pl
C4LL
AOUTST(2A,MLINE)
lllti
EYCODE(MLINE~37)XMEAN,XSlC~PF(Il
37
FORYAT(F13.21F10.2~f8.3)
11: 1
CALL
1 (12
GO
43 Iti& 44
EVCODE(MLINEIC~)ICHAR(I)~~~XMEAN,PXSTD,~PF~I~
l('3
AOUTST(35,YLIfiE) TO
40
FOkMATCAL.F10.2,F9.2,F~.3)
1 ('5 106
CALL
YOVAuS(13LeITFFP)
li7
C4LL
AOUTST(3lr~:LICE)
1 c 1?
fYCODE(~LINE,37?)X!"EAh,XSlD,PF(I)
103
ITEPP=ITf??P-72
377 co
AOUTSTC3lr'lLI::E)
C~~~TINUE IFtKSEL.:E.l)GO
112 113
c
11L
c
115
c
110 117
FORXATCFlG.2,F1~.2,FR.3) CALL
1 1 il 111
PRINT
TO
OIJT tIOTcc
ITEMP=ITE?P-72 YOVAUSC13PrITiMP)
120
CALL
4OUTST(2C,MLINE)
121
EVCODEC"LINtr471XSSC2) c7
CALL
tiOVkEL(400rU)
124
CALL
AOUTST(IZ,I"LI~E)
125
E'JCODE(PLINEaLC)ITh 49
fakMAT('*wfiOCR
OF
127
ITtMP=ITtr:P-l&C
12b
CALL
~OVAEJS(lLC.ITEPP,
129
LALL
AOlJTST(26rPLIkE)
1P
DC
131
70
133
CO
134
XC=(IXT(I)-XPN(J))/STD(J)
70
CALL 70
J=lrNCPT flDNOH(XC,RNORP)
Y(I)=Y(I)*P~(J)~RI~oR~
137
lVDX(l)=l
138
K=C
139
YU'Y(1)
140
co
lL1
YDIF=Y(I)-YU
75
I=Z,*%P
162
IFCCN*YDlF).LT.XMkCT)GO
163
K=K+l
l&L
INOX(K+l)=I
lL5
YU=Y(I)
107
75
=
I=lrNP
Y(l)=o.
135
ITEBFTIONS
ClNTIh'UE
132
166
SQUARES
FORNAT(E12.5)
123
136
OF
FOkWAT("SS"rlOX,El2.5) CALL
130
SUN
~~C~DE(~~LIZE~~~)XSS(~) C6
119
126
48
ERROR
11F
122
DEVIATION
CURVES
C3NTINUE ItiTRL'K
TO
75
*#,13)
OF
BOTH
DISCRIM 148 14Y 150 151 152 153 l5L 155 154 157 158 15Y 1tc lb1 162 lb3 %tL lb5 164 167 l*b lb9 17c 171 172 173 17L 175 176 177 178 179 180 181 182 183 lE& lb5 1st lb7 18C l&9 190 191 '192 193 19l 195 lV6 197 198 199
77 c c c
393
INDx(K+~ I=NP C’!AX=U. CHI 2=0. DO ?? I=lrK EXPT=Y(INDX(I+l))-t(INDX(I)) OBS=PROB(INDX(I+l))-PROB(lNDX(I1) CHIZT=N*(EXPT-OBS)*(EXPT-OBSI/EXPT XCT(Irl)=N*OBS XCT(IrZ)‘N*EXPT XCT (Ir3I’CHIZT IF(CHI2T.GT.CFlAX)CMAX=CHI2T LHI2=CHI2*CtlI2T CALCULATES
MAXIMUM
PERCENT
CONTRIBUTION
CYPX=lOO.*C4AX/CHI2
c c c
CALCdLATES
TWf
NUMBED
OF
DEGREES
OF
FREEDOM
NDF’XNTRL-(3*NCpT-l 1-l KNDF=FLDAT(NDFI IF(RNDF.LT.O.5IRNOF=O.5 IF(Ri~DF.6T.2OOCOO.)RI~DF=2OBOOB. IF(CHI2.LT.O.)CHI2=0. c c c
1ciu 7h
92
91 95 33
200 201 202 203 2OL 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 2 2 L; 221 222 223 224 225 226
a computer program of normal or lognormal distributions
34
35
32
31
56
IMSL
ROUTINE
UHICH
CALCULATES
CALL ~DCH(CHI~IRNDF,CHIIIER) PVAL=l .-CNI ALPH=.C’S A~Pttl+l .-ALPH CALL 4DCHl~ALP~lrRf~Of,CRITIIER~ CD TO 78 CALL ANSTR(ZOIIMSG~I CDNTINUE ITEMPtlTEMP-14C CALL ~OVAYS(~O~‘~ITEMP) CALL ANSTR(lS,IRSGYI IF(KSEL.Lt.11GO TO 95 ITEFlP=ITEMP-l&L CALL ?!OVABS(13~rITEMPI CALL ANSTR(36rIMSGlU) DO 91 I=lrK EYCODE(MLINE,P~)II(XCT(I#J),J=~#~I F3RMAT(IC,2F9.lrF10.2) ITCMP+ITEMP-72 CALL YOVAUS(lSG,ITEMP) CALL LOUTST(~ZIMLINE) CGNTINUE GO TO 57 EVCODE(MLINE,33IN FDRMAT(“S\MPLE SIZE = “015) ITERP’ITEWP-72 CALL MOVABS(ZOGIITEMP) CALL AOUTST(lPaMLINE) EYCODE(MLINE,3~1CHIZ F3RMAT (“CHI-SPUARE VALUE = ITEMP=ITtMP-72 CALL MOVABS(ZOOIITEMP) CALL AOUTST(ZI?rMLlNEI EYCODE(MLINEr35)NDF FORKATC”YITH”rI7,” D.F.“) CALL MOVREL (10810) CALL AOUTST(18eMLIhEI EHCODE(MLINE,32)CMAX FDCfAT(“EAX, PCT, CONTRIBe ITEMP=ITtvP-72 CULL “IOVAUS(~O~!~ITEMP) CALL AOUTST(26~MLINFI EvCOOE(MLINE,~~)K FDRNAT (“FOR”, 13,” INTERVALS”) CALL ‘ICVRELOOPI~JI CULL AOUtST(17,MLIt.E) E\ICODE (MLINEr36)PVAL FDRYAT(*‘P-V4LUE = “rF7 . 5) ITEMP=ITEMP-72 :~LL MOVABS(ZOC,ITEF!P) CALL AOUTST(lfrMLINEI C’ICODE (MLINE,39)CRIT
THE
CHI-SPUARED
“rF9.2)
=
“rF5
. 1)
PROBABILITY
N. J. BRIDGES and R. B. MCCAMMON
394 227 2 2
39
F3RYATCnCRITIC41.
VALUE
=
"rF9.2)
lTtMP=ITt#P-72 C4LL
YC'VAt~SC2@f!,ITECP)
CALL
AOUTSTC2brf'LINF)
FVCODE(~lLINE,45)AL~H
45
FDR~ATC"FOR
P-V4LUE
CALL
YOVRELC1UR,O)
C4LL
ADUTSTC19rMLINE)
=
"rFS.3)
THPR=.FALSE. DO
80
I=lrNCPT
IF~IT~~I~~THD~I~=X1+~JJX2~I~-X~l~/XSC IF(ITHCI))THPP=.TRUE.
FI?
CDNTINUE IFC.NOT.ITH(l))GO
TO
PL
XC=(THDCl)-XYNCl))/STDCl)
c c c
1'1s~
ROUTINE
CALL
WHICH
CALCULATES
THE
NORMAL
PROB.
DIST.
MDNORCXC,RNORF)
ES(l)=(l.-RYORM)r~F(l) t?R=ERCl) IFCNCPT.LE.l)GO DO
82
TO
84
1=20NCPT
XC=(THD(I-l~-X~N~I~~/STD(I~ CALL
'lDNORCXC,RNORM)
ERCI)=RNORM*PFCI) IFCI.ER.NCPT)GO
TO
b2
XC=CTHDCI)-XMNCI))/STDCI) CALL
fiDNOR(RNORMrXC)
E~(I)=ER(I)+(l.-RNORn)+PF(I)
a2 L4
E?R=ERR+E?C.I) CDNTINUE IFC.NOT.THPR)GO
TO
57
ITENP=ITEfiP-144 CALL
'4OVABSC130rITEMP)
CALL
ANSTRC~~IIMSG~~)
ITEMP+ITEMP-164 CALL
MOVAUSC350rITEMP)
CALL
ANSTRC22,IRSGl2)
266
;'0 7
ITEMP=ITEMP-72 C4iL
L(.t!
ClLL A'JSTdCL7rI'"SblT) ~3 55 I'lr'lCPT IF(I.tC.f~C~T)GO Tu 5P XC=THO(I) IF~IL@~.E~.l~XC=E~t~CT~~~I~~
269
_
27': ill 272
"OvnusC35~rlTEr~P)
LUCL~DE~~~LI~~E~~~~KCHAR~I~~XC~ER~I~ F3W?eATC4C,Fll.Z,Fl2.3) ITtvP=ITE'lP-72 C4LL
wOVA~~SC13~,ITt"P)
CALL GO
ACUTSTC27rk~L11.E) TU
55
ITC*P=ITCUP-72 C4LL
'OVAoS(1:I'rITtCP)
CALL
rfC~tlTST(27rMLIfiE)
Clf.TIt.UE EYCCDECXLINE,5l)ERd FDht.ATCFi3.3) ITCbP=ITt*P-72 C4LL
~c?VAiSClhSrITtMP)
CALL
AOUTSTC23rMLIf.E)
C 3 t.T I !Jllt IAXD=.TPUE. IPlL=.TRUt. RETURN E?dC
1c ?
c
THIS
I
C
FOR
L
c
SU~~CIUTINE FITHER
OF
CALCULATES THE
NON-LIf.EAR
THE
"STARTING LEAST
POINTS"
SQUARES
NECESSARY
SOLUTIONS.
5
SU~ROUTI~IE
c
C>TulOQ
7
PJ3~;~rSTXrIAXDrILCGr!:rDATll/CURVt/NTOTrNPLTrIXO00~rIY~l00~r
8 9
CS~rCRVD/PARAh/~JCPT~Y~~b~,X~~~~6~~PF~b~~IFL~6~,ISL~6~,ICHAR~6~,
GRAFIT ICUTRL/FIRST~FI~ST~~KCAL~IDU~~JYL~~~,L~L~~~~,IPAR~~~,
IXfCR~hrlJ~~rIYFCR~L,l~~~~,IXFC~R~6.l~J~~,IYFC~R~6,lOO~,X~lOO~,Y~l~O~,
FUNCTION
DISCRIM a computer program of normal or lognormal distributions 1 I: 11
,
12 13 14 15 16 17 1% 19 2 (, 21
22 23 24 25
26 27 21 6E 29 SO 31
32 c 33 c 34 c 35 36
37 38
626
39 4e 41
63
42 43 44 45 46 47 46 49 50 51 52
c c C
67 64
53 65 54 55 56 57 5R 59 6C 61 02 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 7F 79 80 81
82 83 84 85 86 a7 88
72
78
147 146
148
JXlrJYlrJk2,JY2rJX3~l)rJr30~1JX4(6~rJrCC6~~JJXC6~~JJYC6~,JJX2~6~, JJY2C6~rSTDC6~rIFLDCL)rISLD(6~~IFCRC6~~IFCROC6~~ITH~6~,ITHDC6~. ~ChPR~6~rdX~~N~~~,~STD~6~,@PF~6~,IlN,XSSC2~~IFCNRC6~,IFC~RDC6~/PCl/NP, IPX~30~,IPY~3C~rIXToO)rllT(30)rY(50)rPROBC3O~,IPlD/SCAL/XGl, k~2rYDlrY~2,YbP,XGR,YSC,XSC,Yl~Y2~Xl,X2,YDIF,XDIF h'iAL IXT,IYT IFITlGER TERMOUT LOGICAL ~FLIISLI~FLDIISLD,CRV~CRVD~IFCR~IFCRD~IP~O,PVE,FIRS~~, ITH,ITHD,STX,IAXD,IFC~R~IFC~RD,ERR bIYEFISlON PA(L) DATA TERFluU7/6/ fRR=.FALS:. IF(.NOT.STX)GO TO 68 CALL ERASE CALL PANEL CALL MENU STX*.FALSE. FIRSTR=.TRUE. CONTINUE IFC.NOT.PJBCl))GO TO 63 IFC.NOT.CRV)GO TO 67 1FCCRVD)GO TO 64
DISPLAYS
THE
GRAFIT
CURVE
CALL MOVAGSCXXCl)rIYCl)) DO 688 I=ZeNPLT CALL DRYABSCIXCI)rIYCI)) CONTINUE CRVD=.TRUE. GO TO 64 IFCC.NOT.PVBC2,,.OR.C.NOT.PVR(S)))CO IFC.NOT.CRV)GO TO 67 IFC.NOT.CRVD)GO TO 64 ERASES
THE
CURVE
CRVD=.FALSE. CD TO 64 KCAL=S RETURN KCAL=3 RETURN CSNTINUE DO 72 1=1,6 IFC.NOT.IFCRCI))GO TO 72 IFC.NOT.IFCRDCI))GO TO 72 IFCRDCI)=.FALSF. IFC.NOT.IFCWRCI))GO TO 72 IFC.NOT.IFCMRDCI))60 TO 72 IFCMRDCI)'.FALSE. CONTINUE DO 78 1x106 IFC.NOT.IlHCI))GO TC 78 IFC.NOT.ITHDCI))GO TO 78 ITHDCI)=.FALSE. COhTlNUE NCPT=O 00 147 1=1,6 To IF(ISLCI).AND.~FLCI))GC 1FCIFLCI))GO TC 147 I.CPTOI CO TO 146 C3NTINUE IFCHCPT.GT.O)tC TO 148 hCAL=S RETURN FAtNCPT)=l. IFCNCPT.EG.l)GO Tu 153 WNORM=CYT+CJJYCl)-YEl)/YSC) CALL NDNORCRNORM~PACl)) PAA=PACl)/Z. CALL NDNRISCPAA,YMCl)rIDUR) PFCl)=PACl) BPFCl)=PFCl) DO lb9 I=Z#NCPT IFCI.EQ.NCPT)GO TO 152 RNORM=CYl+CJJYCI)-YBl)/YSC) CALL MDNORCRNORNrPACI))
147
TO
65
395
3%
N. J. BRIDGES and R. B. MCCAMMON 89 90 91 92 93
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 1lC 111 112 113 114 11s 116 117 118 119 120 121 122 123 124 125 126 127 128 129 13L 131 132 133 134 135 136 137 138 139 140 141 142 143 l&C 145 146 147 148 l&Y 15G 151 152 153 15c
152
PAA=PA~I-l~+~PA~I~-PA~I-l~~/2. CALL MDNRIS~PAA~YM~l~rIOUM~ PF(I)=PA(I)-PA(I-1) BPF (1)=PF(1) co TO 320 FF(NCPT)rPA(NCPT) BPf(NCPt)=PF(NCPT) CALL ~ONRIS(.S~YM(NCPT)rIDUM)
l&V
153
c c c 320
DETERMINE
HEAY
AND
STD
DEVS
OF
A AN0
B
D3 50 I=lrNCPT STD~I~=~JXC~I~-JX3~I~~~YSC/~~JY~~I~-JY3~I~~~XSC~ tiSTD(I)=STD(I) DO 45 J=l,NP IF~IYT~J~.LT.Y*~I~~GO TO 45 X~~~I~=IXT~J-l~*~YM~I~-IYl~J-l~~r(IXT(J~-IXl~J-l~~/~IYl~J~IYTtJ-1)) BX+lN(I)=XMN(I) G3 TO 50 C3NTINUE ClNTINUE 11h4=0 xSS(l)=O. xSS(2)-0. EYTRY GRAaSF
45 50
c c c
CALCULATE
THEORETICAL
DISTRIEUTION
DEL=XDIF/(YTOT-1) X(1)=X1 Y(l)d. DO 60 I=20NfOT X(X)=X(1-l)*DEL Y(I)=O. 00 70 J=lrNCPT 00 70 I=l,NTOT XC=(X(I)-X~N(J))/STD(J) CALL YDNOC(XC,ANORY) Y(I)=Y(I)tPF(J)~RkOR~ FiPLTIO D@ A0 I=l,NTOT CALL YDNRIS(Y(I)rTINOR~rIOUhl) ITY=Y~l*YSC'(TINORM-Yl) IF( ITY .LT.SOO)GO TO 80 NPLT=NPLTtl
cc
7P
c C c
CALCULATES
THE
CURVE
IY(NPLT)=ITY IX(NPLT)=(XBl+XSC+(XO-X1)) lF(IY(NPLT).LE.2400)GO NPLT=NPLT-1 GO TO 85 C3NTINUE CONTINUE IF(.NOT.CRVD)GO TO 94 CRUO=.FALSE. IF(.NOT.C~V)GO TO 96 CRV=.FALS:. CaNTINUE cFtv= .TRUE. CRVD=.TRUE. KCAL’.? RETURN EMD
80 85
91 96
TO
80
pr gosmoc
258 \cl \ca+03
.40000000e+02
\c463e+02 \c5oooooc+o1
.40540540~+02 .40000000~+03
.0b67258be+02
22 .38610038a+OO .17000000e+02 . .21233521e+02 .85000000e+02 .33590733e+02 .17500000*+03 .52895?52e+02 .25000oooe+03 .?1428571a+O2 .60000000~+03 .810a1080*+02
.17500000e+04
.95752895*+02
aa603087a+o
.40000000*+04
.12500000 .63320 .12