Graybill (1983) Theorem 8.3.4, Schabenberger & Gotway (2005) Theorem 1.1:
the k x k matrix C = (a - b) I + b J is invertible if and only if a != b
and a != -(k - 1) b, and then C^-1 = (I - b / (a + (k - 1) b) J) / (a - b).
Arguments
- k
Dimension, at least 1.
- a
Diagonal element.
- b
Off-diagonal element.
Value
Named list: exists, k, a, b and, when the inverse exists,
inverse, diag, offdiag and sum_inverse (1' C^-1 1 = k / (a + (k - 1) b)).
References
Graybill, F. A. (1983). Matrices with Applications in
Statistics, 2nd ed., Theorem 8.3.4, p. 190. Schabenberger & Gotway
(2005), Theorem 1.1, p. 34.
Examples
csinv(4, 3, 0.7)$inverse
#> [,1] [,2] [,3] [,4]
#> [1,] 0.37510656 -0.05967604 -0.05967604 -0.05967604
#> [2,] -0.05967604 0.37510656 -0.05967604 -0.05967604
#> [3,] -0.05967604 -0.05967604 0.37510656 -0.05967604
#> [4,] -0.05967604 -0.05967604 -0.05967604 0.37510656