genPhi: Create a random Phi matrix with maximum factor correlation

View source: R/genPhi.R

genPhiR Documentation

Create a random Phi matrix with maximum factor correlation

Description

Create a random Phi matrix with maximum factor correlation.

Usage

genPhi(NFac, EigenValPower = 6, MaxAbsPhi = 0.5)

Arguments

NFac

Number of factors.

EigenValPower

(Scalar > 1) A scalar than controls the positive skewness of the distribution of eigenvalues of Phi.

MaxAbsPhi

(Scaler in [0,1]) The maximum off diagonal of Phi (the factor correlation matrix).

Value

A factor correlation matrix. Note that the returned matrix is not guaranteed to be positive definite. However, a PD check is performed in simFA so that simFA always produces a PD Phi matrix.

Author(s)

Niels Waller

Examples


NFac <- 5
par(mfrow=c(2,2))
  for(i in 1:4){
     R <- genPhi(NFac, 
               EigenValPower = 6, 
               MaxAbsPhi = 0.5)
               
    L <- eigen(R)$values
    plot(1:NFac, L, 
        type="b",
        ylab = "Eigenvalues of Phi",
        xlab = "Dimensions",
        ylim=c(0,L[1]+.5))
  }


fungible documentation built on May 29, 2024, 8:28 a.m.