a fortran 77 computer program for the least-squares ... - Science Direct

19 downloads 32949 Views 673KB Size Report
Such illustrations (Pearce variation diagrams) are useful particularly in examining ... A best-fit straight line is determined for a specified X variable and all other.
Computers & Geoscicn,'es Vol. 12. No. 3, pp. 327-338, 1980 Pnnted in Great Britain

0098-3004 80 $3.bX} ~- 0.00 Pergamon Journals Ltd

A F O R T R A N 77 COMPUTER P R O G R A M FOR THE LEAST-SQUARES

ANALYSIS OF CHEMICAL DATA IN PEARCE VARIATION DIAGRAMS J. K. RUSSELL* Department of Geology and Geophysics. University of Calgary, Calgary, Alberta T2N IN4, Canada

(Received 5 August 1985) Abstract--Molar-element ratios (intensive variables) plotted in X-Y variation diagrams have the attribute of reflecting the actual relationships existing between components, if the denominator selected has a constant value. Such illustrations (Pearce variation diagrams) are useful particularly in examining data from igneous-rock suites. Analyses from rock suites usually are scrutinized for chemical variations that have been generated by simple igneous processes. Usually the variations in major, minor, and trace-element chemistry are capable of being described or approximated by a linear regression. A FORTRAN computer program to run on a CDC CYBER 170 computer is presented that generates the necessary molar-element ratios for Pearce diagrams. A best-fit straight line is determined for a specified X variable and all other possible Y variables. The calculated curve is determined by least-squares techniques that minimize the distance perpendicular to the calculated regression. Variances on the linear regression parameters (slope and intercept) are calculated as are confidence limits on the position of the fitted line. K,:t' Words: Linear regression. Geochemistry, Igneous rocks. Variation diagram.

at least one of the oxides can be trcatcd as constant. With judiccous selection of this component, relationMuch of igneous petrology is concerned with the ships betwcen rock analyses dctcrmincd in Pcarce analysis of wholc-rtx:k chemical data. Chemical vari- diagrams may be interpreted within the contincs of ations within anti between volcanic rock suites arc of petrology, as the misleading correlations of Harkcrparticular interest as the trends in major, minor, and type diagrams are absent. This facilitatcs any subsetrace-element chemistry may be used to constrain quent least-squ:tres analysis (or any other mathprocesses of igneous differentiation. Examination of ematical analysis) of the data. the rock compositions on oxide or element variation It must be emphasized that the validity of this diagrams has the merit of illustrating the com- analysis rests upon the assumption that within the positional diversity within a rock suite as well as suite of chemical data being examined, the amount quantifying the relationships that exist between the (extensive variable) of one of the components is a individual analyses (Bowen, 1927, Wilcox, 1979). constant. This is not a difficult or rare situation in Although many different types of variation dia- geology. As an example, the effects of crystal fracgrams are available to petrologists, whole-rock tionation within a magma may be studied by the chemical variations can be illustrated quantitatively chemical analysis of sequential eruption products. with Pearce diagrams (Pearce, 1968, 1970, 1978). The chemical variation may be explained by the crysVistelius and Sarmonov (1961) dcscribed a unique tallization of one or two solid phases. Even with solid situation in which the true correlations between com- solution considered the crystallizing phases will not ponents of a closed array could be determined in a alter the absolute amounts of all the components straight-forward manner. Such a situation arises if remaining in the melt. Therefore with reasonable geoone of the variables of the array has a constant value. logic assumptions the necessary criterion is met freWhen the system contains such a component, the true quently. The new X- Y variables proposed by Pearce correlations between any two other variables (B and (1968, 1970) are molar ratios chosen to facilitate the C) are determined by examining the ratios X"( = B/A) analysis of chemical variation in terms of minerals and Y ( = C/A). The application of this concept to and mineral compositions. igneous petrology has been dcvelopcd by Pearce An evaluation of whole-rock chemical trends (1968, 1970). Valid and successful use of the Pearce generally involves an attempt to fit a curve to the data variation diagrams requires therefore, that within the in order to provide an analytic expression which desuite of chemical data being examined, the amount of scribes the observed chemical variations. Pcrtinent statistics are useful to establish the quality of the fitted curve and to identify different curves. Program Pearcc *Present address: Department of Geological Sciences, Uni- is a F O R T R A N 77 (FORTRAN version 5) program versity of British Columbia, Vancouver. B.C., Canada. developed to run on the CDC CYBER 170 computer INTROI)UCTION

327

328

J.K. RU~ELL

Table 1. Statistics for linear regression of Mg. K vs Si K for Snake River Plain Basalts (Stout and Nicholls. 1977)

Slope Intercept R:

Group I

3 SD

Group 2

3 SD

0.393 -6.33

0.048 3.18

0.246 -0.32

0.089 5.23

0.990

0.894

