Chapter 2 A list of key functions in the r4Casal2
package
2.1 Accessor functions
get_derived_quanitites()
or for lazy people (like myself)get_dqs()
. These will return all the derived quantities for a model output.get_selectivities
will return a data frame with all the selectivity reports for a model output.get_selectivities_by_year
will return a data frame with all the reports of typeselectivity_by_year
from a model output.get_catchabilities
will return a data frame with all the catchability reports for a model output.get_fisheries
will return a data frame with information from aninstantaneous_mortality
process for a model output.get_BH_recruitment
will return a data frame with information from arecruitment_beverton_holt
process for a model output.get_abundance_observations
will return a data frame with information from anabundance
orbiomass
observation for a model output.get_composition_observations
will return a data frame with information from anproportion_at_length
,proportion_at_age
,process_removals_by_age
andprocess_removals_by_length
observation for a model output.get_composition_mean_bin
will return a data frame with information from anproportion_at_length
,proportion_at_age
,process_removals_by_age
andprocess_removals_by_length
summarised as the mean length or mean age.get_tag_recapture_observations
will return a data frame with information from antag_recapture_by_length_for_growth
,tag_recapture_by_length
andtag_recapture_by_age
observation for a model output.get_partition
will return a data frame with partition data frompartition
report.get_inital_partition
will return a data frame with initial partitioninitialisation_partition
report.get_profile
Will return a data frame for aprofile
report.get_estimated_values
Will return a data frame for aestimate_value
report.get_transformed_parameters
Will return a data frame for aparameter_transformations
report.get_timevarying_parameters
Will return a data frame for atime_varying
report.get_simulated_age_resids
Will reformat simulated data read in by theread.simulated.data
function.get_projections
will return a data frame of allprojection
reports from a model output.get_growth
will return a data frame of allage_length
report from a model output.get_covariance
will return a data frame of allcovariance_matrix
report from a model output.
2.2 Other useful functions
aggregate_objective_report
This reformats an objective function report to be “similar” to CASALs output.create_simulation_reports
This will create a range of@report.type=simulated_observation
Casal2 reports that can help set up simulations. See Section 7 on why you want to do this.build_assessment_bookdown
This will create a bookdown template for an assessment model MPD run.summarise_config
Will summarize input files see Section 3calculate_composition_stage_two_weights
Calculates the stage-two weights using Francis (2011) TA1.8 method.get_high_correlations
Returns index of parameters that have high correlations from MPD. This requires the Casal2 model to have reported thecorrelation_matrix
run_automatic_reweighting
Automatically apply iterative reweighting methods for a Casal2 modelextract_reweighted_mpds
extract all the reweighted mpds that are created byrun_automatic_reweighting
. Useful to then plot the effect of reweightingerror_value_table
Create a data.frame of all observations from a casal2 mpd run outlining likelihood type, observation type and error value by year and observation.summarise_estimated_parameters
If a model reportsestimate_summary
this function will extract two data frames that can be used to assess starting values and estimated values along with prior assumptions.plot_profile
Will plot profiles for reports that have been run withcasal2 -p
format.