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: SPKRsurfgls SPKRexpcov SPKRgaucov SPKRsphercov SPKRtrmat SPKRprmat SPKRsemat SPKRcorrelogram SPKRvariogram SPKRmultcontours

Quantlet: SPKRsurfls
Description: fits a trend surface, i.e., a polynomial regression surface, by least squares

Reference(s):

Reference(s):

Link:
Usage: res = SPKRsurfls(np, xmat)
Input:
np scalar, degree of the polynomial surface, an integer in the range 0..6
xmat n x 3 matrix of locations (x_i, y_i) [columns 1 & 2] and observations z_i [column 3]
Output:
res list, consisting of components x, y, z, np, f, r, beta, wz, minx, maxx and type:
res.x n x 1 vector, same as xmat[,1]
res.y n x 1 vector, same as xmat[,2]
res.z n x 1 vector, same as xmat[,3]
res.np scalar, same as input value np
res.f matrix, internal use only
res.r matrix, internal use only
res.beta matrix, containing (np + 1)(np + 2) / 2 coefficients
res.wz matrix, internal use only
res.minx 1 x 3 vector, minimum of columns of xmat
res.maxx 1 x 3 vector, maximum of columns of xmat
res.type string, "trls"

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)
myres.minx
myres.maxx

Result:
A list consisting of input parameters, intermediate
and final results of a polynomial regression
surface. This list will be used in other spatial
statistics quantlets such as SPKRtrmat, SPKRcorrelogram,
or SPKRvariogram.

Contents of minx
[1,]      0.2        0      690

Contents of maxx
[1,]      6.3      6.2      960



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