covmatrix {spmodel} | R Documentation |
Create a covariance matrix
Description
Create a covariance matrix from a fitted model object.
Usage
covmatrix(object, newdata, ...)
## S3 method for class 'splm'
covmatrix(object, newdata, ...)
## S3 method for class 'spautor'
covmatrix(object, newdata, ...)
## S3 method for class 'spglm'
covmatrix(object, newdata, ...)
## S3 method for class 'spgautor'
covmatrix(object, newdata, ...)
Arguments
object |
A fitted model object (e.g., |
newdata |
If omitted, the covariance matrix of
the observed data is returned. If provided, |
... |
Other arguments. Not used (needed for generic consistency). |
Value
If newdata
is omitted, the covariance matrix of the observed
data, which has dimension n x n, where n is the sample size used to fit object
.
If newdata
is provided, the covariance matrix between the unobserved (new)
data and the observed data, which has dimension m x n, where m is the number of
new observations and n is the sample size used to fit object
.
Examples
spmod <- splm(z ~ water + tarp,
data = caribou,
spcov_type = "exponential", xcoord = x, ycoord = y
)
covmatrix(spmod)