if(!meanstructure){ fx <-(Sigma.hat.log.det + sum(data.cov *Sigma.hat.inv)- data.cov.log.det - nvar) }
In Bollen's book "Structural Equations With Latent Variables" (equation 8.29 on p. 334), he has the trace of (data.cov * Sigma.hat.inv) instead of the sum of all elements.
What's the reason for using sum(data.cov * Sigma.hat.inv) instead of sum(diag(data.cov * Sigma.hat.inv))?
Thanks,
Mark
Mark Seeto
unread,
May 9, 2019, 5:01:26 PM5/9/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to lavaan
Sorry, I just realised the answer to my question.
data.cov * Sigma.hat.inv is an elementwise product, not a matrix multiplication. Because these matrices are symmetric,