at the University of Calgary. The program accepts as input 34 major, minor, and trace elements for up to 100 analyses. Best-fit linear regressions are determined on the suite of data using a specified element as the denominator of the ratios and another element as the numerator of the X variable. These two variables (NDEM and NXVAR see program in the Appendix) are fixed throughout each run whereas each of the remaining elements is used in the Y variable. Each run produces a total of 29 regressions. The example used in Table I specifies Si/Na as the abscissa, which is regressed against Ti/Na, AI/Na . . . . etc. as ordinates. Statistics pertinent to the linear regressions are calculated for each of the data sets. A listing of program Pearce and an example of an input data file are included in the Appendix. The whole-rock chemical data are entered in the form of weight percent oxides for the 1"3 major and minor elements (including t i , O ' and !1:O ). The trace-clement concentrations are entered as PPM (parts per million) of the element. Any missing data are accomodated by leaving blanks where required in the data file (PDATA). All of the oxides and elements are converted to atomic proportions of the elements prior to calculating the clement ratios. Iron is converted to FcO,,,,,j and t ! , O is excluded from the remainder of the calculations. The ratios are determined by dividing each element in an analysis by the atomic proportion of the element selected to be the denominator. The denominator of the ratio must be an element whose total abundance (extensive) is independent of the geologic processes thought to operate in the system under investigation (Pcarce, 1968). Confidence limits on the position of the regression curve also are calculated. The desired confidence limit is entered as data and the critical statistic is calculated within the program. LEAST-SQUARES LINEAR REGRESSION Best-fit straight lines for elemental variation diagrams are determined by minimizing the function: D" =

Z (X( - X,): + ( ) ; -

~;):,

(I)

Worthing and Geffner (1946); York (1966) assuming the relation; }; ~- MX, + B.

(2)

The variables in Equation I are explained in Figure 1. The linear regression is calculated assuming that each datum point has equal error and that the X and Y



S

Y

X

Figure I. Schematic representation of coordinate pairs involved in determination ofleast-squres linear regression. (.l]. (X,. Y~)---averageof data" and (X~. Y,.)---adjusteddata to fit on determined curve. observations are unweighted. This approach ensures that the best-fit line truly reflects the quality of scatter in the data. It is not biased by assuming errors in analysis nor by different weighting schemes (Jones, 1979). From York (1966) the slope is determined from: M

=

{V -

U + [iV -

U): + 4(Z)'! '~}

(3)

2Z where U =

