Learn R Programming

mgcv (version 0.9-6)

mroot: Smallest square root of matrix

Description

Find a square root of a positive semi-definite matrix, having as few columns as possible. Uses either pivoted choleski decomposition or singular value decomposition to do this.

Usage

mroot(A,rank=NULL,method="chol")

Arguments

A
The positive semi-definite matrix, a square root of which is to be found.
rank
if the rank of the matrix A is known then it should be supplied.
method
"chol" to use pivoted choloeski decompositon, which is fast but tends to over-estimate rank. "svd" to use singular value decomposition, which is slow, but is the most accurate way to estimate rank.

Value

  • A matrix, ${\bf B}$ with as many columns as the rank of ${\bf A}$, and such that ${\bf A} = {\bf BB}^\prime$.

Details

The routine uses an LAPACK SVD routine, or the LINPACK pivoted Choleski routine. It is primarily of use for turning penalized regression problems into ordinary regression problems.