L_mult {GpGp} | R Documentation |
Multiply approximate Cholesky by a vector
Description
Vecchia's approximation implies a sparse approximation to the inverse Cholesky factor of the covariance matrix. This function returns the result of multiplying the inverse of that matrix by a vector (i.e. an approximation to the Cholesky factor).
Usage
L_mult(Linv, z, NNarray)
Arguments
Linv |
Entries of the sparse inverse Cholesky factor,
usually the output from |
z |
the vector to be multiplied |
NNarray |
A matrix of indices, usually the output from |
Value
the product of the Cholesky factor with a vector
Examples
n <- 2000
locs <- matrix( runif(2*n), n, 2 )
covparms <- c(2, 0.2, 0.75, 0.1)
ord <- order_maxmin(locs)
NNarray <- find_ordered_nn(locs,20)
Linv <- vecchia_Linv( covparms, "matern_isotropic", locs, NNarray )
z <- rnorm(n)
y1 <- fast_Gp_sim_Linv(Linv,NNarray,z)
y2 <- L_mult(Linv, z, NNarray)
print( sum( (y1-y2)^2 ) )
[Package GpGp version 0.5.0 Index]