pbs-assess / gftrends

Trends in Pacific Canadian groundfish stock status
0 stars 0 forks source link

Replace old convergence checks with sanity() #18

Open seananderson opened 1 year ago

seananderson commented 1 year ago

Replace

  both_converged <- all(
    (max(m1$gradients) < 0.005), (max(m2$gradients) < 0.005),
    !m1$bad_eig, !m2$bad_eig,
    m1$sd_report$pdHess, m2$sd_report$pdHess

Replace

(max(m$gradients) < 0.1 && !m$bad_eig && m$sd_report$pdHess

with

x <- sanity(model_name)
all(unlist(x))

note that sanity() returns FALSE with NULL or "try-error" to help out

seananderson commented 1 year ago

This is lower priority if we just want to leave it as is for now