Possible BUG - "the optimizer warns that a solution has not been found"

32 views
Skip to first unread message

Daniel Rosoff

unread,
Apr 9, 2026, 3:55:11 PM (12 days ago) Apr 9
to Genomic SEM Users
Hi all, 
 I updated my GenomicSEM last week prior to trying TSEM.  Having never used it before, I got NAs for 40% of the genes with the following error: lavaan->lav_lavaan_step11_estoptim():  \n   the optimizer warns that a solution has NOT been found!  For the rest, I got the following warning: lavaan->lav_lavaan_step11_estoptim():  \n   the optimizer (NLMINB) claimed the model converged, but not all elements of the gradient are (near) \n   zero; the optimizer may not have found a local solution use check.gradient = FALSE to skip this check.  

Ok thought that was TSEM.  I was rechecking some GSEMs already run earlier using the same script I used when running them.  Of a sample of 1000 snps, more than 50% came back NA (with the "NOT been found") and of the rest some came back with the warning  (and several with the negative variance warning but I get that).    I went back to check the full GSEM multivariate GWASs already run, and never got the NAs NOT been found.  

The script I used successfully (on my computer prior to updated GenomicSEM) and on cluster was: res <- 

  userGWAS(

    covstruc        = LDSCoutput,

    SNPs            = DT_1k,

    model           = model_bifactor_strict_3spec,

    sub             = sub,

    parallel        = FALSE,

    cores           = 2,

    Q_SNP           = TRUE,

    fix_measurement = TRUE,

    GC              = "none",

    smooth_check    = TRUE,

    toler           = 1e-60

  ).  I have gone through the issues on this, and found "SNP order causing an error" .  I have tried parallel = T and parallel = F.  (GC does matter.  standard with parallel = T and parallel = F gave me 70% fails.  toler = 1e-60 or 1e-30 made no difference). 

I use a MacBook Pro 16 cores.  Maybe my OS (Catalina 10.15.7) is too old for the updated GenomicSEM. 

Any help would be very much appreciated. 

Thanks, 

Dan

Michel Nivard

unread,
Apr 9, 2026, 3:57:12 PM (12 days ago) Apr 9
to Daniel Rosoff, Genomic SEM Users
Hi Dan,

What lavaan version are you on?


All the best,
Michel

Op do 9 apr 2026 om 21:55 schreef Daniel Rosoff <daniel...@alumni.brown.edu>
--
You received this message because you are subscribed to the Google Groups "Genomic SEM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to genomic-sem-us...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/genomic-sem-users/2f91bc13-65f6-44cc-b4ba-2f87e346935an%40googlegroups.com.

Daniel Rosoff

unread,
Apr 9, 2026, 4:18:13 PM (12 days ago) Apr 9
to Genomic SEM Users
Hey Michel, 0.6-21 and GenomicSEM 0.0.5.  Dan

Michel Nivard

unread,
Apr 10, 2026, 6:42:21 AM (12 days ago) Apr 10
to Genomic SEM Users
Does setting  fix_measurement = FALSE resolve the issue?
Reply all
Reply to author
Forward
0 new messages