on sampling nonstationary spatial autocorrelated data

20
Computee~ & Geo,,'wm'e~ Vol. 14. No 5. pp ~.~'-686, 1988 0098-3004 88 $3.00 + 0.00 Pnnted m Great Brltatn Pergamon Press pie ON SAMPLING NONSTATIONARY SPATIAL AUTOCORRELATED DATA EVANGELOS A. YFANTIS ~ and GEORGE T. FLATMAN: ~University of Nevada. Las Vegas• NV 89154 and :U.S. Environmental Protection Agency, Environmental Monitoring Systems Laborator,,. Las Vegas, NV 89114. U.S.A. (Received 8 September 1987; accepted 27 January 1988) Abstract--Sampling dependent random variables constituting a nonstationary spatial two-dimensional random process due to the presence of drift is a ditficult problem consisting of determining the optimum sampling design and sampling density or number of samples, in order for one to attain a desirable precision as it is expressed by the Mean Square Error (MSE). The complexity of the problem prevents the develop- ment of a closed form solution expressing the number of samples needed to attain a given precision. Thus a user friendly FORTRAN program solving this problem for the situation of spherical semivariogram, the equilateral, square and hexagon designs, and no drift, linear, and quadratic, is given. Key II'ord~: FORTRAN, Geostatistics. Intrinsic hypothesis. Regionalized variables, Sampling. Spherical semivariogram INTRODUCTION Classical st~itistical techniques are based on the assumption of independence of data, thus they are not appropriate for analysis of spatially dependent or autocorrelatcd data where neighboring points tend to havc similar characteristics expressed mathematically via the semivariogram or the autocorrelation func- tion. Statistical techniques appropriate for analysis and point estimation of spatial data are given by time-series analysis (Box and Jenkins, 1976; Borg- man, 1973) and geostatistics (Journel and Huijbregts, 1978: David. 1977; Olea, 1975)• Although some work has been done in the area of optimum sampling in geostatistics (Olea, 1984; McBratney, Webster, and Burgess, 1981). our study includes more refined re- sults, the theoretical details of which are given in Yfantis, Flatman, and Behar (1987) and Yfantis and Miller (1985)• This study is based on the assumptions of either no drift, or first-order drift, or second-order drift, and second-order stationary residuals• The semivariogram under consideration is the spherical one. although the program could be changed to ac- cept another semivariogram by ch:mging the semi- variogram subroutine from spherical to what is de- sired. The sampling designs considered are the tri- angle• square, and hexagon• SOME BACK(;ROUND INFORMATION A summary of some theoretical results and the theory leading to the development of the algorithm, presented in Yfantis. Flatman, and Behar (1987) and Yfantis and Miller (1985) is given. Let Z(x) be a random function with drift re(x) K E(Z[x]) = re(x) = ~ b,f(x), x~R".fo(x) = I i-o (I) 667 and the residuals Y(x) = Z(x) - re(x) satisfy the second-order stationarity condition with ntean 0 and scmivariogram 7(h). Given a network of points .x'~.x: ...... v,,. usually fornmlg a systematic sampling design, with known concentration or ore grade, let Z*(xo) be the point estimate of the true concentration Z(x°) at the point .x., then E[Z*(xo)] = m(Xo)..~',,~ R" and o" = - zc,o)j: -- - f. °, °, l*l I--I 7(x,- x,) + 2Za, 7(x,- Xo) (2) I-I or a~ = Ar B (3) .,. i -- I. 2 .... n. is the solution to the system of equation GA = B (4) (Olea, 1984; Journel and Huijbregts. 1978) where a2 u3 A = a. t. o AI . i'm° "'/(xj - x.)" ~(x: - x,) ,'(x~ - .% B = ~'(x.- xo) f,(xo) f:(xo) f,,(x0)

Upload: evangelos-a-yfantis

Post on 26-Aug-2016

215 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: On sampling nonstationary spatial autocorrelated data

Computee~ & Geo,,'wm'e~ Vol. 14. No 5. pp ~.~'-686, 1988 0098-3004 88 $3.00 + 0.00 Pnnted m Great Brltatn Pergamon Press pie

ON SAMPLING NONSTATIONARY SPATIAL AUTOCORRELATED DATA

EVANGELOS A. YFANTIS ~ and GEORGE T. FLATMAN:

~University of Nevada. Las Vegas• NV 89154 and :U.S. Environmental Protection Agency, Environmental Monitoring Systems Laborator,,. Las Vegas, NV 89114. U.S.A.

(Received 8 September 1987; accepted 27 January 1988)

Abstract--Sampling dependent random variables constituting a nonstationary spatial two-dimensional random process due to the presence of drift is a ditficult problem consisting of determining the optimum sampling design and sampling density or number of samples, in order for one to attain a desirable precision as it is expressed by the Mean Square Error (MSE). The complexity of the problem prevents the develop- ment of a closed form solution expressing the number of samples needed to attain a given precision. Thus a user friendly FORTRAN program solving this problem for the situation of spherical semivariogram, the equilateral, square and hexagon designs, and no drift, linear, and quadratic, is given.

Key II'ord~: FORTRAN, Geostatistics. Intrinsic hypothesis. Regionalized variables, Sampling. Spherical semivariogram

INTRODUCTION

Classical st~itistical techniques are based on the assumption of independence of data, thus they are not appropriate for analysis of spatially dependent or autocorrelatcd data where neighboring points tend to havc similar characteristics expressed mathematically via the semivariogram or the autocorrelation func- tion. Statistical techniques appropriate for analysis and point estimation of spatial data are given by time-series analysis (Box and Jenkins, 1976; Borg- man, 1973) and geostatistics (Journel and Huijbregts, 1978: David. 1977; Olea, 1975)• Although some work has been done in the area of optimum sampling in geostatistics (Olea, 1984; McBratney, Webster, and Burgess, 1981). our study includes more refined re- sults, the theoretical details of which are given in Yfantis, Flatman, and Behar (1987) and Yfantis and Miller (1985)• This study is based on the assumptions of either no drift, or first-order drift, or second-order drift, and second-order stationary residuals• The semivariogram under consideration is the spherical one. although the program could be changed to ac- cept another semivariogram by ch:mging the semi- variogram subroutine from spherical to what is de- sired. The sampling designs considered are the tri- angle• square, and hexagon•

SOME BACK(;ROUND INFORMATION

A summary of some theoretical results and the theory leading to the development of the algorithm, presented in Yfantis. Flatman, and Behar (1987) and Yfantis and Miller (1985) is given. Let Z(x) be a random function with drift re(x)

K

E(Z[x]) = re(x) = ~ b , f ( x ) , x ~ R " . f o ( x ) = I i - o

(I) 667

and the residuals Y(x) = Z(x) - re(x) satisfy the second-order stationarity condition with ntean 0 and scmivariogram 7(h).

Given a network of points .x'~. x: . . . . . . v,,. usually fornmlg a systematic sampling design, with known concentration or ore grade, let Z*(xo) be the point estimate of the true concentration Z(x°) at the point .x., then

E[Z*(xo)] = m(Xo)..~',,~ R"

and

o" = - z c , o ) j : - - - f . °, °, l * l I - - I

7(x , - x,) + 2 Z a , 7 (x , - Xo) (2) I - I

or

a~ = A r B (3)

. , . i -- I. 2 . . . . n. is the solution to the system of equation

GA = B (4)

(Olea, 1984; Journel and Huijbregts. 1978) where

a2

u3

A = a.

t . o

AI

. i ' m °

" ' / (x j - x . ) "

~ (x : - x , )

,'(x~ - .%

B = ~ ' ( x . - xo)

f,(xo)

f:(xo)

f,,(x0)

Page 2: On sampling nonstationary spatial autocorrelated data

668

and

G =

0 7(x~ - x:)

7(x~ - x : ) 0

E. A. YFANTIS and G. T. FLATMAN

7 ( x , - x )

7(x: - xj)

7(x. - x, ) ;.'(x. - x:) 7(x. - x3 )

I I I

f~(xL) f~(x:) fl<x,)

f : ( x I ) f : (x : ) f : (x))

f . . (x l ) fro(x:)

71 x! - x . ]

