simsem / semTools

Useful tools for structural equation modeling
74 stars 35 forks source link

add ICOMP information criteria #114

Closed maugavilla closed 1 year ago

maugavilla commented 1 year ago

add the Bozdogan Information Complexity (ICOMP) Criteria

TDJorgensen commented 1 year ago

Sorry, I lost track of this.
Are there any benchmarks against which you can verify your calculation produces ICOMP values on the correct scale? (e.g., results presented in the paper or using data that you can replicate?) I tried looking at the paper, but I could not tell whether the authors used unit information or total information. The asymptotic covariance matrix of estimated parameters (ACOV) is the inverse of total information (I believe unit information times N).

lavInspect(fit, "*.information.*") returns unit information. Notice in the sic() function (Line 396) that I had to multiply the inverse by N to get the total information, which is what is used in the penalty term. (However, I no longer use the sic() function, calculating SIC directly on Line 288.) Other information criteria in this function also use (inverted) total information, so I expect that's what ICOMP would use as well. However, the underlying math is different, such that ICOMP's penalty term apparently does not invert the information matrix. I would just want to be sure before making this a permanent addition to semTools::moreFitIndices().

maugavilla commented 1 year ago

Sure, the close example I got from Bonifay was that the package MuMIn has a funtion for it ICOMP().

When I compare my calculation with it, I get the same results, as in this example

library(lavaan) library(MuMIn)

HS.model <- ' visual =~ x1 + x2 + x3 textual =~ x4 + x5 + x6 speed =~ x7 + x8 + x9 '

obj <- cfa(HS.model, data = HolzingerSwineford1939) summary(fit, fit.measures = TRUE)

fit <- lavInspect(obj, "fit") f <- -2 fit["logl"] Fhatinv <- lavInspect(obj,"inverted.information.expected") s <- qr(Fhatinv)$rank C1 <- (s/2)log((sum(diag(Fhatinv)))/s)-.5log(det(Fhatinv)) f + 2C1

ICOMP(obj)