Description Usage Arguments Details Value Author(s) See Also Examples
Extract the fitted values, i.e., the estimated mean
values, for an object produced by the
geolm function for a specified set of
covariates, x. If x is NULL, then
then x is taken from object.
1 2 |
object |
An object produced by the
|
x |
A m \times p matrix of covariates for the
locations where fitted values are desired. If
|
... |
Not currently implemented. |
If the object has a known mean, i.e.,
object$mu is not NULL, then the function
returns the vector rep(object$mu, m). If
object has estimated coefficients, then x
%*% object$coeff is returned.
If x is missing, then object$x is used for
x. Naturally, ncol(x) must equal
length(object$coeff). If x is NULL
and object$mu is not NULL, then m is
taken to be 1.
The vector of fitted values.
Joshua French
1 2 3 4 5 6 7 8 9 10 | data = data.frame(y = rnorm(10), x1 = runif(10),
x2 = runif(10))
d = as.matrix(dist(data[,c("x1", "x2")]))
mod = cmod_man(v = exp(-d), evar = 1)
gearmod = geolm(y ~ x1, data = data,
coordnames = ~ x1 + x2, mod = mod)
# fitted values for original observations
fitted(gearmod)
# fitted values for new observations
fitted(gearmod, x = cbind(1, rnorm(20)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.