Description Usage Arguments Details Value Author(s) References Examples
Generalized Least Squares (GLS) estimation for a linear model with a covariance given by the covariance kernel object. The method gives auxiliary variables as needed in many algebraic computations.
1 2 3 4 5 |
object |
An object with |
y |
The response vector with length n. |
X |
The input (or spatial design) matrix with n rows and d
columns. This matrix must be compatible with the given covariance
object, see |
F |
A trend design matrix with n rows and p columns. When
|
varNoise |
A known noise variance. When provided, must be a positive numeric value. |
beta |
A known vector of trend parameters. Default is |
checkNames |
Logical. If |
... |
not used yet. |
There are two options: for unknown trend, this is the usual GLS
estimation with given covariance kernel; for a known trend, it returns
the corresponding auxiliary variables (see value
below).
A list with several elements.
betaHat |
Vector of length p
containing the estimated coefficients if |
L |
The (lower) Cholesky root matrix L of the covariance matrix C. This matrix has n rows and n columns and C = L %*% t(L). |
eStar |
Vector of length n: eStar = inv(L) %*% (y - X betaHat). |
Fstar |
Matrix (n, p): FStar = inv(L) %*% F. |
sseStar |
Sum of squared errors: t(eStar) %*% eStar. |
RStar |
The 'R' upper triangular (p, p) matrix in the QR
decomposition of |
All objects having length p or having one of their dimension
equal to p will be NULL
when F
is NULL
,
meaning that p = 0.
Y. Deville, O. Roustant
Kenneth Lange (2010), Numerical Analysis for Statisticians 2nd ed. pp. 102-103. Springer-Verlag,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## a possible 'covTS'
myCov <- covTS(inputs = c("Temp", "Humid"),
kernel = "k1Matern5_2",
dep = c(range = "input"),
value = c(range = 0.4))
d <- myCov@d; n <- 100;
X <- matrix(runif(n*d), nrow = n, ncol = d)
colnames(X) <- inputNames(myCov)
## generate the 'GP part'
C <- covMat(myCov, X = X)
L <- t(chol(C))
zeta <- L %*% rnorm(n)
## trend matrix 'F' for Ordinary Kriging
F <- matrix(1, nrow = n, ncol = 1)
varNoise <- 0.5
epsilon <- rnorm(n, sd = sqrt(varNoise))
beta <- 10
y <- F %*% beta + zeta + epsilon
fit <- gls(myCov, X = X, y = y, F = F, varNoise = varNoise)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.