Learn R Programming

LatticeKrig (version 9.3.0)

LKrigDefaultFixedFunction: Creates fixed part of spatial model.

Description

Creates matrix of low order polynomial in the spatial coordinates and adds any other spatial covariates that are part of the linear model.

Usage

LKrigDefaultFixedFunction(x, Z = NULL, m=2,distance.type="Euclidean") 
 LKrigPeriodicFixedFunction(x, Z = NULL, m = 2, distance.type = "Euclidean")
 
predictLKrigFixedFunction(object, xnew, Znew = NULL, drop.Z = FALSE,
collapseFixedEffect = FALSE)

Value

A matrix where rows index the locations and columns are the different spatial polynomial and covariates.

Arguments

collapseFixedEffect

If FALSE the fixed part of the model is found separately for each replicated data set. If TRUE the estimate is polled across replicates.

drop.Z

If TRUE only spatial drift is evaluated the contribution for covariates is omitted.

distance.type

The distance metric. See the entry in LKrig for details.

m

The order of the polynomial. Following the convention for splines the polynomial will have maximum order (m-1). Throughout LKrig m==2 is the default giving a linear polynomial.

object

A LKrig object.

x

A 2 column matrix of 2-d locations to evaluate the polynomial.

xnew

Locations for predictions.

Z

A matrix specifying additional spatial covariates.

Znew

Same as Z.

Author

Doug Nychka

Details

LKrigDefaultFixedFunction This function creates the regression matrix for the fixed part of the spatial model. The default is a low order polynomial regression matrix of degree m-1. To this matrix are bound as columns any covariates passed as Z. Typically one would not need to modify this function. For more exotic fixed part models one can specify create and then specify a different function. See LKrig.setup and LKrig. NOTE: If the argument for this function is passed as NULL then the subsequent computations do not include a fixed part in the model.

LKrigDefaultFixedFunction This is same as LKrigDefaultFixedFunction except the first coordinate is ignored. i.e. it is assumed to be periodic so adding a polynomial does not make sense.

predictLKrigFixedFunction This function is simple, but is introduced to make the code modular and to handle the case for cylindrical geometry where only latitude should have a spatial term (to preserve periodicity in longitude).

See Also

LKrig.basis, LKrig

Examples

Run this code
x<- matrix( runif(100), nrow=50)
# linear polynomial 
T.matrix<- LKrigDefaultFixedFunction(x, m=2)
# quadratic polynomial 
T.matrix<- LKrigDefaultFixedFunction(x, m=3)

Run the code above in your browser using DataLab