?'tx: - x . )

_~ 1.', )

.l; (x: )

LAx,)

f : lx: )

0 I f~(x.) f . ( x . )

I 0 0 0

I] ( .v . ) 0 0 0

t i lx .) 0 0 0

0 0 f..(x~) , . f . (x . ) 0

• • • C ( x , )

• • - L , ( x : )

• • L , ( x . )

. . . 0

0

0

The proofs for the following theorems I-3 are given in Yfantis. Flatman. and Behar (1987) and the proof for theorem 4 is given in Yfantis and Miller (1985).

A typical semivariogram with nugget effect co i> 0. range r. and sill a: of a process satisfying the intrinsic hypothesis can be written in the form

{ ~'~ + e l f ( h ) . 0 < h <~ r

7(h) = co + q f ( r ) = 0.". h > r (5)

0, h = 0

where co i> andc~ > O and r is the range. Theorems I-3 pertain to stationary random

processes.

T h e o r e m I

If the semivariogram is of the form given by Equa- tion (5), the maximum mean square error for the situation o f a square design is

0.~ = I [", + , ' , f(r) l = 1 tr"

a n d is attained when side a of the square or distance between successive samples is a = ~ r; for the equi- lateral triangle design the maximum mean square error is

0.~ = ] [c 0 + c,f(r)] = t 0.2

and is attained when the side a = ~ r; and for the regular hexagon design the maximum mean square error is

~q = ~ [,'0 + ,',.t'(r)l = "~ 0."

and is attained when side a = r where r is the range.

Theorem 2 i f two second-order stationary processes have the

same range r, semivariograms of the form expressed by Equation (5) with constants ca and c~ for the first and c0, c;, for the second, and

co c~ . . . . S (6) c;, ,'[

then

0.2 = S ¢.).-

and. for any sampling design,

0.? S

rr'~

for every side length a ~< r and coelticicnts a,, i = 1, 2 . . . . . n of Equation (4) are the same.

Tht,or(,l?l 3 If the semivariogram is o f the form given by Equa-

tion (5), the MSE converges to

n + I n + I - - C o ---- ~ 0 " 2 ,

R n

as c~ - . 0. where n is the number of points within the range or with distance ~< r from the point to be esti- mated.

Th~.or~n! 4 If the sampling design is systematic consisting of

squares or equilateral triangles or regular hexagons. and .% is a point, in the center of a square or triangle or hexagon. Let Z(x,j) be the true concentration at xo and

Z*(x,,) = Z a,Z(x,) (7) t - I

be an estimate of Z(x0) based on the points .v~, x:, . . . . . ~:. which are within the zone o f influence or range from x,~. I fZ(x) is a process with linear drift and residuals stationary then the coefficients a,. i = I. 2, . . . . n obtained under the assumption of no drift are the same as the coefficients obtained under the assumption o f linear drift. That implies if one is to estimate Z(x) at points locating in the center o f the design in the presence of linear drift then the kriging estimate Z * ( x o ) and mean square error

Page 3: On sampling nonstationary spatial autocorrelated data

Sampling nonstationary spatial autocorrelated data

2 3 5 0 -

669

1 9 S B -

0 1 5 6 7 - . J

| 1175- ~n

78 9 -

39 2-

~ - - . . _ _ _ _ _ : - . . . . . . . . . . , - : . . . . . . . . . . . . . . c 2 o c, I io

~ - , ~ . ~ " ' - " - - ~ - - C 40 C . SO

\ ~ ~ ~ ~ C QO C, 40

" " - - . . . . . . C IlO C, ZO

C 100 C, 0

O O

000 3175 750 11125 lslo0 18175 2 2 1 5 0 Z 6 ! 2 5 30100

S i m p l e S i z e

Figure I..)'-axis is mean square error for square design: x-axis is sample size and is expressed in units of number of samples required by square grid whose side is equal to range of correlation. Family of curves is based on spherical semivariograms with different values of nugget and structural variances expressed as

percentages of total variance.

,~[ = / : I Z * ( x , , ) - Z ( x , , ) ] :

do not depend on the linear drift. The spherical scmivariogram with (') + c,) - I00

and (') ranging between 10 and 100 was input to the FORTRAN progr:lm given in the Appendix. The range r used was I00. The field o f interest was I0,000 x I0,000. Figures I - 6 show the changc of the MSE as a function of the sampling design, nugget effect, and sampling density. The x-axis is the sam- pling density. The unit in the x- axis is the number of samples nccdcd to cover the space under consider- ation with sqttarcs of side length equal to the range

r = 100. The .)'-axis is the MSE. From Figures I-6 one could see that the MSE is proportional to the nugget effect proportional to the drift, depends on the sitmpling design and the sampling density. As can be seen from Figures I-6 there is a cutoff point beyond which increasing the sampling density has little effect in reducing the MSE. As the sampling density gets smaller or the sampling distance gets larger and there is no drift, the MSE for a specific sampling design increases and it converges to a point as expected by theorem I. Also as ct -', 0 the MSE converges to ~ as expected by theorem 3.

UJ

O"

C

:E

2 3 5 0

) 9 5 8 t

1 5 6 7

117S-

78 9-

3 9 2 -

L ~ ' t ' ~ - - " i , ~ . , ~ ' -~ - - - : _ ~ . . . . . . . . . . . . . . . . . . . . . . c lo c. jo c

~ ~ C40 C IkO

\ " . C I O C . 4 0 \

" " " - . . . . . . . . C I 0 C . 2 0 ,~ - . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . C._,O0 C;. 0

oo ) 7SSO ) w 1 m I 30100 0 0 0 3 7 5 1 1 2 5 I S O 0 1 8 7 5 2 2 5 0 2 6 2 5

S a m p l e S i z e

20 C . I 0

Figure 2. y-axis is mean square error for triangular design; x-axis is sample size and is expressed in units or number of samples required by ~uare grid whose side is equal to range of correlation. Family of curves is based on spherical semivariograms with different values of nugget and structural variances expressed as

percentages of total variance.

Page 4: On sampling nonstationary spatial autocorrelated data

670 E . A . YFANTIS and G. T. FLATMAN

23S 0 -

1 9 S 8 -

156 7 - 0

UJ @

e l 1 1 7 S -

O" (n e-

78 9

39 2

, " . . . . _ . . . . . . . . . . c 2 _o _c-~..'..°_ ~ \ ~ - c 2o c, ~o

_ ~ 4 o C. 60

N - . ~, - " " - - . _ C 8 0 C~, 20

~ - - cioo c•o

o o 0 oo 3 75 7w50 11~25 15100 18 75 22 so 26 '25 30 '00

S a m p l e S i z e

Figure 3. y-axis is mean square error for hexagonal design; x-axis is sample size and is expressed in units of number of samples required by square grid whose side is equal to range of correlation. Family ofcurves is based on spherical semivariograms with different values of nugget and structural variances expressed as

percentages of total variance.

FORTRAN PROGRAM TO FACII,ITATE SAMI'I,IN(;

The program consists of the main program and nine subroutines. The progrant was run on a CDC CYBI-R 172 machine. Subroutine MASTER is to • 'tdjust the dimensions of the arrays and calls sub- routines S | ' i l E R which creates the Arrays B and G based on the spheric:tl scmivariogram and the appro- priate drift. Subroutines GAUSS and SOLVE do the Gaussian elimination ,'md solve Equation (4). Sub- routine MSER calculates the mean square error at the

