MatSqrt, MatInv, MatLogDet {GeoModels}R Documentation

Square root, inverse and log determinant of a (semi)positive definite matrix, given a matrix decomposition.

Description

Square root, inverse and log determinant of a (semi)positive definite matrix, given a matrix decomposition.

Usage

MatSqrt(mat.decomp,method) 
MatInv(mtx)
MatLogDet(mat.decomp,method)

Arguments

mtx

numeric; a squared symmetric positive definite matrix.

mat.decomp

numeric; a matrix decomposition.

method

string; the type of matrix decomposition. Two possible choices: cholesky and svd.

Value

The function returna a square root or inverse or log determinant of a (semi)positive definite matrix using the function in the FastGP package.

Author(s)

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

See Also

MatDecomp

Examples

 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)

[Package GeoModels version 2.0.2 Index]