covmatrix | R Documentation |
Create a covariance matrix from a fitted model object.
covmatrix(object, newdata, ...)
## S3 method for class 'splm'
covmatrix(object, newdata, cov_type, ...)
## S3 method for class 'spautor'
covmatrix(object, newdata, cov_type, ...)
## S3 method for class 'spglm'
covmatrix(object, newdata, cov_type, ...)
## S3 method for class 'spgautor'
covmatrix(object, newdata, cov_type, ...)
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). |
cov_type |
The type of covariance matrix returned. If |
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
.
spmod <- splm(z ~ water + tarp,
data = caribou,
spcov_type = "exponential", xcoord = x, ycoord = y
)
covmatrix(spmod)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.