Sanity check of sdmTMB model

sanity(fit, se_ratio = 10, gradient_thresh = 0.001)

Arguments

fit

Fitted model from sdmTMB()

se_ratio

SE ratio to abs(parameter values) to issue warning

gradient_thresh

Gradient threshold to issue warning

Value

An invisible named list of checks

Examples

fit <- sdmTMB(
  present ~ s(depth),
  data = pcod_2011, mesh = pcod_mesh_2011,
  family = binomial()
)
sanity(fit)
#>  Non-linear minimizer suggests successful convergence
#>  Hessian matrix is positive definite
#>  No extreme or very small eigen values detected
#>  No gradients with respect to fixed effects are >= 0.001
#>  No fixed-effect standard errors are NA
#>  No fixed-effect standard errors look unreasonably large
#>  No sigma parameters are < 0.01
#>  No sigma parameters are > 100
#>  Range parameter doesn't look unreasonably large

s <- sanity(fit)
#>  Non-linear minimizer suggests successful convergence
#>  Hessian matrix is positive definite
#>  No extreme or very small eigen values detected
#>  No gradients with respect to fixed effects are >= 0.001
#>  No fixed-effect standard errors are NA
#>  No fixed-effect standard errors look unreasonably large
#>  No sigma parameters are < 0.01
#>  No sigma parameters are > 100
#>  Range parameter doesn't look unreasonably large
s
#> $hessian_ok
#> [1] TRUE
#> 
#> $eigen_values_ok
#> [1] TRUE
#> 
#> $nlminb_ok
#> [1] TRUE
#> 
#> $range_ok
#> [1] TRUE
#> 
#> $gradients_ok
#> [1] TRUE
#> 
#> $se_magnitude_ok
#> [1] TRUE
#> 
#> $se_na_ok
#> [1] TRUE
#> 
#> $sigmas_ok
#> [1] TRUE
#> 
#> $all_ok
#> [1] TRUE
#>