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_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().

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. Unlike calling get_obj(x)[["gr"]](get_opt(x)[["par"]]) this function is safe to call after clear() because it reads from a stored R vector rather than the compiled C++ objective function.

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

get_estimates() returns a tibble of parameter values and their uncertainties from a fitted model. The year_i column is a position that starts at 1, and 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.

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.