smoothBY | R Documentation |
Smooth a NPD correlation matrix to PD using the Bentler and Yuan method.
smoothBY(R, const = 0.98, eps = 0.001)
R |
Indefinite Matrix. |
const |
const is a user-defined parameter that is defined as k in Bentler and Yuan (2011). If 0 < const < 1, then const is treated as a fixed value. If const = 1 then the program will attempt to find the highest value of const such that R is positive (semi) definite. |
eps |
If const = 1 then the program will iteratively reduce const by eps until either (a) the program converges or (b) const < = 0. |
RBY |
smoothed correlation matrix. |
constant |
The final value of const. |
convergence |
(Logical) a value of TRUE indicates that the function converged. |
outStatus |
Convergence state for Rcsdp::csdp
function. |
glb |
Greatest lower bound reliability estimates. |
eps |
Default value (eps = 1E-03) or user-supplied value of eps. |
Code modified from that reported in Debelak, R. & Tran, U. S. (2011).
Bentler, P. M. & Yuan, K. H. (2011). Positive definiteness via off-diagonal scaling of a symmetric indefinite matrix. Psychometrika, 76(1), 119–123.
Debelak, R. & Tran, U. S. (2013). Principal component analysis of smoothed tetrachoric correlation matrices as a measure of dimensionality. Educational and Psychological Measurement, 73(1), 63–77.
data(BadRBY)
out<-smoothBY(R = BadRBY, const = .98)
cat("\nSmoothed Correlation Matrix\n")
print( round(out$RBY,8) )
cat("\nEigenvalues of smoothed matrix\n")
print( eigen(out$RBY)$val )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.