Description Usage Arguments Value Examples
View source: R/forwardsolve.kron.R
Solves kron(A, B) x = y where A and B are lower triangular matrices.
1 | forwardsolve.kron(A, B, y)
|
A |
an m x n matrix |
B |
an p x q matrix |
y |
an mp x s matrix |
x
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | set.seed(2018)
coord.s = matrix(runif(100), ncol=2)
coord.r = matrix(runif(50), ncol=2)
d.s = as.matrix(dist(coord.s))
d.r = as.matrix(dist(coord.r))
S1 = exp(-d.s)
S2 = exp(-d.r)
A = t(chol(S1))
B = t(chol(S2))
s = 15
x = matrix(runif(nrow(S1)*nrow(S2)*s), ncol=s)
y = kronecker(A,B) %*% x
x.solved = forwardsolve.kron(A, B, y)
max(abs(x - x.solved))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.