invert_exchangeable_matrix {netregR} | R Documentation |
Invert an exchangeable matrix
Description
Invert an exchangeable matrix
Usage
invert_exchangeable_matrix(n, phi, directed = TRUE)
Arguments
n |
Number of actors in the network, scalar numeric. |
phi |
Appropriate-length vector of parameters, must be length 5 or 6 for directed= |
directed |
Optional logical indicator of whether input data is for a directed network, default is |
Details
This function inverts a covariance matrix of the exchangeable class in a manner much faster than the direct inverse, and the computational cost does not scale with n. See Marrs et. al. (2017). This approach will only work for complete networks.
Value
out |
Parameters of inverted matrix of exchangeable class. |
References
Marrs, F. W., Fosdick, B. K., & McCormick, T. H., (2017). Standard errors for regression on relational data with exchangeable errors. arXiv preprint arXiv:1701.05530.
See Also
rphi
, build_exchangeable_matrix
Examples
n <- 10
phi <- rphi(n, seed=1)
p <- invert_exchangeable_matrix(n, phi)
I1 <- build_exchangeable_matrix(n, phi) %*% build_exchangeable_matrix(n, p)
range(I1 - diag(n*(n-1))) # it works