Skip to contents

Reads the results of run_daisie_ml() and compares model selection to determine sensitivity to different data input into the same model or set of models. The run_daisie_ml() results are expected to be located in sub folders within the results/ folder in the current working directory. These sub folders must have the same names as the elements of data_names.

Usage

sensitivity(data_names, full_output = FALSE, results_dir = NULL)

Arguments

data_names

A vector of strings with the names of the data sets you want to compare sensitivity.

full_output

A boolean determining whether the full model output is returned.

results_dir

A string with the path to the directory where results are to be stored or can be found. For example, if the data in question is (to be) stored in folder_with_res/$data_name, then results_dir should be "folder_with_res". Defaults to NULL, which indicates the default directories are to be used. Default directories are: * $HOME/results/$data_name if on the cluster * getwd()/results/$data_name if called from another environment If is.na(results_dir), then the object is returned to the R session and not saved to file.

Value

A list of 3 elements if full_output is FALSE, or of 4 elements if TRUE. The elements are as follows:

best_fit_sensitivity

A character vector of length one, which reports whether the best fit model is sensitive to the input.

model_selection_sensitivity

A character vector of length one, which reports whether the rank (or order) of the model selection is sensitive to the input.

model_selection_rank

A named list of as many elements as the there are models in data_names. Each named list contains a sorted named vector with the corresponding BIC value of each fit model. The sort is always ascending.

full_output

Only returned if full_output is TRUE. A named list with a similar structure as model_selection_rank. Instead of named vectors with the BIC values, however, the full run_daisie_ml() data frame output is returned. This is a one row data frame, with the parameter estimates, degrees of freedom, convergence information and BIC value.

Author

Joshua W. Lambert

Examples

if (FALSE) {
sensitivity(
  data_names = c("Azores", "Azores_alt_m"),
  full_output = FALSE
)
}