center of gravity of the design (nlaximum MSE). Sub- routine SAMPLE creates a square grid covering the space under considenttion disregarding borderline ef- fects. Subroutine S AM P LET creates an equilateral triangle grid covering the space disrega, rding border- line effects. St, broutine SAMPLEX creates a hex- agonal grid covering the sp;,ce under consideration with a grid consisting of regular hex:tgons disregard- ing borderline ell'cots.

The program is menu driven and asks the user to input (I) the desired sampling design, selection of

230 O-

UJ

c r (n

oJ

191 7 -

153 3 -

, , s o - ° c o . o

Co I10

~ , ~ . . . . . . . . . . . . c , o c o . o 7e 7 . . . . . . . . . . . . . . . . . .

• ~ ~ c e o c o 40

- - . . . . c I 0 co 20 6

4

38 3- " ~ . . . . . . . . . . . . . . . .

~ - ~ - c lOO c o o

O 0 0 0 0 3176 7160 11125 16r00 18175 22 ;S0 26 !26 30100

S a m p l e S i z e

Figure 4. y-axis is mean square error for square design and quadrat ic dr i f t ; x-axis is sample size and is expressed in units of number of'samples required by square grid whose side is equa[ to range ofcorre]ation. Family of curves is based on spherical semivariograms with different values of nugget and structural

variances expressed as percentages of total variance.

Page 5: On sampling nonstationary spatial autocorrelated data

Sampling nonstationary spatial autocorrelated data

2 3 0 0 -

671

UJ

en

191 7 -

153 3 -

1 1 S 0 -

70 7-

38 3-

O0 0OO

" . . ~ .................... .__c:,_o. c.:,_, • . . . . . . . .

~ ' - . . .° . : ~ ~ ~ ~ ~ ~ C-IO Co~40

" " " " - - - . . . . . C~llO Co'20

¢~100 Co'O

~1!75 7T60 111.2E 161.00 111'76 22150 261.2§ 301.00

S a m p l e S i ze

Figure 5..v-axis is mean square error for triangular design and quadratic drift; x-axis is sample size and is expressed in units of number of samples required by square grid whose side is equal to range of correkltion Family of curves is based on spherical semivariograms with different values of nugget and

structural v;,riances expressed as percentages of total variance.

three designs are given, namely the square, the trian- gular, and the hexagon. (2) The desired drift, 0 for no drift, I for linear drift, and 2 for quadratic. (3) The range. (4) I f a table of values of mean square errors or a single value is to be calculated (0 for a table, I for a single value). I f a single value of the MSE is to be calculated then the program asks for the sampling dist:mce, and the c, and c~ of the spherical semivario- gram. For the square design the sampling distance

should bc Icss than rv/2., for thc triangular dcsign should be less than r,v~. and for the hexagonal design should be less than r. Thc output gives the number of known points used for thc estimation of Z(x0), the side Icngth, and the mean square error for thc given c~ and c. values. Table I shows a session where the user requests the calculation of the MSE for specific sam- pling distancc. I f the sampling distance inputed is not small enough to provide enough data for the estima-

230 0 -

UJ

cr U)

Q

191 7 -

t 63 3-

1 1 6 0 -

?6 ?"

38 3 -

0 0 ' " 0 0 0

~ C . ' l O C, .ilO

. . . . . . . . . . . . . .~:,.o....~:;o_. ~ ---.. ~ C eO C,'40

• % ~ " * . C ' lO Ce 20 ~-. " o . . . . o . . . . . .

C+100 CeO

3 '7s 7~so 11 ~2s 1 s 'oo 1 s!7s 22!s0 2e!2s 30~00

S a m p l e S i ze

Figure 6. ;'-axis is mean square error for hexagonal design and quadratic drift; x-axis is sample size and is expressed in units of number of samples required by square grid whose side is equal to range of correlation. Family of curves is based on spherical scmivariograms with different values of nugget and

structural variances expressed as percentages of total variance.

Page 6: On sampling nonstationary spatial autocorrelated data

Table I. Examples sho~ing how to run program

/REWIND,* 6 FILES PROCESSED.

/FTN5,I-SAMPLE4,L-0 5.487 CP SECONDS COMPILATION TIME.

/LGO

? 1

? 1

INPUT THE DESIGN DESIRED (INPUT 1 FOR SQUARE, 2 FOR TRIANGULAR, 3 FOR HEXAGON)

INPUT THE DRIFT DESIRED, 0 FOR NO DRIFT i FOR LINEAR AND 2 FOR QUADRATIC DRIFT

INPUT THE RANGE ? I00

INPUT THE Cl, AND CO OF THE SPHERICAL SEMIVARIOGRAM ? 60,20

THE DRIFT IS LINEAR DO YOU LIKE TO SEE THE MEAN SQUARE ERROR FOR ONE VALUE OF THE SAMPLING DISTANCE OR FOR A TABLE OF SAMPLING DISTANCES. TYPE 0 FOR THE ONE VALUE, OR 1 FOR THE TABLE

? 0 THE DESIRED DESIGN IS THE SQUARE

INPUT THE SAMPLING DISTANCE FOR NO DRIFT OR LINEAR DRIFT THE SAMPLING DISTANCE SHOULD BE LESS THAN 114. AND GRATER THAN 20.0

? 40

THE SPECIFIED SEMIVARIOGRAM IS THE SPHERICAL WITH CI-60.00 C0-20.00 THE RANGE IS I00.00 THE VARIANCE IS 80.00

NO. OF DATA WITHIN SIDE LENGTH MEAN SQUARE ERROR

16 40.00 45.99

/LGO

? 2

? 2

0.387 CP SECONDS EXECUTION TIME.

INPUT THE DESIGN DESIRED (INPUT I FOR SQUARE, 2 FOR TRIANGULAR, 3 FOR HEXAGON)

INPUT THE DRIFT DESIRED, 0 FOR NO DRIFT 1 FOR LINEAR AND 2 FOR QUDRATIC DRIFT

INPUT THE RANGE ? 200

INPUT THE Cl, AND C0 OF THE SPHERICAL SEMIVARIOGRAM ? 60,40

THE DRIFT IS QUADRATIC DO YOU LIKE TO SEE THE MEAN SQUARE ERROR FOR ONE VALUE OF THE SAMPLING DISTANCE OR FOR A TABLE OF SAMPLING DISTANCES. TYPE 0 FOR THE ONE VALUE, OR 1 FOR THE TABLE

THE DESIRED DESIGN IS THE TRIANGULAR DO YOU LIKE THE DEFAULT TABLE WHICH STARTS WITH SAMPLE DISTANCE EQUAL TO 168.0000 AND DECREASES BY 8.0000 IN EVERY STEP UNTIL THE LOWEST VALUE IS 40.0000

TYPE I IF YES 0 OTHERWISE 71

THE SPECIFIED SEMIVARIOGRAM IS THE SPHERICAL WITH CI- 60.00 CO- 40.00 THE RANGE IS 200.00 THE VARIANCE IS I00.00 ccmlinucd

Page 7: On sampling nonstationary spatial autocorrelated data

Table l--continued

NO. OF DATA WITHIN SIDE LENGTH MEAN SQUARE ERROR

6 1 6 8 . 0 0 1 1 1 . 5 8 6 1 6 0 . 0 0 1 0 8 . 2 6 6 1 5 2 . 0 0 1 0 5 . 2 0 6 1 4 4 . 0 0 1 0 2 . 3 8 6 1 3 6 . 0 0 9 9 . 7 9

12 1 2 8 . 0 0 8 6 . 4 6 12 1 2 0 . 0 0 8 3 . 9 2 12 1 1 2 . 0 0 8 1 . 6 4 12 104.00 79.57 18 96.00 73.86 18 88.00 71.19 21 80.00 68.24 27 7 2 . 0 0 6 5 . 5 6 36 6 4 . 0 0 6 3 . 0 3 48 56.00 60.57 69 48.00 58.19 90 4 0 . 0 0 5 5 . 8 2

