estimate.trace: estimate.trace

View source: R/brnn.R

estimate.traceR Documentation

estimate.trace

Description

The estimate.trace function estimates the trace of the inverse of a possitive definite and symmetric matrix using the algorithm developed by Bai et al. (1996). It is specially useful when the matrix is huge.

Usage

  estimate.trace(A,tol=1E-6,samples=40,cores=1)

Arguments

A

(numeric), positive definite and symmetric matrix.

tol

numeric tolerance, a very small number useful for checking convergenge in the Bai's algorithm.

samples

integer, number of Monte Carlo replicates to estimate the trace of the inverse.

cores

Number of cpu cores to use for calculations (only availible in UNIX-like operating systems).

References

Bai, Z. J., M. Fahey and G. Golub. 1996. "Some large-scale matrix computation problems." Journal of Computational and Applied Mathematics, 74(1-2), 71-89.

Examples

## Not run: 
library(brnn)
data(Jersey)

#Estimate the trace of the iverse of G matrix
estimate.trace(G)

#The TRUE value
sum(diag(solve(G)))


## End(Not run)

brnn documentation built on Nov. 10, 2023, 9:08 a.m.

Related to estimate.trace in brnn...