compress | R Documentation |
The utility function compress
stores symmetric or triangular
matrices compactly by retaining only the diagonal and either the
lower or upper off-diagonal elements. The function expand
restores such compressed matrices again to a square form.
compress(m)
expand(object)
m |
either a single symmetric, lower or upper triangular
matrix or a list of such matrices. The type of |
object |
a single compressed matrix or a list of such matrices
generated by |
If m
is a single square matrix then compress
generates a
compressed matrix, which is a list with two components:
diag |
a vector with the diagonal elements of |
tri |
a vector with off-diagonal elements. |
If m
is a list of square matrices then the result is also a list
of compressed matrices.
expand
creates a square matrix if object
is a list with
components diag
and tri
and a list of square matrices if
object
is a list of such lists. If m
or objects
are
lists that contain other components than square or compressed matrices
then these additional components are returned unchanged.
Andreas Papritz papritz@retired.ethz.ch.
georob
for (robust) fitting of spatial linear models.
data(meuse)
r.logzn.rob <- georob(log(zinc) ~ sqrt(dist) + ffreq, data = meuse,
locations = ~ x + y, variogram.model = "RMexp",
param = c(variance = 0.15, nugget = 0.05, scale = 200),
tuning.psi = 1)
cov2cor(expand(r.logzn.rob[["cov"]][["cov.betahat"]]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.