adi_diag | R Documentation |
Calculates the solution to the inverse problem involving the separable-plus-diagonal structure as the left-hand side.
adi_diag( A1, A2, B_diag, y, theta = 0, rho = NULL, adapt = F, maxiter = 200, tol = 10^-6 )
A1 |
temporal kernel of the separable-plus-diagonal model |
A2 |
spatial kernel of the separable-plus-diagonal model |
B_diag |
the diagonal of the model |
y |
right-hand side vector |
theta |
regularization |
rho |
initial value of the shift parameter, defaults to the square-root
of the smaller one of the condition numbers of |
adapt |
whether the shift should change in between iterations |
maxiter |
maximum number of iterations |
tol |
relative tolerance - stopping criterion |
list of 3 elements: the solution as a vector, the number of ADI iterations and the vector of PCG iterations (one number per one ADI iteration)
K <- 30 A1 <- brownian_cov(K) A1 <- A2 <- A1/sum(diag(A1)) B_diag <- array(runif(K^2),c(K,K)) B_diag <- B_diag/sum(B_diag) theta <- 1e-5 x <- runif(K^2) X <- matrix(x,ncol=K) y <- c(A1 %*% X %*% A2) + c(B_diag*X) + theta*x x_adi <- adi_diag(A1, A2, B_diag, y, theta, adapt=TRUE,maxiter=100,tol=10^-7) sum((x-x_adi$x)^2)/sum(x^2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.