Skip to content

model convergence #333

Closed
Closed

Description

@brandmaier

I am looking for a standardized way to get a status of convergence. Can I do something like converged(fitted) that returns a boolean? This is important for simulation studies.

Activity

  1. brandmaier commented on Jul 9, 2026

    @brandmaier
    ContributorAuthor

    I understand that this is optimizer-dependent. Still, couldn't we implement a default way to access the Optim result status for standard models?

  2. Maximilian-Stefan-Ernst commented on Jul 9, 2026

    @Maximilian-Stefan-Ernst
    Collaborator

    The SemFit object is currently documented as

    help?> SemFit
    search: SemFit SemFIML Sem edit SemML SemRidge @edit Set SemWLS exit
    
      SemFit
    
      Fitted structural equation model.
    
      Interfaces
      ≡≡≡≡≡≡≡≡≡≡
    
        •  minimum(::SemFit) -> minimum objective value
    
        •  solution(::SemFit) -> parameter estimates
    
        •  start_val(::SemFit) -> starting values
    
        •  model(::SemFit)
    
        •  optimization_result(::SemFit)
    
        •  algorithm_name(::SemFit) -> optimization algorithm
    
        •  n_iterations(::SemFit) -> number of iterations
    
        •  convergence(::SemFit) -> convergence flags
    
        •  converged(::SemFit) -> convergence success

    so the function "converged" is what you are looking for. This relies on the flags of the used backend, and might be different for each backend. Other convergence properties has to be computed manually atm (heywood cases, for example).

  3. brandmaier commented on Jul 9, 2026

    @brandmaier
    ContributorAuthor

    Perfect! Thanks, @Maximilian-Stefan-Ernst

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions