[an error occurred while processing this directive]
Fields: Web Manual
Table of Contents
1. Introduction

2. Thin Plate Splines: Tps 3. Spatial Process Models: Krig 4. Simulating Random Fields (sim.rf)

5. Spatial Predictions for Large Data Sets
6. Other Fields Functions References

Printable version of Fields Manual

Back to Fields Home Page
3.4.3 Calling the Covariance Function by Name or by Function
(cov.by.name logical parameter)

What in the world does this parameter do?

cov.by.name is a logical parameter (default = T) that tells Krig whether to call the covariance function (cov.function) indirectly by name or by function. If cov.by.name is true, then it will use the standard S function do.call to evaluate the function. The optional arguments specific to the particular covariance function are stored in a list object called "args" that holds all other pertinent information. This is convenient for passing parameters from one function to another. For example, instead of finding the covariance matrix, k(x1, x2), by using the function directly--i.e. cov.function( x1, x2, ...)--the function evaluation would proceed by:

do.call( out$call.name, c( out$args, list( x1, x2)))

may appear to be more complicated, but more compatible with the implementation of the S language in the R statistical package. Note that out$call.name is a character value that simply stores the name of the covariance function to be called. For example, if the default exp.cov is used, then out$call.name is "exp.cov".
If cov.by.name is flase this results in a copy of the covariance function, with the correct arguments attached to the output Krig object. The advantage is that the data, estimate and specific covariance S-function are bundled together in a single object. Even if the covariance function is inadvertently deleted or modified elsewhere, using the returned Krig object will still give the correct results. The disadvantage is that the covariance S-function is always copied and is therefore wasteful of storage. Also, this copying modification of the function is problematic in the R-language.


This is software for statistical research and not for commercial uses. The authors do not guarantee the correctness of any function or program in this package. Any changes to the software should not be made without the authors permission.

Last modified: Dec 21 2005   by thoar@ucar.edu