Skip to contents

Lightweight function to check if the optimization converged properly. Uses information already computed during estimation (zero overhead).

Usage

synthdid_converged(estimate)

Arguments

estimate

A synthdid_estimate object

Value

Logical indicating whether optimization converged

Examples

# \donttest{
data(california_prop99)
setup <- panel.matrices(california_prop99)
tau.hat <- synthdid_estimate(setup$Y, setup$N0, setup$T0)

# Quick convergence check
synthdid_converged(tau.hat)
#> [1] FALSE

# If FALSE, get more details
if (!synthdid_converged(tau.hat)) {
  synthdid_convergence_info(tau.hat)
}
#> Synthdid Convergence Diagnostics
#> =================================
#> 
#> Overall Status: NOT CONVERGED 
#> 
#> Lambda weights optimization:
#>  converged iterations max_iter utilization
#>      FALSE      10000    10000      100.0%
#> 
#> Omega weights optimization:
#>  converged iterations max_iter utilization
#>      FALSE      10000    10000      100.0%
#> 
#> Recommendation: Consider increasing max.iter or relaxing min.decrease threshold.
# }