/LGO

? 3

? 2

4 0 . 4 4 9 CP SECONDS EXECUTION TIME.

INPUT THE DESIGN DESIRED (INPUT 1 FOR SQUARE, 2 FOR TRIANGULAR, 3 FOR HEXAGON)

INPUT THE DRIFT DESIRED, 0 FOR NO DRIFT I FOR LINEAR AND 2 FOR QUADRATIC DRIFT

INPUT THE RANGE ? 200

INPUT THE CI, AND CO OF THE SPHERICAL SEMOVARIOGRAM ? 50,50

THE DRIFT IS QUADRATIC DO YOU LIKE TO SEE THE MEAN SQUARE ERROR FOR ONE VALUE OF THE SAMPLING DISTANCE OR FOR A TABLE OF SAMPLING DISTANCES. TYPE 0 FOR THE ONE VALUE, OR 1 FOR THE TABLE

? I

? 1

/LGO

THE DESIRED DESIGN IS THE HEXAGONAL

DO YOU LIKE THE DEFAULT TABLE WHICH STARS WITH SAMPLE DISTANCE EQUAL TO 112.0000 AND DECREASES BY 8.0000 IN EVERY STEP UNTIL THE LOWEST VALUE IS 40.000

TYPE i IF YES 0 OTHERWISE

THE SPECIFIED SEMIVARIOGRAN IS THE SPHERICAL WITH CI-50.00 C0-50.00 THE RANGE IS 200.00 THE VARIANCE IS I00.00

NO. OF DATA WITHIN SIDE LENGTH MEAN SQUARE ERROR

" ' " ' " " ' 8 . . . . " ' " " " " " ' " " ' " ' " " " 1 1 2 . o o 1 ; 5 ; ; ' " " ' " ' " " " 8 104.00 167.65

12 96.00 94.94 12 88.00 91.17 12 80.00 88.16 24 72.00 81.64 24 64.00 78.51 26 56.00 75.43 42 48.00 71.34 56 40.00 68.24

12.558 CP SECONDS EXECUTION TIME.

INPUT THE DESIGN DESIRED (INPUT I FOR SQUARE, 2 FOR TRIANGULAR, 3 FOR HEXAGON) continued overleaf

CAGRO 14:5-Z

Page 8: On sampling nonstationary spatial autocorrelated data

Table I--co.tmued

? 3 INPUT THE DRIFT DESIRED, 0 FOR NO DRIFT 1 FOR LINEAR AND 2 FOR QUADRATIC DRIFT

? 0 INPUT THE RANGE

? 200

INPUT THE CI, AND THE CO OF THE SPHERICAL SEMIVARIOGRAM ? 5 0 , 5 0

THERE IS NO DRIFT DO YOU LIKE TO SEE THE MEAN SQUARE ERROR FOR ONE VALUE OF THE SAMPLING DISTANCE OR FOR A TABLE OF SAMPLING DISTANCES. TYPE 0 FOR THE ONE VALUE, OR 1 FOR THE TABLE

? 1 THE DESIRED DESIGN IS THE HEXAGONAL

DO YOU LIKE THE DEFAULT TABLE WHICH STARTS WITH SAMPLE DISTANCE EQUAL TO 200.0000 AND DECREASES BY 8.0000 IN EVERY STEP UNTIL THE LOWEST VALUE IS 40.0000

TYPE i I F YES 0 OTHERWISE 71

THE SPECIFIED SENIVARIOGRAM IS THE SPHERICAL WITH CI-50.00 C0-50.00 THE RANGE IS 200.0 THE VARIANCE IS 100.00

NO. OF DATA WITHIN SIDE LENGTH MEAN SQUARE ERROR

4 6 6 6 6 6 6 6 6 6 6 8 8

12 12 12 24 24 26 42 56

200 00 1 2 3 . 7 0 192 00 1 1 6 . 4 7 184 00 1 1 5 . 8 9 176 00 1 1 4 . 9 4 168 00 1 1 3 . 6 4 160 00 1 1 2 . 0 0 152 O0 110.04 144 O0 107.78 136 00 105.23 128 O0 102.41 120 00 99.33 112 00 95.73 104 00 92.56 96 00 89.17 88 00 86.14 80 00 83.14 72 00 80.15 64 00 77.17 56 00 74.25 48 00 71.21 40 00 68.21

/LGO

? 2

? I

INPUT ? 150

INPUT ? 120,80

9.872 CP SECONDS'EXECUTION TIME.

INPUT THE DESIGN DESIRED (INPUT I FOR SQUARE, 2 FOR TRIANGULAR, 3 FOR HEXAGON}

INPUT THE DRIFT DESIRED, 0 FOR NO DRIFT 1 FOR LINEAR AND 2 FOR QUADRATIC DRIFT

THE RANGE

THE CI, AND THE CO OF THE SPHERICAL SEMIVARIOGRAM

THE DRIFT IS LINEAR DO YOU LIKE TO SEE THE MEAN SQUARE ERROR FOR ONE VALUE OF THE SAMPLING DISTANCE OR FOR A TABLE OF SAMPLING DISTANCES. TYPE 0 FOR THE ONE VALUE, OR 1 FOR THE TABLE contiuued

Page 9: On sampling nonstationary spatial autocorrelated data

Table I---continued

? 1

? 1

THE DESIRED DESIGN IS THE TRIANGULAR

DO YOU LIKE THE DEFAULT TABLE WHICH STARTS WITH SAMPLE DISTANCE EQUAL TO 259.8000 AND DECREASES BY 6 .0000 IN EVERY STEP UNTIL THE LOWEST VALUE IS 30.0000

TYPE I IF YES 0 OTHERWISE

THE SPECIFIED SEMIVARIOGRAM IS THE SPHERICAL WITH CI-120.00 C0=80.00 THE RANGE IS 150.00 THE VARIANCE IS 200.00

/LGO

? 2

? I

NO. OF DATA WITHIN SIDE LENGTH MEAN SQUARE ERROR a m m m e m m m ~ m m ~ m m m m ~ m m e ~ u w m m m m m m m m m m m m m m m m w m ~ m m m m m m m

3 253 80 266.67 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 6 6 6 6 6

12 12 12 12 12 18 21 27 30 42 54 78

253 80 266.48 247 80 265.91 241 80 264.98 235 80 263.69 229 80 262.05 223 80 260.07 217 80 257.76 211 80 255.13 205 80 2 5 2 . 1 9 199 80 248.94 193 80 245.40 187 80 241.57 181 80 237.46 175 80 233.08 169 80 228.45 163.80 223 56 157.80 218 43 151.80 213 07 145.80 207 58 139.80 202 23 133.80 197 02 127.80 185 93 121.80 182 O0 115.80 177 89 109.80 173 64 103.80 169 29 97.80 164 34 91.80 160 10 85.80 155 57 79.80 150 94 73.80 146 28 67.80 141 60 61.80 136 81 55.80 132 04 49.80 127 31 43.80 122 53 37.80 117 80 31.80 113 06

24.603 CP SECONDS EXECUTION TIME.

INPUT THE DESIGN DESIRED (INPUT 1 FOR SQUARE, 2 FOR TRIANGULAR, 3 FOR HEXAGON)

INPUT THE DRIFT DESIRED, 0 FOR NO DRIFT I FOR LINEAR AND 2 FOR QUADRATIC DRIFT

INPUT THE RANGE ? 100

INPUT THE Cl, AND CO OF THE SPHERICAL SEMIVARIOGRAM ? 50 ,70

