Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: spatial
See also: SPKRsurfls SPKRsurfgls SPKRexpcov SPKRgaucov SPKRsphercov SPKRprmat SPKRsemat SPKRcorrelogram SPKRvariogram SPKRmultcontours

Quantlet: SPKRtrmat
Description: evaluates a trend surface over a grid

Reference(s):

Link:
Usage: res = SPKRtrmat(obj, xl, xu, yl, yu, n)
Input:
obj list, (of type "trls" or "trgls") calculated by SPKRsurfls or SPKRsurfgls
xl scalar, lower limit in x-direction of the rectangle for grid
xu scalar, upper limit in x-direction of the rectangle for grid
yl scalar, lower limit in y-direction of the rectangle for grid
yu scalar, upper limit in y-direction of the rectangle for grid
n scalar, used to create a n x n grid within the rectangle
Output:
res list, consisting of components z, xl, xu, yl, yu, n and type; for further usage with SPKRmultcontours
res.z (n+1)^2 x 3 matrix, grid
res.xl scalar, same as input value xl
res.xu scalar, same as input value xu
res.yl scalar, same as input value yl
res.yu scalar, same as input value yu
res.n scalar, same as input value n
res.type string, "trmat"

Note:

Example:
; loads the spatial statistics library
library("spatial")
; reads a spatial data set
topo = read("topo.dat")
; calculates a polynomial regression surface of order 2
myres = SPKRsurfls(2, topo)
; calculates a 30 x 30 grid within [0, 6.5] x [0, 6.5]
; using trend surface myres
mygrid = SPKRtrmat(myres, 0, 6.5, 0, 6.5, 30)
mygrid

Result:
A grid suitable for display through SPKRmultcontours:

Contents of mygrid.z
[  1,]        0        0   976.33
[  2,]  0.21667        0   965.32
[  3,]  0.43333        0   955.01
[  4,]     0.65        0   945.38
[  5,]  0.86667        0   936.44
...

Contents of mygrid.xl
[1,]        0

Contents of mygrid.xu
[1,]      6.5

Contents of mygrid.yl
[1,]        0

Contents of mygrid.yu
[1,]      6.5

Contents of mygrid.n
[1,]       30

Contents of mygrid.type
[1,] "trmat"



Author: J. Symanzik, 20000725 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006