Learn R Programming

LatticeKrig (version 9.3.0)

LKrigNormalizeBasis: Methods and functions to support normalizing to marginal variance of one.

Description

The basis functions can be normalized so that the marginal variance of the process at each level and at all locations is one. A generic function LKrigNormalizeBasis computes this for any LatticeKrig model. However, in special cases the normalization can be accelerated. LKrigNormalizeBasisFast takes advantage of rectangular geometry and a constant a.wght, and further decomposes the SAR matrix using Kronecker products. This method calculates the exact marginal variance while providing an increase in computational efficiency. The LKrigNormalizeBasisFFTInterpolate method is the fastest, yet it provides an approximate marginal variance, and can only be used when there are significantly less basis functions than locations.

Usage

LKrigNormalizeBasis(
LKinfo, Level, PHI = NULL, x1 = NULL, gridList = NULL, ...)
LKrigNormalizeBasisFast(LKinfo, ...)
LKrigNormalizeBasisFFTInterpolate(LKinfo, Level, x1)
# S3 method for default
LKrigNormalizeBasisFast(LKinfo, ...)
# S3 method for LKRectangle
LKrigNormalizeBasisFast(LKinfo, Level, x1,  ...)
LKRectangleSetupNormalization(mx, a.wght)

Value

A vector of weights. The basis are normalized by dividing by the square root of the weights.

Arguments

a.wght

A.wght parameters.

gridList

If not NULL this is a gridList object that will be expanded to give a grid of locations and used for x1.

LKinfo

An LKinfo object. NOTE: Here choleskyMemory, a Spam memory argument, can be a component of LKinfo and is subsequently passed through to the (spam) sparse cholesky decomposition

Level

The multi-resolution level.

mx

Matrix of lattice sizes.

PHI

Unnormalized basis functions evaluated at the locations to find the normalization weights.

x1

Locations to find normalization weights. If NULL then locations obtained from gridList argument.

...

Additional arguments for method.

Author

Doug Nychka

Details

Normalization to unit variance is useful for reducing the artifacts of the lattice points and creates a model that is closer to being stationary. The computation must be done for every point evaluated with the basis functions The basic calculation is


	tempB <- LKrigSAR(LKinfo, Level = Level)
    tempB <- LKrig.spind2spam(tempB)
    wght <- LKrig.quadraticform(t(tempB) 
        choleskyMemory = choleskyMemory)

This generic method uses the low level utility LKrig.quadraticform that evaluates diag( t(PHI) solve( Q.l) PHI ) where PHI are the basis functions evaluated at the locations and Q.l is the precision matrix for the lattice coefficients at level l.

For constant a.wght and for the rectangular geometry one can use an eigen decomposition of the Kronecker product of the SAR matrix. This allows for a faster way of calculating the exact marginal variance.

In cases where (2 * NC - 1) < s, where NC is the selected number of basis functions and s is the larger side of a 2-dimensional dataset, an approximate marginal variance with extremely high accuracy (average error 0.001%, maximum error ~2%) can be calculated. This is done by first calculating the marginal variance on a coarser grid, then performing 2-dimensional Fourier Interpolation to upsample to all locations of the dataset.