could not compute modification indices; information matrix is singular. error message, sem with formative dependant variable in Rstudio I'm trying to build a covariance-based structural equation model, more precisely a mediation model, using both reflective and formative specifications of latent variables. The purpose of that mediation modal, is to verify if the association between SS and PTGtot is mediated by the mediators STRAP and STRAN (both mediators in the same model).meda, medb, medc and medd are the name of the links. We want to do that by considering SS and PTGtot as reflective constructs and STRAP and STRAN as formative constructs.

my_model <- 
  "PTGtot =~ PTGav + PTGnp + PTGro + PTGps + PTGsc
   SS     =~ SSSres + SSSris
   STRAP <~ SAac + SAv + SApr + SAp + SAh + SAa + SAr
   STRAN <~ SAsd + SAde + SAsu + SAbd + SAsb

   STRAP ~ meda*SS
   PTGtot ~ medb*STRAP
   STRAN ~ medc*SS
   PTGtot ~ medd*STRAN
   PTGtot ~ dir*SS

   indirect1 := meda*medb
   indirect2 := medc*medd
   total := dir+indirect1+indirect2"

model<- lavaan::sem(
  model = my_model,
  data = SIM_final,
  estimator = "MLR",
  missing = "fiml")

When I tried the code above, it gave me no error message. But when I tried to verify my fit indices:
lavaan::summary(model, 
                standardized = TRUE, 
                fit.measures = TRUE, 
                rsquare = TRUE,
                ci = TRUE)

It gives me the following message in output, while providing me my fit indices:
lavaan 0.6-10 did NOT end normally after 2333 iterations
** WARNING ** Estimates below are most likely unreliable

So, based on this post:How to use formative indicators in covariance-based SEM with lavaan?  I tried the next code by fixing some parameters and estimating some covariances, arbitrarily:
model<- lavaan::sem(model =
                      "PTGtot=~1*PTGav+PTGnp+PTGro+PTGps+PTGsc
SS=~1*SSSres+SSSris
STRAP<~1*SAac+SAv+SApr+SAp+SAh+SAa+SAr
STRAN<~1*SAsd+SAde+SAsu+SAbd+SAsb

STRAP~meda*SS
PTGtot~medb*STRAP
STRAN~medc*SS
PTGtot~medd*STRAN
PTGtot~ dir*SS

SS ~~ 1*SS
PTGtot ~~ 1*PTGtot

indirect1 := meda*medb
indirect2 := medc*medd
total := dir+indirect1+indirect2",
                    data = SIM_final,
                    estimator = "MLR",
                    missing = "fiml")

The model is identified, and I don't get any error message when I check my fit indices. But when I try to verify the modification indices:
lavaan::modindices(model, 
                   sort. = TRUE)

Its gives me the next message error:
Error in lavaan::modindices(model, sort. = TRUE) : 
  lavaan ERROR: could not compute modification indices; information matrix is singular.

Does anyone knows how to fix the last error message? I specify that none of my variables are perfectly correlated (r=1). I thought that the problem might be the missing values in some data (149 missing values) , but technically full information maximum likelihood estimation is suppose to help to "manage" the missing values (from what I understood).
Furthermore, let me know if anyone see a more intuitive way to write my syntax. This is my first mixed model with formative and reflective constructs, so it is quite possible that there is some things that I wrote something that is not necessary.
There is the code without the mediation part:
library(lavaan)
model <- ' 
# latent variable definitions
PTGtot=~PTGav+PTGnp+PTGro+PTGps+PTGsc
SS=~SSSres+SSSris
STRAP<~SAac+SAv+SApr+SAp+SAh+SAa+SAr
STRAN<~SAsd+SAde+SAsu+SAbd+SAsb
# regression
STRAP~meda*SS
PTGtot~medb*STRAP
STRAN~medc*SS
PTGtot~medd*STRAN
PTGtot~ dir*SS
# variance
   
    '
summary(fit <- sem(model, data=SIM_final))

It gives me the next error message:
lavaan 0.6-10 did NOT end normally after 2835 iterations
** WARNING ** Estimates below are most likely unreliable

Thanks in advance.

To anyone who is interested in testing signular matrix (or rather for the lavaan library error mentioned in the post) - I prepared a dataset with exactly such data and the code for the model.
Here's dataset
Here's sample model and code
df <- read.csv("singular.csv", sep=';')
model = "f1 =~ q1 + q6\nf2 =~ q2 + q7\nf3 =~ q3 + q8\nf4 =~ q4 + q9\nf5 =~ q5 + q10"
fit <-cfa(model, data=df)
modificationindices(fit, power = TRUE, op = "=~", delta = .4)

And You have modification indices error with singular matrix.
Of course - this is not the only possible case, as this error can be related to many different aspects of the model, or problems not so much with the specification of the model as with the data itself.
However, as there is little evidence for this problem, I have decided to fill this gap. Note that for this data, the model does not de facto find a solution in the short iterative work path (set by default):
> optimizer warns that a solution has NOT been found!

even if You change iterations like this:
fit <-cfa(model, data=df, control=list(iter.max=5000, iter.max=5000))

and
summary(fit)

gives nothing but NA. Anyway - You can test it and learn from it. Good luck. :)
