Ray Czaplewski
Ray Czaplewski

Reputation: 155

Error msg: LDL' Bunch-Kaufman decomposition of covariance matrix

I'm new to R-Matrix. I am trying to decompose singular covariance matrix into LDL' form with R-function BunchKaufman(x, ...) http://stat.ethz.ch/R-manual/R-devel/library/Matrix/html/BunchKaufman-methods.html

Please help me get past first-base with trailing "Error in function..."

A <- matrix( c( 0.184, 0.228, 0.252, 0.022, -0.022, 0.228, 1.053, 0.142, 0.106, -0.106,
+ 0.252, 0.142, 0.382, 0.015, -0.015, 0.022, 0.106, 0.015, 0.055, -0.055, 
+ -0.022, -0.106, -0.015, -0.055, 0.055), ncol=5, nrow=5)
BunchKaufman(A)
Error in function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘BunchKaufman’ for signature ‘"matrix"’

Upvotes: 0

Views: 155

Answers (1)

Ray Czaplewski
Ray Czaplewski

Reputation: 155

Following works:

A <- forceSymmetric(A)

syA <- new("dsyMatrix", A , Dim = as.integer(c(nrow(A),nrow(A))) , uplo = "L" )

BunchKaufman(syA)

Upvotes: 1

Related Questions