MatSqrt, MatInv, MatLogDet | R Documentation |
Square root, inverse and log determinant of a (semi)positive definite matrix, given a matrix decomposition.
MatSqrt(mat.decomp,method)
MatInv(mtx)
MatLogDet(mat.decomp,method)
mtx |
numeric; a squared symmetric positive definite matrix. |
mat.decomp |
numeric; a matrix decomposition. |
method |
string; the type of matrix decomposition. Two possible choices: |
The function returna a square root or inverse or log determinant of a (semi)positive definite matrix using the function in the FastGP package.
Moreno Bevilacqua, moreno.bevilacqua89@gmail.com,https://sites.google.com/view/moreno-bevilacqua/home, Víctor Morales Oñate, victor.morales@uv.cl, https://sites.google.com/site/moralesonatevictor/, Christian", Caamaño-Carrillo, chcaaman@ubiobio.cl,https://www.researchgate.net/profile/Christian-Caamano
MatDecomp
library(GeoModels)
################################################################
###
### Example 1. Inverse of Covariance matrix associated to
### a Matern correlation model
###
###############################################################
# Define the spatial-coordinates of the points:
x <- runif(15, 0, 1)
y <- runif(15, 0, 1)
coords <- cbind(x,y)
# Matern Parameters
param=list(smooth=0.5,sill=1,scale=0.2,nugget=0)
a=matrix <- GeoCovmatrix(coordx=coords, corrmodel="Matern", param=param)
## decomposition with cholesky method
b=MatDecomp(a$covmat,method="cholesky")
## inverse of covariance matrix
inverse=MatInv(a$covmat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.