Learn R Programming

Correlplot (version 1.1.3)

rmse.rxy: Calculate RMSE of a Low-rank Approximation to the Between-set Correlation Matrix

Description

Function rmse.rxy calculates the root-mean-squared error (RMSE) of a low-rank approximation to the between-set correlation matrix.

Usage

rmse.rxy(Rxy, Rhat, R, C)

Value

The RMSE

Arguments

Rxy

The between-set correlation matrix.

Rhat

The low-rank approximation to the between-set correlation matrix.

R

The weight matrix for the rows.

C

The weight matrix for the columns.

Author

Jan Graffelman (jan.graffelman@upc.edu)

Details

By default, weighting by generalised least squares is assumed, and weight matrices R and C must be supplied. The RMSE according to an ordinary least squares criterion can be obtained by setting R = diag(nrow(Rxy)) and C = diag(ncol(Rxy)).

References

Graffelman, J. and De Leeuw, J. (2023) Improved approximation and visualization of the correlation matrix. The American Statistician 77(4): 432-442. tools:::Rd_expr_doi("10.1080/00031305.2023.2186952")

See Also

rmse

Examples

Run this code
  data(achievement)
  X <- achievement[,1:3]
  Y <- achievement[,4:ncol(achievement)]
  Rxy  <- cor(X,Y)
  Rxx  <- cor(X)
  Ryy  <- cor(Y)
  out.delta <- FitRxy(Rxy,solve(Rxx),solve(Ryy),
                  adjust="delta",eps=1e-08,
                  verbose=FALSE)
  Rxy.hat <- out.delta$delta
  rmse.rxy(Rxy,Rxy.hat,R=solve(Rxx),C=solve(Ryy))

Run the code above in your browser using DataLab