~,, (,x', - X~) '

V =

~. ( Yt -

Y")"

:md z

=

~ (y, -

x")(Y, -

Y").

i-1

The intercept for thc linear regression is given by: B

=

Y" -

MXL

(4)

The deviations from the least-squares fit are attributed equally to the X and Y data. The change in the estimated slope and intercept may be considerable using X o r Yalone as the regressed variable. This is an increasing problem for data with significant scatter (Jones, 1979; Mark and Church, 1977). The effects of the different linear regression methods on the estimated position of the best fit curve is portrayed in Figure 2. Figure 2 illustrates the variation in wholerock chemistry between historic lavas from the summit of Kilauea (Wright, 1972, p. 9). The rock compositions of these tholeiite lavas may reflect olivine fractionation processes. Obviously there is great scatter in the data and neither regression on the data will produce a slope that is compatible with the observed olivine phenocryst compositions FO~ ,7. The data are useful, however, to illustrate the differences between the standard linear regression on the Y variable (dotted line) and the regression technique employed in

Pearce variation diagrams

329

leiites (Murata and Richter. 1961; Moore and Evans. 1967). The data in Figure 3 approximate more closely the slope expected from Hawaiian rock compositions that reflect the effects of olivine fractionation.

24 22

VARIANCE OF REGRESSION PARAMETERS v

//

20

The calculated uncertainties for the regression parameters (M = slope and B = Y-intercept) reflect the nature of the scatter in the data used in the leastsquares analysis. The variance on the estimated slope is given by:

•F. / •

is .. , #• q~•



,e

~u = >

/7' , "/ 10

(5)

where R is the Pearson product given in Equation 10. The variance on the Y-intercept also may be calculated by

• /,

14

M:{(I -- R")/N}/R:

12

1~, Fe/K

18

16

~s ---- ( S Y -- S X M ) Z / N + (I -- R ) M { 2 S X S Y

Figure 2. Analyses of historic Kilauea lavas plotted in Mg/K + Xa M(I + R)/R: } (6) vs FejK space (Wright. 1972). solid line represents leastsquares regression determined in program Pearce. Dotted York, (1966). S X a n d SYare the standard deviations line is regression analysis with y as dependent variable, of the X and Y variables respectively (SX: = Olivine composition vectors also are illustrated for olivine U/(N - I), etc.). phenocryst composition r:mge observed in tlawaiian tholeiites (Fo~71. Confidence limits on the estimates of slope and Y-intercept for this regression may be calculated from program Pearce (solid line) (York, 1966). Although a knowledge o f t h e ~ variances (LeMaitre, 1983). The the data are scattered the solid line is obviously a fidlowing expressions are used to calcuhtte the conbetter tit. fidcnce limits: Figure 3 illustrates that as the data improves or acquires a more linear distribution, the differences M + 1 - tq~/:)oM between the two fitted curves diminishes. The data in B + / - 6,/,Frn (7) Figure 3 include the same Kilauean analyses of Figure 2 with additional analyses of Recent Hawaiian thot

~,, "

11o

90

// ,, UAKAO~.. • uwFR At'RJNA tll K,t*UEA ":

" / '

z

where t,,,:, is the critic,'tl Student's-t distribution statistic for (n - 2) degrees of freedom and a is the level of significance. The critical statistic is determined using the IMSL subroutine MDSTI which returns a value for t~,..,~ to program Pearce. This implies a 1 0 0 " ( I - ~)0/0 confidence in our estimated parameters. The algorithm employed by the IMSL subroutine is described by Ltill (1970).

ro

CONFIDENCE LIMITS ON TIlE REGRESSION so •

ao

~.~,,.

Io

.

I:-12 ~ /'. ._..I



" ~o

For the purpose of calculating the confidence limits on the position of the estimated best-fit line. the Y variable is treated as dependent upon X (Y is assumed to be distributed normally about the line). Given the true value of X, the 100"(I - a)% confidence limits on the value of Y are determined after Acton The variance on a~, for each value of X (assumed to be without error) is given by:

(1959).

2o

3o

40

l~" =

FelK

Figure 3. As in Figure 2. results of two different methods of linear regression are illustrated. Data include additional analy,~s of recent tlawaiian tholciitcs to those employed in Figure 2. Sourccs--Makaopuhi and Evans, 1967): Uwekahuna (Murata and Richter. 1961); Kilauea (as in Figure 2).

(Moore

~I

"]" ~( X(X, -

~-I ~ ( y~ _ y,)-' O2r =

,-~

Xa) 2 X'):

(8a)

~ ( y¢ _ y°)2

,-I (N -- 2)

"K(8b)

330

J. K. RU,~SELL

Therefore a set of limits for the location of the leastsquares fit are given for each value of X as:

I

Sn4kp R~v~,rBasalts

(9)

Y 4- t=:ar.

For each linear regression analysis, program Pearce returns the original data with the relevant adjusted Y coordinated (~.). Calculated values of (-E - ,l~.) and ( ); - Y~) are additional output. For each adjusted X variable, the confidence limits on the regression are determined and expressed as a range in the )'-variable. The Pearson product moment given by:

~: (.~;R =

X~)( r, -



dOhyrl~

Gr~uV 2



a,oh y r*c

( , : - x.):

r")

provides an estimate of R: which can be used to evahlate the ability of one variable to predict the other (Ryan, Joiner, and Ryan, 1976). A measure of how well the calculated linear regression fits the data is the ratio of total sums of squares of deviation to sums of squares of deviations on the regression. This ratio is calculated for both the X and Y variables from: TSY =

SRY

=

R" =

~(t;-

Y")-'

~" (Y,. -

Y")'

SRY/TSY

_j

I

~2o 10

f

..... ~. . . . . . . 95 % C.L. 40

8"0

66 SilK

(10)

,~l

30

I

I

Gfouo

(11)

~,hcre TS Y is the total slim of squares and S R Y is the sum of squares on the regression for the Y variable. Analogous expressions are used to calculate R: for the X variable. The correlation coefficient (R) calculated in this manner is a measure of fit for the linear regression applied to the data. APPLICATIONS The statistics on the calculated linear regressions l,icilitate the evaluation of petrologic hypotheses. In particular the statistics on estimated slopes and intercepts may be used to establish significant differences in chemical variations within and between rock suites, Alkali olivine basalt lavas from the Snake River Plains have been separated into two distinct petrographic groups (Stout and Nicholls, 1977). Group I lavas are distinguished by aluminous spinels, occurring as inclusions in the olivine phenocrysts, whereas Group 2 basalt lavas lack this high pressure phase. The chemical analyses of lavas from these two petrographic groups are plotted in Figure 4. Each group describes a unique chemical variation in MgrK-Si/K space which corroborates the petrographic separation. The slopes arc distinct statistically although the Y intercepts overlap (Table !). This is

Figure 4. Least-squares linear regressions on Snake River Plain basalts (Scout and Nicholls. 1977). Fitted curves are shown with 9.5% confidence limits. Solid symbols represent porphyritic lavas of Group I or 2 basalts whereas open symbols signify aphyric ( < 5% phenocrysts) lavas.

illustrated effectively in Figure 4 where the two regressions are plotted with their respective 95% confidence envelopes. The Group 2 data have more scatter than the Group I analyses but both data sets yield reasonably tight confidence limits. Figure 5 illustrates another application of the statistics to a petrologic problem. The observed chemical diversity seen in Recent alkali olivine basalts from Diamond Craters and Jordan Craters in Southeastern Oregon is shown in Figure 5 (Russell, 1984). These lavas are from the High Lava Plains physiographic province (Walker and Noll; 1981) and share enough chemical and petrographic similarities to belong to a single petrographic province (Verhoogen and others, 1970; Greene et al., 1972). The 99% conlidence envelope pertains only to these analyses from southeastern Oregon. Chemically, the lavas from Diamond and Jordan Craters have high alumina contents ( 16.817.4w1% AI,O3) which makes them similar to the high-alumina basahs of the Cascades and the Oregon Plateau (Anderson, 1941; Powers, 1932; Waters, 1962). Pleistocene alkali olivine basahs from Mexico described by Nelson and Carmichael (1984) have similar alumina contents and the same phcnocryst assemblage as documented in the Southeastern Oregon lavas (olivine, plagioclase, and spinel). Wholerock analyses representative of these rock suites are plotted in Figure 5 and except for the Mexico lavas, they are distinct from the chemistry exhibited by the Southeastern Oregon lavas. The lavas from Nayarit, Mexico are also distinct chemically from the Southeastern Oregon basalts but lie within the projected chemical trend defined by the diversity or compositions seen at Diamond and Jordan Craters. I)ISCUSSION Whole-rock chemical data are useful in testing for petrologic processes such as crystal fractionation,

Pearce vanation diagrams

Olamon¢ C r l t l r l



NIlcarlt. Mere,co

g~.

WIItlrs.(19G2)



/

3C

~

331

/

~

10

99 % C.L. '

4'0

8'0

120

'

160

2()0

SilK Figure 5. Relationships between calculated regression on lavas from Diamond Craters (Russell, 1984), and average high-alumina basalt of Waters (1962), Modoc basalts (Powers, 1932), and alkali olilvine basalts from Mexico (Nelson and Carmichael, 1984). Plotted linear regression and 99% confidence envelope pertain only to Diamond Craters analyses.

magma mixing, assimilation, etc. Mass balance constraints suggest that chemical variations generated by such processes generally should be simple and linear. Pcarce variation diagrams allow petrologists to evaluate such chemical trends in a quantitativc fashion involving specific minerals and mincral compositions. The question being asked is: "Does the whole-rock chemical data yield a variation consistent with the theoretical process?" Figure 6 illustrates the effcctivcncss of Pcarce variation diagrams in answering these types of queries. The sclection of axes ?f = Si/A and Y = 3Na + 2Ca + 0.5(Fe + Mg)/A (where A is an element not occurring in plagioclase or olivine solid solution) provides a method of evaluating the role of olivine and plagioclase crystal fractionation. Rock compositions related through the selective accumulation or removal of olivine and plagioclasc of any composition or proportions will define a slope of 1.0 (Pearce, 1968). We wish to know if the measured data are explained adequately by the suggested process. The plagioclase and olivine phyric basalts from Diamond Craters, Oregon (Russell, 1984) which are plotted in Figure 6, define a slope of 1.010 and obviously fit the theoretical slope. The slope obtained from the rock data would be the same for any denominator, providing the element selected does not participate in the geologic process being examined. Although Pearce variation diagrams do not represent the only method of evaluating petrologic hypotheses they are unique in their ability to relate easily whole-rock chemical vibrations to specific minerals or mineral compositions. Recent work by Aitchison (1981, 1984) arrived at a similar method of examining correlations between variables of a closed array. Although this work attempts to provide geologists with the tools to determine the true correlations between oxide components of whole-rock analyses, the proposed log ratio plots

tend to obscure the simple chemical variations observed in nature. More importantly, it is forgotten that geologists select variables that arc correlated by a particular process and test whether the data conform to the predicted trend. The least-squares technique used in program Pearcc offers a preferred straight-linc fit to chemical data. The lit assumes the analyses are unwcighted and therefore the variances on slope and intercept reflect the quality of scatter in the data set. The confidence limits on the regression line are determined assuming Yto bc an indcpendent variable. The confidence limits and othcr statistics on the best fit line generated by this program facilitate the quantitiative interpretation of Pearce variation diagrams.

140 A

120 Z t~ CJ t~

100

100

120

140 SilK

Figure 6. Plot of Diamond Crater lavas (Russell. 1984) with Y = 2Ca + 3Na + 0.5(Mg 4- Fe)jKand X-- Si/K. Diagram illustrates role of plagioclase and olivine fractionation in these lavas. Slope of calculated linear regression is 1.010 vs thcoretical slope of 1.0 (shown in inset).

332

J. K. RusSELL

Pearce, T. H., 1978, Olivine fractionation equations for basaltic and ultrabasic liquids: Natfire, v. 276, no. 5690, p. 771-774. Powers, H. A., 1932, The lavas of the Modoc Lava Beds Quadrangle, California: Am. Min., v. 17, p. 253-294. Russell, J. K., 1984, Petrology of Diamond Craters, S. E. REFERENCES Oregon: unpubl, doctoral dissertation. Univ. Calgary. Alberta, ! 10p. Acton, F. S.. 1959, Analysis of straight-line data: John Wiley Ryan, T. A.. Joiner, B. L., and Ryan. B. F., 1976, Minitab & Sons, Inc.. New York. 267 p. student handbook: Duxbury Press, North Seituate, Aitchison. J.. 198 I. A new approach to null correlations of Massachusetts, 341 p. proportions: Jour. Math. Geology, v. 13, no. 2, p. Stout, M. Z., and Nicholls, J., 1977, Mineralogy and pet175-189. rology of the Quaternary lavas from the Snake River Aitchison. J.. 1984. The statisticalanalysis of geochemical Plain. Idaho: Can. Jour. Earth SO., v. 14. no. 9, p. compositions: Jour. Math. Geology. v. 16. no. 6. p. 2140-2156. 532-564. Verhoogen, J., Turner, F. J., Weiss, L. E., Wahrhaftig. C., Anderson. C. A.. 1941, Volcanoes of the Medicine Lake and Fyfe, W. S., 1970, The Earth. an introduction to Highland California: Univ. Calif. Publ. Bull.. Dept. physical geology: Holt, Rinehart & Winston. Inc., New Geol. Sci.. v. 25, p. 347-422. York, 748 p. Bowen. N. L., 1927, The evolution of igneous rocks: Dover Vistelius. A. B.. and Sarmonov, O. V., 1961, On the correlaPubl. Inc., New York, 332 p. tion between percentage values: major component corGreene. R. C., Walker, G. W., and Corcoran. R. E., 1972, relation in ferromagnesium micas: Jour. Geology, v. 69, Geologic map of the Burns Quadrangle, Oregon: U.S. no. 2. p. 145-153. Geol. Survey. M.I. map 1-680. Walker,-G. W., and Nolf. B.. 1981. High Lava Plains. Hill. G. W.. 1970. Algorithm 396, Student's T quantiles: Brothers fault zone to Harney Basin Oregon, in Guides C.A.C.M.. v. 13. p. 619 620. to some volcanic terranes in Washington, Idaho. Oregon Jones, T. A.. 1979, Fitting straight lines when both variables and Northern California: U.S. Geol. Survey Circ. 838, p. are subject to error. 1, Maximum likelihood and least 105-113. squares estimation: Jour. Math. Geology, v. I I, no. I, p. Waters, A. C., 1962, Basalt magma types and their tectonic 1-25. associations: Pacific Northwest of the USA, in Lc Maitrc. R. W., 1983, Numerical petrology: statistical MacDonald, G. A., and Kuno, H., ed., The crust and the intcrprctation of geochemical data: Elsevier Sci. Puhl. Pacific Basin: Am. Geophy. Union, Geophy. MonoCo., Amstcrdam. 281 p. graph 6. p. 158-170. Mark. D. M.. and Church. M., 1977. On the misuse of Wilcox, R. E., 1979, The liquid line of descent and variation rcgrcssion in earth ,~icnccs: Jour. Math. Geology, v. 9. diagrams, in YodeL H. S., ed., The evolution of igneous no. I. p. 63 75. rocks: Univ. Press, Princeton, p. 205-232. Moore. J. G., and Evans, B. W.. 1967, The role of olivine in Wright. T. L., 1972, Chemistry of Kilauea and Mauna Loa the crystallization of thc Prchistoric Makaopuhi in space and time: U.S. Geol. Survey Prof. Paper 735. tholeiitic lava lakc: Contr. M m . Petr., v. 15. no. 2, p. 39 p. 202 -223. York, D., 1966, Least squares fitting of a straight line: Can. Murata, K. J., and Richter, D. I1., 1961, Magmatic difJour. Phys., v. 44, p. 1079-1086. ferentiation in the Uwekahuna laccolith, Kilauea Caldera, llawaii: Jour. Petrology, v. 2, pt. 3, p. 424-437. Nelson, S. A., and Carmichacl, I. S. E., 1984, Pleistocene to OTilER REFERENCES Recent alkalic volcanism in the region of Sanganguey volcano, Nayarit, Mexico: Contr. Min. Petr., v. 25, no. I, Chayes, F., 1971, Ratio correlation: a manual for students of p. 124. petrology and geochemistry: Univ. Chicago Press, ChicaPearce, T. t1., 1968, A contribution to the theory of variago, 99p. tion diagrams: Contr. Min. Petr., v. 19, no. 2, p. 142 -157. Pearce, T. I1., 1970, Chemical variations in the Palisades Meyer, S.L., 1975, Data analysis for scientists and engineers: John Wiley & Sons, New York, 513 p. Sill: Jour. Petrology, v. I !, pt. I, p. 15-32. Ackno~ledgments---Computer time on a CDC CYBER 170 computer was supplied by Acadmic Computing Services at the University of Calgary. Financial support was in part obtained from NSERC Research Grant 69-1020.

Pearce variation diagrams

333

APPENDIX Program Pearce Table 2. Example of format required in data file 002 Oregon volcanics 0109 99.0 DCV029 47.63 1,18 17.22 0.04 1.3 63,9 17.1 50.8 212.5 220.8 DCV04 I 47.55 !.46 16.86 0.07 2.6 91.3 19.9 42.5 202.1 230.0

Data File

1.27

8.88

247.3 94.2

49.4

1.45

203.0

8.99

279.7 104.0

8.52

0.0 259.5

30.0

8.19

2.68 17.9 114.2

10.67

0,0 96.3

(see Table

of s a m p l e s

11.12

92.4

0.17

0.0 57.1

(PDATA):

Line i: No. (13,a99).

0.19

0.0 32.8

2.94 19,8 44.8

0.29 58.9 0,41 58.2

0.17 10~3.9 0.26 99.3

2)

(NN) , project

title

Line 2: Code identifying e l e m e n t c h o s e n as X v a r i a b l e {NXVAR), c o d e for e l e m e n t chosen as d e n o m i n a t o r of ratios (NDEM) (code c o r r e s p o n d s to the order in which e l e m e n t s are e n t e r e d on lines 3-8) (I2,I2) Line

3:

Percent

Line

4:

Sample

confidence label

limits

required

(a12)

Line 5 & 6: Major and minor e l e m e n t s percent oxide in the following order; SiO 2, TiO 2, AI203, CaO,

(f6.3)

Fe203,

FeO, MnO,

in weight

MgO,

Na2o , K20 , P 2 0 5 , H2 O+, H20(12F6.2,/,F6.2)

Line 7 & 8: Trace elements the following order;

in PPM of the element

in

Nb, Zr, Y, St, U, Rb, Th, Pb, Ca, Zn, Cu, Ni, Co, Cr, V, Ce, Nd, Ba, La, Sc, S (12F6.1,/,9F6.1) Lines

4-8 are repeated NN times.

PROGRAM PEARCE

PROGRAM PEARCE(PDATA,PELM,TAPEI=PDATA,TAPE9=PELM) C C C C C C C C C C C C C C

P R O G R A M P E A R C E G E N E R A T E S E L E M E N T R A T I O S AS D E S C R I B E D BY P E A R C E (1968). THE D A T A IS INPUT AS W E I G H T P E R C E N T O X I D E S FOR THE M A J O R AND M I N O R C O N S T I T U E N T S AND PPM FOR THE T R A C E ELEMENTS. THE P R O G R A M C A L C U L A T E S RATIOS AND L E A S T S Q U A R E S THE S E L E C T E D X - V A R I A B L E A G A I N S T ALL P O S S I B L E Y - V A R I A B L E S F O R A S P E C I F I E D DENOMINATOR. S U B R O U T I N E L I N F I T C A L C U L A T E S THE B E S T FIT LINEAR R E G R E S S I O N AND C A L C U L A T E S THE S T A T I S T I C S OF THE FIT. THE S T A T I S T I C S INCLUDE C O N F I D E N C E L I M I T S ON THE ~ 3 S I T I O N OF THE L I N E A R R E G R E S S I O N AND V A R I A N C E S ON THE E S T I M A T E D SLOPE AND Y-INTERCEPT. THE C R I T I C A L S T U D E N T ' S T S T A T I S T I C IS C A L C U L A T E D USING THE IMSL S U B R O U T I N E MDSTI FOR A S P E C I F I C T O L E R A N C E L E V E L ( A ) W H I C H IS E N T E R E D AS 100*(I-A) %.

0.07 138.0 0.03 134.9

334

J . K . RL'ESELL

C C

DIMENSION

AND DATA STATEMENTS

DIMENSION O X I D E ( 1 3 ) , T R A C E ( 2 1 ) , W T M ( 1 3 , 1 2 ) ,WTT(21,12) ,ATPR(31,100) DIMENSION WOX(13),WTR(21),XON(13),TITLE(12),ELM(31) D I M E N S I O N TOT(12),TAT(12) C O F ~ O N /ANA/ N O S , N X V A R , N D ~ M , A T P R , S T O , P E R C CHARACTER OXIDE*5,TRACE*5, TITLE*B,ELM*2 CHARACTER NAME*50,ROM*8 DATA OXIDE/' SI02',' T I O 2 ' , ' A L 2 0 3 ' , ' F E 2 0 3 ' , *' FEO',' MNO',' MGO',' CAO', *' NA20',' K20',' P205',' H20+',' H 2 0 - ' / DATA TRACE/' NB ',' ZR ',' Y ',' SR ',' U ',' RB ', *' TH ',' PB ',' GA ',' ZN ',' CU ',' NI ',' CO ', *' CR ',' V ',' CE ',' ND ',' BA ',' LA ',' SC ',' S '/ ~ATA WOX/60.0848,79.8988,101.9612,159.6922,71.8464, "70.9174,40.3114,56.0794, "61.979G,94.2034,141.9446,2"18.01534/ DATA X O N / 2 * I . 0 , 2 * 2 . 0 , 4 * I . 0 , 5 * 2 . 0 / DATA W T R / 9 2 . 9 0 6 , 9 1 . 2 2 , 8 8 . 9 0 5 , 8 7 . 6 2 , 2 3 8 . 0 4 , 8 5 . 4 7 , 2 3 2 . 0 3 8 , ,207.19,69.72,65.37,63.54,58.71,58.933,51.996,50.942,140.12, "144.24,137.34,138.91,44.956,32.064/ DATA E L M / ' S I ' , ' T I ' , ' A L ' , ' F E ' , ' M N ' , ' M G ' , ' C A ' , ' N A ' , ' K ', *'P ','NB','ZR','Y ','SR','U ' , ' R B ' , ' T H ' , ' P B ' , ' G A ' , *'ZN' , ' C U ' , ' N I ' , ' C O ' , ' C R ' , ' V ' , ' C E ' , ' N D ' , ' B A ' , ' L A ' , ' S C ' , ' S ' / C C C

FORMAT 88 89 90 93 95 96 i00 102 191 190 2O0 202 204 205

STATEMENTS

FORMAT (F 6.3) FORMAT (I 3, A50) FO P~IAT (AS) FORMAT (2 ([2)) FORMAT('I',//,10X,'PROJECT LABEL:',2X,A50,//) F O R M A T ( 2 0 X , ' N O . OF SAMPLES=',5X,I3,//) FOItMAT (12F6.2,/,F6.2) F O R M A T (12F 6. I,/, 9F6. i) F O R M A T ( / , 2 0 X , ' M A J O R AND M I N O R E L E M E N T DATA (WT. %)',//) FORMAT (/, 5X, 'NAME: ' ,3X,12 (A8) ,//) FORMAT(5X,AS,3X,12(F6.2,2X) ) F O R M A T ( / / , 2 0 X , ' T R A C E E L E M E N T DATA (PPM) ',//) FOPMAT (5X,A5, 3X, 12 (F6. i, 2X) ) FORMAT (/, 3X,AS,3X, 12 (F6.3,2X)) NS =0 NOS=0 READ DATA S T A T E M E N T S READ(I,89) READ(I,93) READ(I,88)

C C C C C C C C C C C

NN,NAME NXVAR,NDEM PERC

C A L C U L A T E THE C R I T I C A L S T U D E N T ' S T S T A T I S T I C FOR THE E S T I M A T I O N OF C O N F I D E N C E LIMITS ON THE PARAMETERS D E S C R I B I N G THE LEAST SQUARES LINEAR REGRESSION. IMSL S U B R O U T I N E MDSTI USES REFERENCE: [IILL,G.W., 1970; A L G O R I T H M 396, S T U D E N T ' S V. 13, P. 619-620. DF=NN-2 AA=(100.-PERC)/100 CALL MDSTI(AA,DF,STO,99) CONTINUE NS=NS+I NOS=NOS+I NEND=I READ (I,90) T I T L E (NS} READ(I,100) (WTM(I,NS),I=I,13) TOT(NS) =0.0

T QUANTILES:

C.A.C.M.,

Pearce variation diagrams CALCULATE

C C

335

T O T A L S ON M A J O R AND M I N O R E L E M E N T S

DO 8 I=I,13 TOT (NS) I T O T (NS) +WTM (I ,NS) CONTINUE R E A D ( I , 1 0 2 ) (WTT(I,NS) ,I=i,21) NK=0 CALCULATE ATOMIC

I0

P R O P O R T I O N S OF ALL 31 E L E M E N T S

DO I0 K = I , 1 0 NKtNK+I IF(NK.EQ.4) T H E N FEO-WTM(4,NS)*0.899847 ATPR(4,NOS)=(FEO+WTM(5,NS))*XON(5)/WOX(5) NK-NK+I ELSE ATPR(K,~]OS)-WTM(NK,NS)*XON(NK)/WOX(NK) END IF CONTINUE MKmI0 TAT(NS)'0.0 DO 12 L-I,21 MK-MK+I TAT(NS)-TAT(NS)+ WTT(L,NS)/10000.

ATPR(MK,NOS).WTT(L,NS)/IOOOO./WTR(L) 12

C C C C C

CONTINUE IF (NS.EQ.12) T H E N NEND=0 GO TO 55 ELSE IF (NS.LT.NN) T H E N GOTO 1 ELSE IF (NS.EQ.NN) T H E N NEND~I END IF W R I T E T I T L E AND C A L C U L A T E D D A T A

55

60

62

9999 C C C C

W R I T E (9,95) N A M E WRITE (9,96) NN W R I T E (9,191) WRITE(9,190) (TITLE(J),JaI,NS) DO 60 I=I,13 WRITE(9,200) O X I D E ( I ) , (WTM(I,J) ,J=I,NS) WRITE(9,200) 'TOTAL', (TOT(J) ,J~I,NS) WRITE (9,202) DO 62 J=l,21 WRITE(9,204) TRACE(J), (WTT(J,K) ,K=I,NS) CONTI~,3E WRITE(9,205) 'TOT WT % ' , ( T A T ( J ) , J = I , N S ) NS =0 NN=NN-12 IF (NEND.EQ.0) GO TO 1 CONTINUE END I N I T I A L C A L C U L A T I O N S AND C A L L S U B R O U T I N E FOR S U B S E Q U E N T L E A S T S Q U A R E A N A L Y S I S

LINFIT

CALl, L I N F I T STOP END SUBROUTINE LINFIT C C C C C C

P R O G R A M L I N F I T C A L C U L A T E S A L I N E A R R E G R E S S I O N THRU LEAST SQUARES A N A L Y S I S ON D A T A S U B M I T T E D THRU T H E CDC P R O G R A M PEARCE. THE L E A S T S Q U A R E S P R O G R A M M I N I M I Z E S THE F U N C T I O N : D ( X , Y ) - ( X O - X I ) * * 2 + (YO-YI)**2

C

REF: Y O R K , 1 9 6 6 ;

C

CAN J. P H Y S , 4 4 , P . 1 0 7 9

J. K. RUSSELL

336 C C C C C C

CONFIDE::CE LIMITS AND V A R I A N C E S ON SLOPE AND I N T E R C E P T E S T I M A T E S ARE C A L C U L A T E D . AS W E L L THIS PROGRAM C A L C U L A T E S C O N F I D E N C E LIMITS ON THE L O C A T I O N OF THE R E G R E S S I O N LINE A S S U N I N G THE DATA POINTS ARE W E I G H T E D EQUALLY. DIMENSION FRAT(31,100},A(100,2),UX(100),VY(100) DIMENSION PAR(2),HEAD(6),ERR(5),ELM(31) DIMENSION X(100),Y(100),XC(100),YC(100),SY(100),VARY(100) COMMON /ANA/ NN,NXUM,NDEM,FRAT,STO,PERC f~qARACTER N A M E * 6 4 , H E A D * I 5 , P A R * I 0 , E R R * 3 0 , E L M * 2 D A T A E L M / ' S I ' , ' T I ' , ' A L ' , ' F E ' , ' M N ' , ' M G ' , ' C A ' , ' N A ' , ' K ', *'P ' , ' N B ' , ' Z R ' , ' Y ' , ' S R ' , ' U ' , ' R B ' , ' T H ' , ' P B ' , ' G A ' , *'ZN' ,'CU','NI','CO' 'CR','V ','CE' ,'ND','BA' ,'LA' ,'SC' ,'S'/ D A T A P A R / ' Y - I N T (B) I,'SLOPE (M) '/ DATA HEAD/'X - VARIABLE ','Y - V A R I A B L E ' , ' " Y " - C A L C ', +' X (OBS) -X (C) ', 'Y (OBS)-Y (C) ', 'C.L. Y'/ D A T A E R R / ' T O T A L SUM OF S Q U A R E S ' , ' S Q U A R E S ON R E G R E S S I O N ' , *'RESIDUAL SQUARES ',' (SOR/TSS) X&Y :', *'PEARSON MOMENT (R-SQUARED):'/

C C C i000 ii00 1200 1300 I010

FORMAT STATEMENTS F O R M A T ( 2 5 X , ' N O S . OF D A T A P O I N T S = ',I4) FORMAT(/,10X,SX,AI2,SX,AI2) FORMAT(2X,A8,SX,FI0.6,7X,FI0.6) FO~AT(F5.2,A5,SX,FI0.6,7X,FI0.6) FORMAT(////,'*************************************************

************************************

F O R M A T ( 1 5 X , ' P A R A M E T E R S FOR L I N E A R E Q U A T I O N (Y = MX + B)') 1020 FORMAT(//,IOX,A2,'/',A2,1OX,A2,'/',A2,/) 5000 FORMAT(AIS,AI4,SX,AI3,AI3,AII,2X,AII,/) 6000 FORMAT(FI0.5,4X,FI0.5,8X,FI0.5,5X,F8.5,4X,F8.5,SX,FS.5) 6100 6900 FORMAT(/////) FORMAT(A30,7X,AI3,2X,AI0) 6950 FORMAT(5X,A30,2X,2(FI3.6)) 7000 C C C A L C U L A T E THE RATIOS R E Q U I R E D FOR THE G E N E R A T I O N C C OF THE X-Y D A T A T H A T W I L L BE L E A S T SQUARED. THE D E N O M I N A T O R S (NDEM) AND THE X- N U M E R A T O R (NXUM) ARE S P E C I F I E D F R O M P R O G R A M C C PEARCE. C DO 77 K I - I , 3 1 I F ( K I . E Q . N X U M ) THEN GO TO 999 ELSE I F ( K I . E Q . N D E M ) T H E N GO TO 999 ELSE NYUM=KI END IF DO 13 M = I , N N DO 15 J = 1 , 2 IF(J.EQ.I) T H E N LfNXUM ELSE L=NYUM END IF

A (M,J) =FRAT (L,M) /FRAT (NDEM,M) 15 13 C C C

CONTINUE CONTINUE I N I T I A L I Z E C O N S T A N T S AND C A L C U L A T E XTOT=YTOT=X2=UX2=VY2=UV=TN=0.0 DO 19 I=I,NN XTOT=XTOT+A(I,I) YTOT=YTOT+A(I,2)

XAV A N D YAV

Pearce variation diagrams 19

C C C

21 C C C

CONTINUE IF (YTOT.EQ. 0.0) GO TO 9 9 9 ELSE END IF XAV=XTOT/NN YAV=YTGT/NN CALCULATE

THEN

REQUIRED

SUMS

DO 21 I=I,NN UX (1) =A (I, I) -XAV VY (1) =A(I ,2)-YAV X2=X2+A(I,I)**2 UX2=UX2+UX(1)**2 VY2=VY2+VY(I)**2 UV=UV+UX(I)*VY(1) CONTINUE CALCULATE

VARIANCE

ON X AND Y

VARX - U X 2 / ( N N - I ) V A R R Y = VY2/(NN-I) SIGX = SQRT(VARX) SIGY ~ SQRT(VARRY) PERS=UV/SQRT(UX2~VY2) PERSON " PERS**2 TSX=UX2 TSY~VY2 IF(VY2.EQ.0.0) T H E N GO TO 9 9 9 ELSE END IF

C C C

CALCULATE

SLOPE

AND

INTERCEPT

TOP=VY2-UX2 ARG=(VY2-UX2)**2 + 4.*UV**2 T O P = S Q R T ( A R G ) + TOP BB=TOP/(2*UV) AINT=YAV-BB~XAV C C C C

16

C C C

CALCULATE VARIANCES D. YORK, 1966

ON S L O P E

AND

INTERCEPT

ZZ=((I.-PERSON)/NN)**0.5 ZZ=BB*ZZ/PERS TSSL=3.0*(ZZ) VARIN = (SIGY-S[GX*BB)**2 VARIN = VARIN/NN SUB= ( X A V * B B * ( I . + P E R S ) / P E R S O N + 2*SIGX*SIGY) VARIN = VARIN + (I.-PERS)*BB*SUB VARIN = SQRT((VARIN**2)) TSIN=3.0*SQRT(VARIN) SS~=SSX=0.0 DO 16 I=I,NN XC(I)=(A(I,I) ~BB*A(I,2)-BB*AINT)/(I. + BB**2) yC(1)=BB~XC(1) + AINT SSR=SSR+(YC(I)-YAV)*~2 SSX=SSX+(XC([)-XAV)**2 CONTINUE RESX=TSX-SSX RESY=TSY-SSR RX=(SSX/TSX) RY=(SSR/TSY) CONFIDENCE

LIMITS

CLSL=STO*TSSL/3.0 CLIN=STO*TSIN/3.0

ON S L O P E

AND I N T E R C E P T

337

338

J . K . Russ~u.

C A L C U L A T E VARIANCE ON Y AND CONF.

18

C C C

LMTS.

SYX * (VY2-SSR)/(NN-2) DO 18 I=I,NN VARY (I) =SYX* ( (I./NN)+ ( (XC (I)-XAV) **2)/UX2) TVY=SQRT (VARY (I) ) SY(I)=STO*TVY CONTINUE

W R I T E HEADERS FOR REGRESSION WRITE (9, i010) W R I T E [9,1020) WRITE (9,1000) WRITE (9, II00) WRITE (9,1200) WRITE(9,1200) WRITE(9,1300)

C C C

NN "SLOPE :","INTERCEPT " "ESTIMATE" ,BB, AINT "3 S.D. ",TSSL,TSIN PERC,' C.L.', CLSL , CLIN

WRITE OBSERVED DATA VERSUS CALCULATED

620 C

VALUES

WRITE (9,5000) ELM(~XUM),ELM(NDEM) ,ELM(NYUM) ,ELM(NDEM) WRITE(9,6000) (HEAD(1) ,I=i,6) DO 620 I=I,NN DELX ,, (A(I,I)-XC(I)) DELY ,, (A(I,2)-YC(I)) WRITE(9,6100) A(I,I) ,A(I,2),YC(I),DELX,DELY,SY(I) CONT I NU E

WRITE(9,6900) WHITE(9,6950) 'STATISTICS ON LEAST SQUARES','X-VARIABLE', *'Y-VARIABLE' WRITE(9,7000) ERR(1),TSX,TSY WRITE (9,7000} ERR(2),SSX,SSR W R I T E (9,7000) ERR(3),RESX,RESY WRITE (9,7000) ERR(4),RX,RY W R I T E (9,7000) ERR(5),PERSON 999 CONTINUE 77 CONTINUE RETURN END

Suggest Documents