Learn R Programming

Correlplot (version 1.1.2)

FitRDeltaQSym: Approximation of a correlation matrix with column adjustment and symmetric low rank factorization

Description

Program FitRDeltaQSym calculates a low rank factorization for a correlation matrix. It adjusts for column effects, and the approximation is therefore asymmetric.

Usage

FitRDeltaQSym(R, W = NULL, nd = 2, eps = 1e-6, delta.init = 0,
              q.init = rep(0,ncol(R)), 
              itmax = 1000, verbose = FALSE)

Value

A list object with fields:

delta

The final scalar adjustment

q

The final column adjustments

G

The matrix of biplot vectors

fit.rmse

The RSME of the approximation

losshistory

The value of the loss function for each iteration

rmsehistory

The RMSE of the approximation for each iteration

Rhat

The final approximation to the correlation matrix

eps

The threshold used for checking convergence

nd

The rank of the request approximation

Arguments

R

A correlation matrix

W

A weight matrix (optional)

nd

The rank of the low rank approximation

eps

The convergence criterion

delta.init

Initial value for the scalar adjustment (zero by default)

q.init

Initial values for the column adjustments (a vector or zeroes by default)

itmax

Maximum number of iterations of the algorithm

verbose

Print information or not

Author

Jan Graffelman (jan.graffelman@upc.edu)

Details

Program FitRDeltaQSym implements an iterative algorithm for the low rank factorization of the correlation matrix. It decomposes the correlation matrix as R = delta J + 1 q' + G G' + E. The approximation of R is ultimately asymmetric, but the low rank factorization used for biplotting (G G') is symmetric.

References

Graffelman, J. and De Leeuw, J. (2023) Improved approximation and visualization of the correlation matrix. The American Statistician pp. 1--20. Available online as latest article tools:::Rd_expr_doi("10.1080/00031305.2023.2186952")

See Also

wAddPCA,ipSymLS,Keller

Examples

Run this code
data(HeartAttack)
X <- HeartAttack[,1:7]
X[,7] <- log(X[,7])
colnames(X)[7] <- "logPR"
R <- cor(X)
W <- matrix(1, 7, 7)
diag(W) <- 0
out.sym <- FitRDeltaQSym(R, W, eps=1e-6) 
Rhat <- out.sym$Rhat

Run the code above in your browser using DataLab