adi | R Documentation |
Calculates the solution to the inverse problem involving the separable-plus-banded structure as the left-hand side, where the banded part is stationary.
adi( A1, A2, band, y, theta = 1e-05, rho = NULL, adapt = TRUE, maxiter = 200, tol = 10^-9 )
A1 |
temporal kernel of the separable-plus-banded model |
A2 |
spatial kernel of the separable-plus-banded model |
band |
symbol of the banded part of the separable-plus-banded 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 <- matrix(c(4,2,2,1)/4,2)/K^2 # to have trace 1 theta <- 1e-5 eigvals <- Re(stats::fft(to_book_format(B,K,K))) B <- Re(stats::fft(eigvals,inverse = TRUE)/(4*K^2)) B <- B[1:K,1:K] x <- runif(K^2) X <- matrix(x,ncol=K) y <- c(A1 %*% X %*% A2) + BXfast(eigvals,x) + theta*x x_adi <- adi(A1, A2, B, 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.