check_fit: Check fit for VAST model

View source: R/check_fit.R

check_fitR Documentation

Check fit for VAST model

Description

check_fit checks bounds and throws an informative message if any look bad

Usage

check_fit(parameter_estimates, check_gradients = FALSE, quiet = FALSE)

Arguments

parameter_estimates

output from fit_tmb

check_gradients

Boolean stating whether to check bounds as well as other issues

quiet

Boolean stating whether to print warnings to terminal

Details

If check_fit identifies an issue in estimated parameters, then the model structure should typically be changed. Recommended model changes differ somewhat for univariate and multivariate models as explained below.

For univariate models:

  • If ln_H_input are approaching extreme values (i.e., > 5 or < -5), then turn consider turning off anisotropy, make_data(..., Aniso=FALSE)

  • If L_beta1_z is approaching zero (i.e., +/- 0.001), then turn off random-effects for temporal variation in the first intercept RhoConfig["Beta1"]=3

  • If L_beta2_z is approaching zero (i.e., +/- 0.001), then turn off random-effects for temporal variation in the first intercept RhoConfig["Beta2"]=3

  • If L_omega1_z is approaching zero (i.e., +/- 0.001), then turn off spatial effects for the 1st linear predictor FieldConfig["Omega1"]=0

  • If L_omega2_z is approaching zero (i.e., +/- 0.001), then turn off spatial effects for the 1st second predictor FieldConfig["Omega2"]=0

  • If L_epsilon1_z is approaching zero (i.e., +/- 0.001), then turn off spatio-temporal effects for the 1st linear predictor FieldConfig["Epsilon1"]=0

  • If L_epsilon2_z is approaching zero (i.e., +/- 0.001), then turn off spatio-temporal effects for the 1st second predictor FieldConfig["Epsilon2"]=0

  • If Beta_rho1_f is approaching one (i.e., > 0.999), then turn consider reducing to a random-walk structure for the intercept of the 1st linear predictor RhoConfig["Beta1"]=2

  • If Beta_rho2_f is approaching one (i.e., > 0.999), then turn consider reducing to a random-walk structure for the intercept of the 2st linear predictor RhoConfig["Beta2"]=2

  • If Epsilon_rho1_f is approaching one (i.e., > 0.999), then turn consider reducing to a random-walk structure for spatio-temporal variation of the 1st linear predictor RhoConfig["Epsilon1"]=2

  • If Epsilon_rho2_f is approaching one (i.e., > 0.999), then turn consider reducing to a random-walk structure for spatio-temporal variation of the 2nd linear predictor RhoConfig["Epsilon2"]=2

For multivariate models, these same principles apply, but there are more options to simplify model structure. For example, if any L_beta1_z is approaching zero (i.e., +/- 0.001), then consider using ⁠fit_model(...,Map=[custom-map])⁠ to turn off individual parameters; or if using a factor model then reduce the number of factors by decreasing FieldConfig["Beta1"]

Value

Did an automated check find an obvious problem code (TRUE is bad; FALSE is good)


James-Thorson/VAST documentation built on Jan. 31, 2024, 12:13 p.m.