Last data update: 2014.03.03

R: Method that creates the spatial autoregressive (SAR) matrix.
LKrigSARR Documentation

Method that creates the spatial autoregressive (SAR) matrix.

Description

Using the information in LKinfo create the SAR matrix for a given level of the multiresolution.

Usage

LKrigSAR(object, ...)
  ## Default S3 method:
LKrigSAR(object, ...)
  ## S3 method for class 'LKInterval'
LKrigSAR(object, Level, ...)
  ## S3 method for class 'LKRectangle'
LKrigSAR(object, Level, ...)
  ## S3 method for class 'LKBox'
LKrigSAR(object, Level, ...)
  ## S3 method for class 'LKRing'
LKrigSAR(object, Level, ...) 
  ## S3 method for class 'LKCylinder'
LKrigSAR(object, Level, ...)

Arguments

object

An LKinfo object.

Level

The level of the multiresolution.

...

Any additional arguments to pass to this method.

Details

The model for the Gaussian Markov Random field, c, at a given level is

B c = e,

where B is the SAR matrix computed by this method, and e are uncorrelated N(0,1). The precision matrix for this level is

Q= t(B)%*% B

and so the covariance matrix for c is the inverse of Q:

solve( Q)= solve(B)%*% t( solve(B))

Value

A matrix in the sparse matrix format, spind, with dimensions given by the number of lattice points at Level. Because this construct is geometry dependent the default version of this method just returns an error message.

Author(s)

Doug Nychka

See Also

LKrig.precision spind2full

Examples

    x<- cbind( c(0,1))
	LKinfo<- LKrigSetup(x,LKGeometry="LKInterval",
	               nlevel=3, NC=3, a.wght=5, alpha=c(1,.5,.2) )
	B<- LKrigSAR( LKinfo, Level=2)
	B<-spind2full(B)
	image.plot( B)
	
	LKinfo<- LKrigSetup(cbind( c(0,360), c(0,1)) ,LKGeometry="LKRing",
	               nlevel=1, NC=3, a.wght=5, alpha=1)
	B<- LKrigSAR( LKinfo, Level=1)
	B<-spind2full(B)
	image.plot( B)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(LatticeKrig)
Loading required package: spam
Loading required package: grid
Spam version 1.3-0 (2015-10-24) is loaded.
Type 'help( Spam)' or 'demo( spam)' for a short introduction 
and overview of this package.
Help for individual functions is also obtained by adding the
suffix '.spam' to the function name, e.g. 'help( chol.spam)'.

Attaching package: 'spam'

The following objects are masked from 'package:base':

    backsolve, forwardsolve

Loading required package: fields
Loading required package: maps

 # maps v3.1: updated 'world': all lakes moved to separate new #
 # 'lakes' database. Type '?world' or 'news(package="maps")'.  #


> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/LatticeKrig/LKrigSAR.Rd_%03d_medium.png", width=480, height=480)
> ### Name: LKrigSAR
> ### Title: Method that creates the spatial autoregressive (SAR) matrix.
> ### Aliases: LKrigSAR LKrigSAR.LKBox LKrigSAR.LKRectangle
> ###   LKrigSAR.LKInterval LKrigSAR.LKRing LKrigSAR.LKCylinder
> ###   LKrigSAR.default
> ### Keywords: spatial
> 
> ### ** Examples
> 
>     x<- cbind( c(0,1))
> 	LKinfo<- LKrigSetup(x,LKGeometry="LKInterval",
+ 	               nlevel=3, NC=3, a.wght=5, alpha=c(1,.5,.2) )
> 	B<- LKrigSAR( LKinfo, Level=2)
> 	B<-spind2full(B)
> 	image.plot( B)
> 	
> 	LKinfo<- LKrigSetup(cbind( c(0,360), c(0,1)) ,LKGeometry="LKRing",
+ 	               nlevel=1, NC=3, a.wght=5, alpha=1)
> 	B<- LKrigSAR( LKinfo, Level=1)
> 	B<-spind2full(B)
> 	image.plot( B)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>