Skip to contents

Z(s) = sum_{j=0}^p X_j(s) beta_j + e(s) = X beta + e(s), fitted by ordinary least squares; the residuals are what a variogram estimator should be given.

Usage

Spatrend(X, z, addintercept = TRUE)

Arguments

X

Spatial regressors, excluding the intercept by default.

z

Observed values.

addintercept

Prepend the column X_0(s) = 1.

Value

List with beta, fitted, resid, rss, sigma2, n, p.

References

Bivand, Pebesma and Gomez-Rubio (2013), Equation (8.5), p. 218.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Spatrend(V, V)
#> $beta
#> [1] 6.097555e-16 1.000000e+00
#> 
#> $fitted
#> [1] 1 2 3 4 5 6 7 8
#> 
#> $resid
#> [1] -2.220446e-16  0.000000e+00  4.440892e-16  8.881784e-16  8.881784e-16
#> [6]  8.881784e-16  1.776357e-15  1.776357e-15
#> 
#> $rss
#> [1] 8.923989e-30
#> 
#> $sigma2
#> [1] 1.487331e-30
#> 
#> $n
#> [1] 8
#> 
#> $p
#> [1] 2
#> 
#> $method
#> [1] "Spatial trend surface (Bivand et al. 2013 eq. 8.5)"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"