This archive contains S code and a FORTRAN function. The S code is not required to call and run the FORTRAN code for the Matern covariances, but certainly is useful. This function uses dynamic loading and Fortran compiler. For help, see the S code ("matern.S"). For technical background see Handcock and Stein (1993), 'A Bayesian Analysis of Kriging', Technometrics, 35, 4, 403-410. or contact mhandcock@stern.nyu.edu Below are installation and usage instructions by example. % sh matern.sh % make mkdir .Data Splus < matern.S S-PLUS : Copyright (c) 1988, 1992 Statistical Sciences, Inc. S : Copyright AT&T. Version 3.1 Release 1 for Sun SPARC, SunOS 4.x : 1992 Graphics Display has not been initiated Working data will be in .Data f77 -O -sun4 -c rkmat.f rkmat.f: rkmat: rkbesl: dgamma: % S S-PLUS : Copyright (c) 1988, 1992 Statistical Sciences, Inc. S : Copyright AT&T. Version 3.1 Release 1 for Sun SPARC, SunOS 4.x : 1992 Graphics Display has not been initiated Working data will be in /dept/sor/fac/mhandcoc/.Data > # Do an example > y <- matern(scale=1,range=1,smoothness=1) rkmat.o FORTRAN subroutine dynamically loaded: _rkbesl_ _dgamma_ _rkmat_ > names(y) [1] "x" "y" "scale" "range" "smoothness" > # Plot the example > X11() > plot(y,xlab="distance",ylab="covariance",main="A Matern covariance function", + type="l") > abline(h=0) > # do a smaller example > testx <- c(0,1,0.5,0.3333) > testy <- matern(testx,smoothness=3.141) > testy $x: [1] 0.0000 1.0000 0.5000 0.3333 $y: [1] 1.0000000 0.3247784 0.7184652 0.8569884 $scale: [1] 1 $range: [1] 1 $smoothness: [1] 3.141 > quit()