THE DRIFT IS LINEAR DO YOU LIKE TO SEE THE MEAN SQUARE ERROR FOR ONE ('ontinuedoverlea[

Page 10: On sampling nonstationary spatial autocorrelated data

676 E, A. YF,~NTIS and G. T, FLArXla'~

Table I--continued

? 1

VALUE OF THE SAMPLING DISTANCE OR FOR A TABLE OF SAMPLING DISTANCES. TYPE 0 FOR THE ONE VALUE, OR 1 FOR THE TABLE

THE DESIRED DESIGN IS THE TRIANGULAR DO YOU LIKE THE DEFAULT TABLE WHICH STARTS WITH SAMPLE DISTANCE EQUAL TO 173.2000 AND DECREASES BY 4.0000 IN EVERY STEP UNTIL THE LOWEST VALUE IS 20.0000

TYPE i IF YES 0 OTHERWISE ? 0

INPUT THE MAXIMUM SAMPLING DISTANCE, THIS SHOULD BE LESS THAN OR EQUAL 173.2000

? 150

INPUT THE MINIMUM SAMPLING DISTANCE, THIS SHOULD BE GREATER THAN OR EQUAL TO 20.0000 ELSE YOU SHOULD INCREASE THE DIMENSION OF THE ARRAYS

? 50

THE SPECIFIED SEMIVARIOGRAM IS THE SPHERICAL WITH C1-50.00 C0-70.00 THE RANGE IS I00.00 THE VARIANCE IS 120.00

NO. OF DATA WITHIN SIDE LENGTH MEAN SQUARE ERROR

3 150.00 157 43 3 146 3 142 3 138 3 134 3 130 3 126 3 122 3 118 3 114 3 110 3 106 3 102 3 98 3 94 3 90 6 86 6 82 6 78 6 74 6 70 6 66

12 62 12 58 12 54 12 50

.00

.00

.00

.00

.00

.00

.00

.00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

1.298 CP SECONDS EXECUTION TIME. /BYE UN-CI53C62 LOG OFF 12.52.33 3SN-ACGG SRU-S- 153.214

156 49 155 42 154 22 152 89 151 44 149 87 148 18 146 38 144 47 142 46 140 34 138 12 135 83 133 59 131 41 121 90 120 45 118 88 117 21 115 43 113 57 II0 18 108.33 106.29 104.15

tion of the drift (in the situation of it drift), then the program issues a warning to the user that the sam- pling density needs to be increased by decreasing the sampling distance below a recommended value.

Ira table of MSE values is to be generated then the program gives two options. (i) The default calculates a table of MSE for various sampling densities starting with the smallest possible sampling density. Table I gives the MSE for all designs and for no drift and drift

for this default situation. (ii) In this option the user is asked to specify the co and c,. as v, ell as the lower sampling density, the higher sampling density, and the step or increment of the sampling density. Those should be positive integers expressing distance bet- ~een samples, thus the larger the distance the smaller the sampling density. Table I gives examples of how this option is exercised.

Page 11: On sampling nonstationary spatial autocorrelated data

Sampling nonstationar) spatial autocorrelated data 677

,4c'kno~led~ments and notwe--Ahhough the research descri- bed in this article has been supported by the United States Environmental Protection Agency. it has not been subjected to Agency revie,~ and therel\~re does not reflect necessarily the viev, s of the Agency and no ot~cial endor~ment should be inferred. The authors would like to thank Mrs. Lillian Steele for her technical t),ping, and the Editor for his ~alu- able suggestions.

REFERENCES

Borgman, L. E.. 1973. Spectrum anal.vsi~ of random data: Univ. Wyoming Pres~. Laramie, W,,oming. 392 p.

Box, G., and Jenkins, G. M.. 1976, Time ~ries anal)sis: Holden Day. San Francisco, California. 575 p.

David, M.. 1977. Geostatistical ore reserve e'~timation: El- sevier, Amsterdam. 364 p.

Journel. A. G . and Huijbregts. G. T . 1978. Mining geo- statistics: Academtc Press. London, 600 p.

McBratney. A. B, g'ebster. R., and Burgess. T. M.. 1981. The design of optimal sampling schemes for local estima- tion and mapping of regionalized variables--I: Com- puters & Geosciences. v. 7. no. 4. p. 331-334.

Olea. R. A . 19"75. Optimum mapping techniques using re- gionalized ~ariable theo~': Kansas Geol. Sur,,ey, 137p.

Olea, R. A., 1984. Systematic sampling of spatial functions: Kansas Geol. Sur',ey Series on Spatial Anal)sis, no. 7, 57p.

Yfantis, E. A . Flatman. G. T.. and Behar, J. V., 1987. EtlScienc,~ of kriging estimation for square, triangualar and hexagonal grids: Jour. Math. Geolog.,., ~. 19, no. 3. p 1S3-205.

Yfantis, E. A . and Miller. F. L.. 1985. Optimum sampling techniques in kriging: ASA Conference. August 5-8, lq,~5. La,~ Vegas. Nevada.

A P P E N D I X

