Learn R Programming

semPower (version 2.1.1)

getF.Sigma: getF.Sigma

Description

Computes the minimum of the chosen fitting-function given the model-implied and the observed (or population) covariance matrix. The ML fitting function is: F_min = tr(S %*% SigmaHat^-1) - p + ln(det(SigmaHat)) - ln(det(S)). When a meanstructure is included, (mu - muHat)' SigmaHat^-1 (mu - muHat) is added. The WLS fitting function is: F_min = (Sij - SijHat)' V (Sij - SijHat) where V is the inverse of N times the asymptotic covariance matrix of the sample statistics (Gamma; N x ACOV(mu, vech(S))). For DWLS, V is the diagonal of the inverse of diag(NACOV), i.e. diag(solve(diag(Gamma))). For ULS, V = I. ULS has an unknown asymptotic distribution, so it is actually irrelevant, but provided for the sake of completeness.

Usage

getF.Sigma(SigmaHat, S, muHat = NULL, mu = NULL, fittingFunction = "ML")

Value

Returns Fmin

Arguments

SigmaHat

model implied covariance matrix

S

observed (or population) covariance matrix

muHat

model implied mean vector

mu

observed (or population) mean vector

fittingFunction

one of ML (default), WLS, DWLS, ULS