Learn R Programming

pbdDMAT (version 0.2-3)

chol2inv: Inverse from Choleski (or QR) Decomposition

Description

qr() takes the QR decomposition.

Usage

## S3 method for class 'ddmatrix':
chol2inv(x, size = NCOL(x))

Arguments

x
numeric distributed matrices for
size
number of columns of x containing the Choleski factorization.

Value

  • A numeric distributed matrix.

Details

The function returns the inverse of a choleski factored matrix, or the inverse of crossprod(x) if qr.R(qr(x)) is passed.

See Also

lm.fit

Examples

Run this code
# Save code in a file "demo.r" and run with 2 processors by
# > mpiexec -np 2 Rscript demo.r

library(pbdDMAT, quiet = TRUE)
init.grid()

comm.set.seed(diff=T)
x <- ddmatrix("rnorm", 3, 3)

R <- qr.R(qr(x))
xtx.inv <- chol2inv(R)

id <- xtx.inv
print(id)

finalize()

Run the code above in your browser using DataLab