Pro~r(tm Lislin.~

PROGRAM MSERROR(INPUT,OUTPUT,TAPES.INPUT,TAPE6.OUTPUT) C C C . . . . . . . . EXPLANATION OF THE VARIABLES USED . . . . . . . . C c C A IS THE VECTOR OF UNKNOWNS AND IS THE SAME AS THE C VECTOR A IN THE SYSTEM OF EQUATIONS G*A . B OF C THE TEXT. C ASD DENOTES THE SAMPLING DISTANCE FOR WHICH THE SEMIVARIOGRAM C ATTAINS ITS MAXIMUM VALUE UNDER EACH ONE OF THE SAMPLING C DESIGNS. C B IS THE VECTOR OF KNOVNS IN THE SYSTEM OF EQUATIONS G*A o B C GIVEN IN THE TEXT. C G IS THE MATRIX OF COEFFICIENTS CONSISTING OF SEHIVARIOGRAMS C AND VALUES OF THE FUNCTIONALS AT THE GIVEN SAMPLE POINTS. C THIS MATRIX IS THE SAME AS THE MATRIX G OF THE EQUATION C G*A - B OF THE TEXT. C H IS THE SAMPLING DISTANCE FOR WHICH THE USER DESIRES TO C CALCULATE THE HSE. IT USED ONLY WHEN THE USER WANTS TO C CALCULATE THE MSE FOR ONE SAMPLING DISTANC. C ID INDICATES THE SAMPLING DESIGN USED. ID • 1 IS FOR SQUARE C DESIGN, ID - 2 FOR TRIANGULAR, ID - 3 FOR HEXAGONAL. C I I S TAKES ON THE VALUES 0 (ZERO) OR | . IF I I S . I S ZERO THEN C THE MSE IS CALCULATED FOR ONE SAMPLING DISTANCE, IF C IIS IS 1 A TABLE OF MSE VALUES IS PRODUCED. C JD DENOTES THE DRIFT, AND TAKES ON THE VALUES O (ZERO) FOR C NO DRIFT, 1 FOR LINEAR DRIFT, AND 2 FOR QUADRATIC DRIFT. C JDP IS EQUAL TO JD * 1. C L,S,G1,B1 ARE WORK MATRICES. C NDM IS A PARAMETER CONTROLING THE DIMENSION OF THE ARRAYS. C R IS THE RANGE. C SIV,STEP,SFV ARE USED WHEN A TABLE OF MSE IS PRODUCED. C SIV IS THE START SAMPLING DISTANCE WHICH C DECREASES BY STEP EACH ITERATION UNTIL THE C FINAL VALUE SFV IS REACHED. C SL IS THE "SLOPE" AND IS THE SANE AS C1 OF THE FORMULA C CO÷CI*F(H) OF THE TEXT. C V IS THE VERTICAL SAMPLING DISTANCE. IN THIS IMPLEMENTATION C V - H (H IS THE HORIZONTAL SAMPLING DISTANCE). C X,Y ARE ARRAYS OF THE COORDINATES OF THE DATA WITHIN A ZONE C OF INFLUENCE FROM THE CENTER POINT XO,YO FOR WHICH THE C PROCESS Z(XO,YO) IS TO BE EVALUATED. C XF,YF ARE THE COORDINATES OF THE STARTING POINT USED BY C SUBROUTINES SAMPLE,SAMPLET, SAMPLEX, TO HAKE C SQUARE, TRIANGULAR, OR HEXAGONAL GRIDS. C YI IS THE NUGGET EFFECT CO. C C C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

C

Page 12: On sampling nonstationary spatial autocorrelated data

678 E.A. YFANTIS and G. T. FLATMAN

PARAMETER(NDM.100) DIMENSION X(NDM),Y(NDM),G(NDM,NDM),A(NDM),B(NDM),L(NDM),S(NDM)

DIMENSION GI(NDM,NDM),BI(NDM) VRITE(6,10)

lO FORMAT(/,5X,"INPUT THE DESIGN DESIRED", ./,SX,"(INPtVr I FOR SQUARE, 2 FOR TRIANGULAR, 3 FOR HEXAGON)") READ(5,*)ID VRITE(6,2)

2 FORMAT(/,5X,"INPUT THE DRIFT DESIRED, O FOR NO DRIFT", +/,SX,"l FOR LINEAR AND 2 FOR QUADRATIC DRIFT") READ(5,*)JD VRITE(6,20)

20 FORMAT(/,SX,"INPUT THE RANGE ") READ(5,*)R VRITE(6,60)

60 FORMAT(/,SX,"INPUT THE Cl, AND CO OF THE SPHERICAL SEMIVARIOGRAM") 80 READ(5,*)SL,YI

JDP = JD + I GO TO (85,90,95),JDP

85 VRITE(6,87) 87 FORMAT(SX,"THERE IS NO DRIFT")

GO TO 97 90 WRITE(6,92) 92 FORMAT(SX,"THE DRIFT IS LINEAR")

GOTO 97 95 VRITE(6,96) 96 FORMAT(SX,"THE DRIFT IS QUADRATIC") 97 VRITE(6,98)

98 FORMAT(SX,"DO YOU LIKE TO SEE THE MEAN SQUARE ERROR FOR ONE", +I,SX,"VALUE OF THE SAMPLING DISTANCE OR FOR A TABLE OF SAMPLING", +I,SX,"DISTANCE5. TYPE O FOR THE ONE VALUE, OR 1 ", */,SX,"FOR THE TABLE",//) READ(5,*)IIS GOTO (I00,120,140),ID

100 WRITE(6,11O) IlO FORMAT(/,SX,"THE DESIRED DESIGN IS THE SQUARE")

112 IF(JD .LE. 1)THEN ASD-I.1414*R IF(I IS .EQ. 1)THEN CALL TABLE(ID,JD,R,ASD,SIV,SFV,STEP) GO TO 158 ENDIF VRITE(6,114)ASD,O.2*R

114 FORMAT(/,SX,"INPUT THE SAMPLING DINSTANCE" ÷,/,SX,"FOR NO DRIFT OR LINEAR DRIFT THE SAMPLING" ÷,/,SX,"DINSTANCE SHOULD BE LESS THAN",GI2.3," AND GREATER THAN" ÷,G12.3) GO TO 117 ENDIF IF(JD .EQ. 2)THEN ASD.O.6*R IF( I IS .EQ. I)THEN CALL TABLE(ID,JD,R,ASD,SIV,SFV,STEP) GO TO 158 ENDIF ~;RITE(6,116)ASD,O.2*R

116 FORMAT(/,SX,"INPUT THE SAMPLING DISTANCE" +,/,SX,"FOR SQUARE DRIFT THE SAMPLING DISTANCE SHOULD" *,/,SX,"LESS THAN",GI2.3," AND GREATER THAN" +,G12.3) ENDIF

117 READ(5,*)H

IF(H .GT. ASD) THEN ~RITE(6,118)

118 FORMAT(/,SX,"THE SAMPLING DISTANCE IS TOO BIG PLEASE REDUCE" ÷ , / ,SX," IT TO BE VITHIN THE LIMITS RECOMMENDED BELLOV") GO TO 112 ENDIF GOTO 160

120 VRITE(6,13O) 130 FORMAT(/,SX,"THE DESIRED DESIGN IS THE TRIANGULAR")

132 IF(JD .LE. 1) THEN ASD-I.732*R IF(I IS .EO. I)THEN CALL TABLE(ID,JD,R,ASD,SIV,SFV,STEP) GO TO 158 ENDIF WRITE(6,114)ASD,O.2*R GO TO 134 ENDIF

Page 13: On sampling nonstationary spatial autocorrelated data

Sampling nonstationary spatial autocorrclated data

IF(JD .EQ. 2)THEN ASD-0.84*R I F ( I I S .EQ. 1) THEN CALL TABLE(ID,JD,R,ASD,SIV,SFV,STEP) GO TO 158 ENDIF VRITE(6,116)ASD,O.2*R ENDIF

134 READ(5,*)H IF(H .GT. ASD)THEN VRITE(6,118) GO TO 132 ENDIF GOTO 160

140 VRITE(6,150) 150 FORHAT(/,SX,"THE DESIRED DESIGN IS THE HEXAGONAL")

152 IF(JD .LE. I)THEN ASD-R IF(IIS .EQ. I)THEN CALL TABLE(ID,JD,R,ASD, SIV,SFV,STEP) GO TO 158 ENDIF VRITE(6,114)ASD,O.2*R GO TO 154 ENDIF IF(JD .EQ. 2)THEN ASD=O.56*R IF(IIS .EQ. 1)THEN CALL TABLE(ID,JD,R,ASD,SIV,SFV,STEP) GO TO 158 ENDIF I;RITE(6,116)ASD,O.2*R ENDIF

154 READ(5,*)H IF(H .GT. ASD) THEN WRITE(6,118) CO TO 152 ENDIF GO TO 160

158 H-SIV 160 SIGS • SL * YI

WRITE(6,180)SL,YI,R,SIGS 180 FORMAT(I,SX,"THE SPECIFIED SEHIVARIOGRAH IS THE SPHERICAL"t

+/,SX,"WITH CI-",F8.2,2X,"CO-"pF8.2,2X,"THE RANGE IS",F9.2, ÷/,SX,"THE VARIANCE IS",FIO.2)

190 WRITE(6,2OO) 200 FORHAT(//,SX,"NO. OF DATA VITHIN",2X,"SIDE LENGTH",2X,"MEAN SQUARE

+ ERROR",/,SX,50("-")) XO = 0

YO - O I F ( I I S .EO. O)THEN SIV-H SFV-H STEP-H ENDIF

206 IF(ID .EO. I) THEN V-H XF.XO-H/2 YF-YO-V/2 CALL SAMPLE(XtY,N,R,XO,YO,XF,YF,H,V) COTO 210 ENDIF IF(ID .EO. 2) THEN XF-O YF-O.57735027*H CALL SAHPLET(X,Y,N,R,XO,YO,XF,YF,H) GOTO 210 ENDIF XF-0 YF-O.8660254038*H CALL SAMPLEX(X,Y,N,R,XO,YO,XF,YF,H)

210 CONTINUE GOTO (220,230,240),JDP

220 NP.N+I COTO 260

230 NP-N+3 GOTO 260

240 NP-N+6 260 CALL MASTER(X,Y,G,GI,A,B,BI,L,S,NP,N,R,XO,YO,H,V,SL,YI,SIGS,JD)

H-H-STEP 300 IF(H .GE. SFV-O.OS)GO TO 206

I~ITE(6,350)

679

Page 14: On sampling nonstationary spatial autocorrelated data

680 E. A. YFANTIS and G T. FLATMA5;

350 FORMAT(Ill) STOP END

C C C SUBROUTINE TABLE C C C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

C SUBROUTINE TABLE SETS UP THE CONDITIONS FOR PRINTING A C TABLE OF VALUES FOR THE MEAN SQUARE ERROR (MSE), AS A C FUNCTION OF THE SAMPLING DISTANC, FOR A SPECIFIED C SAMPLING DSIGN AND A SPECIFIED DRIFT. C ..........................................................

C c

SUBROUTINE TABLE(ID,JD,R,ASD,SIV,SFV,STEP) SIV=ASD SFV-O.2*R STEP=O.O4*R WRITE(6,10)SIV,STEP,SFV

10 FORMAT(/,SX,"DO YOU LIKE THE DEFAULT TABLE WHICH STARTS ", +/,SX,"WITH SAMPLE DISTANCE EQUAL TO",FIS.4,/, +SX,"AND DECREASES BY" + , F 1 5 . 4 , / , S X , " I N EVERY STEP UNTIL THE LOWEST VALUE I S " , F 1 5 . 4 )

NRITE(6,20) 20 FORHAT(/,SX,"TYPE I IF YES O OTHERWISE")

READ(5,*)D IF(D .EO. 1)RETURN

15 VRITE(6,40)ASD 40 FORMAT(I,SX,"INPUT THE MAXIMUM SAMPLING DISTANCE THIS SHOULD",

+I,SX,MLESS THAN OR EQUAL ",F15.4) READ(5,*)SIV VRITE(6,60)O.2*R

60 FORMAT(/,SX,"INPUT THE MINIMUM SAMPLING DISTANCE. THIS SHOULD", +/,SX,"BE GREATER THAN OR EQUAL TO",F15.4, */,SX,"ELSE YOU SHOULD INCREASE THE", ÷/,SX,"DIMENSION OF THE ARRAYS")

READ(5,*)SFV IP(SIV .GT. ASD.O.05 .OR. SFV .LT. 0.2*R-O.OS)GO TO 15 STEP.O.O4*R RETURN END

SUBROUTINUE MASTER

C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

C SUBROUTINE MASTER ADJUSTS THE DIMENSIONS OF THE ARRAYS. CALLS C UP SUBROUTINES SPHER, GAUSS, SOLVE, NSER, AND PRINTS THE NUMBER C N OF SAMPLES WITHIN THE ZONE OF INFLUNCE, THE SAMLING DISTANCE C H, AND THE MEAN SOUARE ERROR SER. C N IS THE NUMBER OF DATA WITHIN THE ZONE OF INFUENCE. C H IS THE SAMPLING DISTANCE (OR SIDE LENGTH). C SER IS THE MEAN SQUARE ERROR. C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

C C

SUBROUTINE MASTER(X,Y,G,G1,A,B,R1,L,S,NP,N,R,XO,Y0,H,V,XA,XB, +SIGS,JD) DIMENSION X(NP),Y(NP),G(NP,NP),GI(N,N),R(NP),BI(NP),L(NP) DIMENSION S(NP),A(NP) CALL SPHER(X,Y,N,NP,XA,XB,XO,YO,R,SIGS,G,B,JD)

10 DO 25 I . I ,N DO 25 J-I,N

G I ( I , J ) - G(I,J) 25 CONTINUE

DO 30 I-I,NP Bi( I ) . B(I)

30 CONTINUE CALL GAUSS(G,NP,NP,L,S) CALL SOLVE(G,NP,NP,L,B,A) CALL MSER(A,GI,N,SER,BI) VRITE(6,AO)N,H,SER

40 FORMAT(Sx,18,12X,FIO.2,FI0.2) RETURN END

C C SUBROUTINE SAMPLE

Page 15: On sampling nonstationary spatial autocorrelated data

Sampling nonstationary spatial autocorrelated data 681

SUBROUTINE SAMPLE BUILDS A NETWOK OF SQUARE GRIDS WITH VERTICES HAVING DISTANCE FROM THE CENTER X0,Y0 LESS THAN THE ZONE OF INFLUENCE. ............................................................

SUBROUTINE SAMPLE(X,Y,I,R,XO,YO,XF,YF,A,B) DIMENSION X(I), Y(1) RS = R*R XS = XF-XO YS = YF-YO IF((XS*XS*YS*YS) .GT. RS) THEN

I-O RETURN

ENDIF XI=XF YI-YF XS=XI-XO YS=Y1-YO

35 IF ((XS*XS+YS*YS) .LE. RS)THEN Y1-YI÷B YS-YI-YO GOTO 35 ENDIF YI,YI-B YS-YI-Y0 YL-YO-R

45 IF((XS*XS+YS*YS) .LT. RS) THEN XI.XI-A XS-XI-XO GOTO 45 ENDIF XI.XI,A X(1)-Xl Y(1)-YI I . l XS.X(1)-XO YS-Y(1)-YO

55 IF (Y1 .GE, YL) THEN 65 IF ((XS*XS+YS*YS) .LE. RS) THEN

I - I+l XI.XI*A X(1)-XI Y(1)-YI XS.X(1)-XO YS-Y(I)-YO GOTO 65 ENOIF YI-YI-B IF(YI .LT. YL) THEN I - I - I GOTO 95 ENDIF X1.XF xs.x1-xo YS.YI-YO

85 IF((XS*XS*YS*YS) .LT. RS) THEN XI-XI-A XS-XI*XO GOTO 85 ENDIF XI-XI*A X(I).Xl XS.X1-XO Y(1).YI GOTO 55 ENDIF

95 RETURN END

C C C ....................................................................

C SUBROUTINES GAUSS AND SOLVE GO TOGETHER. THESE TWO SOLVE THE C SYSTEM G * A = B. gHERE G I S THE MATRIX OF C O E F F I C I E N T S , C CONSISTING OF SEMIVARIOGRAM VALUES AND THE PUNCTIONALS EXFRSSING C THE DRIFT, B IS THE VECTOR OF CONSTANTS, AND A IS THE C VECTOR OF UNKNOVNS THAT SUBROUTINE SOLVE IS SOLVING FOR. C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Page 16: On sampling nonstationary spatial autocorrelated data

6S2 E.A. YFA~TIS and O. T. FLATMAX

C C SUBROUTINE GAUSS C

SUBROUTINE GAUSS(A, IA,N, L, S) DIMENSION A(IA,N),L(N),S(N) DO 2 I=I,N L( I ) . I S(I)=O DO 2 J=I,N S(I)=AMAXI(S(I),ABS(A(I,J)))

2 CONTINUE DO 4 K=I,N-I RMAX=O.O DO 3 I=K,N R=ABS(A(L(I),K))/S(L(I)) IF(R .LE. RMAX) GOTO 3 J=I RMAX=R

3 CONTINUE LK=L(J) L(J)=L(K) L(K)=LK DO 4 I=K+I,N XMULT=A(L(I) ,K)/A(LK,K) A(L(I) ,K)=XMULT DO 4 J.K+I,N A(L(1),J)-A(L(1),J)-XMULT*A(LK,J)

4 CONTINUE RETURN END

C C SUBROUTINE SOLVE C

SUBROUTINE SOLVE(A,IA,N,L,B,X) DIMENSION A(IA,N),L~N),B(N),X(N) DO 2 J.I,N-I DO 2 I-J+I,N B(L(1))-B(L(1))-A(L(1),J)*H(L(J))

2 CONTINUE X(N).B(L(N))/A(L(N),N) DO 4 I-I,N-I SUM-B(L(N-I)) DO 3 J-N-I.I,N SUM=SUM-A(L(N-I),J)*X(J)

3 CONTINUE X(N-I)=SUM/A(L(N-I),N-I)

4 CONTINUE RETURN END

SUBROUTINUE SPHER

C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

C SUBROUTINE SPHER CALCULATES THE MATRIX G OF COEFFICIENTS C AND THE MATRIX B OF CONSTANTS USED FOR SOLVING THE EQUATION C g * A . B. THE SEMIVARIOGRAM USED IS THE SPHERICAL VITH C C0 AND C1 SPECIFIED BY THE USER. C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

C C

SUBROUTINE SPHER(X,Y,N,NP,C,CO,XO,YO,R,SIGS,G,GO,JD) DIMENSION X(N),Y(N),G(NP,NP),GO(NP) DO 5 I -1 ,NP DO 5 J .1 ,NP

G(I,J)=O DO 20 I=I,N DO 10 J=I ,N I F ( I .EQ. J ) THEN G(I,J)-O GOTO 10 ENDIF DI-X(I)-X(J) D2=Y(I)-Y(J)

Page 17: On sampling nonstationary spatial autocorrelated data

Sampling nonstationaryspatial autoco~elateddata

D-SQRT(DI*DI+D2*D2) IF(D .GE. R) THEN G(I,J).SIGS GOTO 10 ENDIF HH.D/R G(I,J),C*HH*(I.5-O.5*HH*HH)+CO

10 CONTINUE DI-X( I ) -X0 D2-Y(I)-YO D-SORT(DI*DI+D2*D2) HE=DIE GO(I).C*HH*(1.S-O.5*EH*HH)+CO IF(D .EQ. O)GO(I)-O

20 CONTINUE NI-N+I DO 30 I-l,N

G ( I , N I ) - I 30 CONTINUE

DO 40 I -1,N G(NI,I)-I

40 CONTINUE G0(NI)-I G(NI,NI).O JP=JD*I GOTO (300,10D,IOD),JP

I00 DO 50 I-I,N G(NI*I,I)-X(I) G(I,NI+I)-X(I) G(NI.2,I)-Y(I) G(I.NI*2)-Y(1)

50 CONTINUE GO(NI+2)=YO GO(NI+I)-XO IF(JD .EQ. 1)GOTO 300 DO 70 I-I,N G(NI*3,I)-X(I)JX(I) G(NI.4,I)-Y(I)*Y(I) G(I,NI+3)-X(I)*X(I) G(I,NI*4)-Y(I)*Y(I) G(NI*5,I)-X(I)*Y(I) G(I,NI*5)-X(I)*Y(I)

70 CONTINUE GO(N1,3)-XO*XO GO(NI+4).YO*YD GO(NI+5)-XO*YO

300 RETURN END

C C SUBROUTINE MSER C C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

C SUBROUTINE MSER CALCULATES THE MEAN SQUARE ERROR AS A C FUNCTION OF THE SEHIVARIOGRAN AND THE DRIFT. C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

C C

SUBROUTINE MSER(A,G,N,SER,GO) DIMENSION G(N,N),A(N),GO(N) S1.0 $2-0 DO 20 I-I,N

DO 10 J-1,N S I .S I *A( I ) *A (J ) *G( I , J )

10 CONTINUE S2-S2*A(I)*GO(I)

20 CONTINUE SER-2*S2-S1 RETURN END

C C SUBROUTINE SAMPLEr C C C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

C SUBROUTINE SAMPLEr CREATES ANETgORK OF POINTS WHICH ARE C VERTICES OF EQUILATERAL TRIANGLES. ALL THE POINTS IN THE

683

Page 18: On sampling nonstationary spatial autocorrelated data

68.1 E. A. YfANTIS and G. T. FLATMAN

C NETVORK HAVE DISTANCE LESS THAN THE RANGE R FROM XO,Y0. C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

C C

SUBROUTINE SAMPLET(X,Y,I,R,XO,Y0,XF,YF,A) DIMENSION X(X),Y(1) Hf0.8660254038*A EPSfI.OE°6 RS-R*R+EPS XS-XF-XO YS-YF-Y0 IF((XS*XS+YS*YS) .GT. RS)THEN I-O RETURN ENDIF XI=XF YI=YF YL-YO-R M=O

35 IF ((XS*XS+YS*YS) .LE. RS)THEN YI.YI+H H-M+I YS-YI-Y0 GOTO 35 ENDIF YI-YI-H M=M-1 YS=YI-YO MI-(M/2)*2-M X I . X I - M I * ( A / 2 )

45 IF((XS*XS+YS*YS) .LE. RS)THEN XI.XI-A XS-Xl-XO GOTO 45

ENDIF XI.XI+A X(1)-XI Y(1)°YI I-I XS.X(t)-XO YS.Y(1)-YO

55 IF(YI .GE. YL)THEN 65 IF((XS*XS+YS*YS) .LE, RS) THEN

I=I+l XI-XI*A X(I)-XI Y(I)-YI XS-X(I)-X0 YS-Y(I)-Y0 GOTO 65 ENDIF Y1-Y1-H IF(YI .LT. YL)THEN I-I-I

GOTO 95 ENDIF M=M-I XI.XF-((M/2)*2-M)*(A/2) XS-XI-XO YS=Y1-YO

85 IF((XS*XS÷YS*YS) .LT. RS) THEN XI-X1-A XS=Xl-X0 GOTO 85 ENDIF XI-XI*A X(I).Xl XS=X1-XO Y(1).YI GOTO 55 ENDIF

95 RETURN END

C C SUBROUTINE SAMPLEX C C C ................................................................

C SUBROUTINE SAMPLEX CREATES A NETVORK OF POINTS WHICH ARE

Page 19: On sampling nonstationary spatial autocorrelated data

Sampling nonstat ionary spatial autocorrelated data

C VERTICES OF REGULAR HEXAGONS. ALL THE POINTS OF THE NLTJOIK C ARE WITHIN THE RANGE FROM XO,¥O. C ................................................................

C C

35

45 '

55 65

SUBROUTINE SAMPLEX(X,Y,I,R,XO,YO,XF,YF,A) DIMENSION X(1),Y(1) B-O.8660254038*A EPS=O.OOOOOI RS=R*R*EPS XS=XF-XO YS=YF-¥0 IF((XS*XS+YS*YS) ,GT, RS)THEN I=O RETURN ENDIF XI:XF YI=YF YL=Y0-R M=O IF((XS*XS+YS*YS) .LE. RS)THEN YI=YI*H M~M+I YS=YI-YO GOTO 35 ENDIF YI=YI-H YS=YI-YO MI-(M-2*(M/2)) LO=2 IF(MI .EQ. O)THEN MI-2 LO-I ENDIF S-HI*A/2 XI-XI-S XS-XI-XO IF((XS*XS+YS*YS) .LE. RS)THEN L-LO S-L*A XI-XI-S XS-XI-XO LO-2-(L/2) GOTO 45 ENDIF Xl-Xl*S x ( t ) . x l Y ( t ) . Y t I . 1 xs.x(1)-xo Ys-Y(1)-YO IF(YI .GE. YL)TBEN IF((XS*XS÷YS*YS) .LE. RS)THEN I = I * I L-LO S=L*A XI=XI*S X(I)-X1 IF(ABS(YI) .LT. 1.0E-O8)YI.O Y(I)-YI XS-X(1)-XO YS-Y(1)-YO LO-2-(L/2) GOTO 65 ENDIF YI-YI-H IF(Y1 .LT, YL)THEN I - I - 1 GOTO 95 ENDIF M.M-I X1-XF MI-ABS(M-(M/2)*2) LO-2 IF(MI .EQ. O)THEN MI-2 LO-1 ENDI F S=MI*A/2 X1-XI-S

685

Page 20: On sampling nonstationary spatial autocorrelated data

686 E. A, YFANTIS and G. T, FLATMAN

XS=Xl-X0 ¥S-¥1-¥0

85 IF((XS*XS÷YS*Y$) .LT. RS)THEN L-LO S=L*A Xl-Xl-S XS=XI =XO LO=2-(L/2) GOTO 85 ENDIF X l -X l *S X ( I ) - X l XS=X1-X0 IF(ABS(YI) .LT. I.OE-OS)YI-O Y ( i ) . Y 1 GOTO 5.5 ENDI F

95 RETURN END