Description Usage Arguments Details Value See Also Examples
Discrete covariance-matrix functions return a covariance matrix that does not depend
on evaluation points t
. Possibilities are zero_cov
, id_cov
,
diag_cov
and unstr_cov
. See details for further information.
1 2 3 4 5 6 7 8 9 |
t |
evaluation points. |
param |
parameters for the covariance matrix. |
The discrete covariance-matrix functions return m x m covariance matrices
where m is the length of t
. They are discrete in the sense that they
do not depend on the specific evaluation points t
. These covariance matrix
functions are mainly used to model latent variables.
zero_cov
returns an m x m zero matrix.
id_cov
returns an m x m identity matrix.
const_cov
returns an m x m matrix consisting of all ones.
Note: this covariance matrix has rank 1 and is thus generally
not positive definite.
diag_cov
returns an m x m diagonal matrix with param
on the diagonal.
unstr_cov
returns an unstructured m x m covariance matrix with the diagonal
given by the first m elements in param
, and the remaining filling
the upper and lower triangles. If the supplied parameters does not specify a positive
definite matrix, the function tries to return the nearest positive definite matrix (see
nearPD
). This may cause unstr_cov
to be slow if m is
not small.
Covariance matrix of dimension m x m where m is the length
of t
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # Evaluation points
t <- 0:1
# Generate zero, identity and constant covariance matrices
zero_cov(t)
id_cov(t)
const_cov(t)
# Generate diagonal covariance
diag_cov(t, param = 1:2)
# Generate unstructured covariance matrix
unstr_cov(t, param = c(1, 1, 0.5))
# Generate unstructured covariance matrix with parameters
# that will not produce a positive matrix
(C <- unstr_cov(t, param = c(1, 1, 1.1)))
det(C)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.