Skip to contents

There is an accessor function for each slot in the S4 class FIMSFit, where the function is named get_*() and the star can be replaced with the slot name, e.g., get_input(). These accessor functions are the preferred way to access objects stored in the available slots.

Usage

get_input(x)

# S4 method for class 'FIMSFit'
get_input(x)

get_report(x)

# S4 method for class 'FIMSFit'
get_report(x)

get_obj(x)

# S4 method for class 'FIMSFit'
get_obj(x)

get_opt(x)

# S4 method for class 'FIMSFit'
get_opt(x)

get_max_gradient(x)

# S4 method for class 'FIMSFit'
get_max_gradient(x)

get_gradient(x)

# S4 method for class 'FIMSFit'
get_gradient(x)

get_sdreport(x)

# S4 method for class 'FIMSFit'
get_sdreport(x)

get_convergence(x)

# S4 method for class 'FIMSFit'
get_convergence(x)

get_estimates(x)

# S4 method for class 'FIMSFit'
get_estimates(x)

get_number_of_parameters(x)

# S4 method for class 'FIMSFit'
get_number_of_parameters(x)

get_run_time(x)

# S4 method for class 'FIMSFit'
get_run_time(x)

get_version(x)

# S4 method for class 'FIMSFit'
get_version(x)

get_model_output(x)

# S4 method for class 'FIMSFit'
get_model_output(x)

Arguments

x

Output returned from fit_fims().

Value

get_input() returns the list that was used to fit the FIMS model, which is the returned object from setup_default_parameters().

get_report() returns the TMB report, where anything that is flagged as reportable in the C++ code is returned.

get_obj() returns the output from TMB::MakeADFun(). Its methods can use the FIMS model that is in memory instead of the model that made the fit. This happens after clear(), after another model is set up, or after the fit is read with readRDS(). The methods then return wrong values without an error. Use get_report(), get_gradient(), or get_estimates() instead. These return values stored during fitting.

get_opt() returns the output from nlminb(), which is the minimizer used in fit_fims().

get_max_gradient() returns the maximum gradient found when optimizing the model.

get_gradient() returns the per-parameter gradient vector at the MLE as stored during fitting. It reads a stored R vector, so it does not depend on the FIMS model in memory.

get_sdreport() returns the list from TMB::sdreport().

get_convergence() returns a tibble with one row per convergence check run by fit_fims(): check, severity ("OK", "NOTE" for a check that did not run, "WARN", or "FAIL"), value, threshold, parameter, and message. It has no rows when the model was not optimized.

get_estimates() returns a tibble of parameter values and their uncertainties from a fitted model. The year column contains calendar years; the age and length columns are the ages and length bins from the data. age is NA if populations have different ages, and both are NA for fits saved before they were added to the output. observed is NA for missing observations. The likelihood skips a composition year with any missing bin, so observed and estimated are NA for every bin of that year, and for every year of a fleet without composition data. The proportions are reported as agecomp_proportion and lengthcomp_proportion.

get_number_of_parameters() returns a vector of integers specifying the number of fixed-effect parameters and the number of random-effect parameters in the model.

get_run_time() returns the amount of time it took to run the model in seconds as a difftime object.

get_version() returns the package_version of FIMS that was used to fit the model.

get_model_output() returns the finalized FIMS output as a JSON list.