Learn R Programming

amen (version 1.0)

mhalf: Symmetric square root of a matrix

Description

Computes the symmetric square root of a positive definite matrix

Usage

mhalf(M)

Arguments

M
a positive definite matrix

Value

  • a matrix H such that H^2 equals M

Examples

Run this code
## The function is currently defined as
function (M)
{
    tmp <- eigen(M)
    tmp$vec %*% sqrt(diag(tmp$val, nrow = nrow(M))) %*% t(tmp$vec)
  }

Run the code above in your browser using DataLab