blup_adi | R Documentation |
Best Linear Unbiased Prediction in Separable-plus-banded Model
blup_adi(Xnew, A1, A2, band, m1, m2, theta = 1e-05)
Xnew |
new observation to be predicted, a K1 x K2 matrix with last K1-m1+1 rows and K2-m2+1 columns equal to zero (unobserved) |
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 |
m1 |
|
m2 |
Xnew observed until this column index |
theta |
regularization for adi() |
prediction of Xnew, i.e. matrix of size K1 x K2 where the last columns and rows are no longer zero
N <- 100 K1 <- 5 K2 <- 7 A1 <- matrix(rnorm(K1^2),K1) A2 <- matrix(rnorm(K2^2),K2) A1 <- A1 %*% t(A1) A2 <- A2 %*% t(A2) A1 <- mat_root(A1) A2 <- mat_root(A2) X <- A1 %*% array(rnorm(K1*K2),c(K1,K2)) %*% A2 + matrix(rnorm(K1*K2),K1) Xhat <- blup_adi(X,A1,A2,as.matrix(1),4,5) norm(X-Xhat, type="F")/norm(X, type="F")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.