Learn R Programming

MSEtool

The Management Strategy Evaluation toolkit (MSEtool) is the core package in the openMSE collection of packages. It contains the core functions for constructing operating models, simulating fishery dynamics, and evaluating the effectiveness of alternative management strategies using closed-loop simulation testing.

You can learn more about the openMSE packages at the openMSE documentation site.

Installation

You can install the released version of MSEtool from CRAN with:

install.packages("MSEtool")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("Blue-Matter/MSEtool")

Copy Link

Version

Install

install.packages('MSEtool')

Monthly Downloads

397

Version

3.7.3

License

GPL-3

Maintainer

Adrian Hordyk

Last Published

November 22nd, 2024

Functions in MSEtool (3.7.3)

CheckDuplicate

Check for duplicated MPs names
CalculateQ

Optimize for catchability (q)
CheckOM

Check OM object is complete
CalcAsymptoticDist

Calculates the asymptotic distribution from an initial distribution vector (V) and a markov movement matrix (M) (rows sum to 1)
CalcMPDynamics

Calculate population dynamics from MP recommendation
Can

Identify management procedures (MPs) based on data availability
ChkYrs

Check the years to summarize performance
Choose

Manually map parameters for the historical period of operating model
CombineMMP

Create a blank MP recommendations object (class Rec) of the right dimensions
DFO_quant

Department of Fisheries and Oceans biomass quantile plot
DFO_hist

Department of Fisheries and Oceans historical plot
DFO_plot

Department of Fisheries and Oceans trade-off plot
Converge

Check Convergence
DFO_spider

DFO performance spider plot (top three MPs)
Cos_thresh_tab

Current default thresholds for COSEWIC satisficing
DFO_tab

Create a standard DFO performance table
DFO_proj

Department of Fisheries and Oceans projection plot
DataInit

Initialize Data Input Files
DFO_plot2

Department of Fisheries and Oceans default plot 2
CheckMPs

Check that specified MPs are valid and will run on MSEtool::SimulatedData
DFO_bar

Department of Fisheries and Oceans stock status bar plot
Cplot

Plot the median biomass and yield relative to last historical year
DFO_report

Create a standard DFO MSE report
Atlantic_mackerel

Data class objects
Data-class

Class 'Data'
Data2csv

Converts a Data object into a .csv data file
FMSYref

Reference management procedures
Fease

MP feasibility diagnostic
DataSlots

DataSlots
DataDescription

DataDescription
DFO_tab_formatted

A formatted version of the standard DFO performance plot, color coded by thresholds
Hist-class

Class 'Hist'
Herm-int

Internal Herm functions
DLMDataDir

Directory of the installed package on your computer
FleetDescription

FleetDescription
DecE_Dom

Fleet class objects
Fleet-class

Class 'Fleet'
MPCalcsNAs

Fill any NAs arising from MPCalcs (hermaphroditism mode)
Data_xl

Read in Data object from Excel spreadsheet
ML2D

Depletion and F estimation from mean length of catches
Dom

Determine dominate MPs
DataDir

Directory of the data in the installed package on your computer
ImpDescription

ImpDescription
HistMICE

Reconstruct historical dynamics
HistDescription

HistDescription
GenerateRandomWalk

Creates a time series per simulation that has a random normal walk with sigma
MMSE-class

Class 'MMSE'
NIL

Item in list: get the list values from a list of lists
MSEextra

Load more data from MSEextra package
NOAA_plot

National Oceanographic and Atmospheric Administration default plot 1
MPtype

Management Procedure Type
Emp

A flexible empirical management procedure.
Input

Function to run a set of input control methods
Albacore_TwoFleet

MOM class objects
MSEDescription

MSEDescription
Overages

Imp class objects
MOM-class

Class 'MOM'
OMinit

Initialize Operating Model
NAor0

Is a value NA or zero.
OMexample

Copy example OM XL and OM Documentation
MSYCalcs

Internal function to calculate MSY Reference Points
Kplot

KOBE plot: a projection by projection plot of F/FMSY and B/BMSY
LH2OM

Predict missing life-history parameters
Pplot

A projection by projection plot of F/FMSY and B/BMSY
Pplot2

A projection by projection plot of F/FMSY, B/BMSY, B/B0, and yield
LHdatabase

LHdatabase
PWhisker

Performance Whisker Plot
Obs-class

Class 'Obs'
Generic_Obs

Obs class objects
PerformanceMetric

Performance Metrics Methods
Required

What management procedures need what data
L2A

Length to age conversion
ResFromRel

Returns Results of a set of MICE relationships
OMDescription

OMDescription
Lag_Data

Lag the time-series slots in a Data object by a specified number of time-steps
PMobj-class

An object for storing data for analysis using data-limited methods
Imp-class

Class 'Imp'
Sub

Subset MSE object by management procedure (MP) or simulation.
StockDescription

StockDescription
SampleFleetPars

Sample Fleet Parameters
PMLimit

Create a table of Performance Limits and Performance Objectives
Replace

Replace an existing Stock, Fleet, Obs, or Imp object
MPurl

Get help topic URL
MSE-class

Class 'MSE'
Report

Generate a Data Report
SIL

Slot in list: get the slot values from a list of objects
SS2Data

Reads data Stock Synthesis file structure into a Data object using package r4ss
ObsDescription

ObsDescription
LinInterp

Linear interpolation of a y value at level xlev based on a vector x and y
Rec-class

Class 'Rec'
TEG

Tom's expand grid
ReqData

ReqData
Taxa_Table

Taxa_Table
Range

Standardize values
SketchFun

Manually map the historical relative fishing effort trajectory.
Splot

Standard MSE projection plot
OMdoc

Generate OM Documentation Report
testOM

OM class objects
XL2Stock

Import Stock Object from Excel file
XL2OM

Load OM from Excel file
XL2Data

Import a Data object from Excel file
TAC

Calculate TAC recommendations for more than one MP
VOI2

Calculate Value Of Information 2
SampleImpPars

Sample Implementation Error Parameters
cparscheck

Internal function for checking that the OM@cpars is formatted correctly
XL2Fleet

Import Fleet Object from Excel file
TACfilter

TAC Filter
TradePlot

Generic Trade-Plot Function
Thresh_tab

Current default thresholds for DFO satisficing
SSBrefplot

Plot Spawning stock biomass and reference points for both historical and projected period
VOIplot

Yet another Value of Information Plot
Albacore

Stock class objects
SampleCpars

Sample custom pars
VOI

Calculate Value Of Information
calcProb

Calculate Probability
OM-class

Class 'OM'
genSizeCompWrap

Wrapper for C++ function to generate length composition
getmov2

Optimization function to find a movement model that matches user specified movement characteristics modified for Rcpp.
checkMSE

Utility functions for MSE objects
char.log-class

Class union for isRel slot
Stock-class

Class 'Stock'
getDataList

Get part of an MP specific data-list
calcRefYield

Calculate Reference Yield
getBlow

Blow parallel optimization function
getq_multi_MICE

Optimize for catchability (q) and fishing dist for a MICE model
getAFC

Calculate age at first capture from length at first capture and growth
joinData

Join Data objects present in a list
join_plots

Plot several plots with a shared legend
OneRep

Make stochastic variables certain for only one rep
SubOM

Subset a Stock, Fleet, Obs, or Imp object from an OM object
dnormal

Double-normal selectivity curve
cv

Calculate CV from vector of values
doHCR

Hockey Stick Harvest control rule that modifies TAC.
SimulateMOM

Run a multi-fleet multi-stock Management Strategy Evaluation
iSCAM2OM

Reads MPD or MCMC estimates and data from iSCAM file structure into an operating model
SubCpars

Subset the cpars slot in an operating model
SampleObsPars

Sample Observation Parameters
SampleStockPars

Sample Stock parameters
ldim

Dimensions of a hierarchical list object
hist2

Wrapper for histogram function
hconv

Stock recruit parameterization
multiDataS

Combine data among stocks
getsel

Calculate selectivity curve
iSCAMcomps

Combines all iSCAM age composition data across fleets
getnIVs

Count independent variables for a MICE relationship at position x in a Rel list
WHAM2OM

Takes a fitted SAM model and samples historical population and fishing dynamics from the MLE fit and variance-covariance matrix.
optMSY_eq

Internal wrapper function to calculate MSY reference points (now using MSYCalcs)
plot.MMSE

Standard plot for an object of class MMSE (multi MSE)
optQ

Optimize q for a single simulation
applyMP

Apply Management Procedures to an object of class Data
doRec

Calculate a management recommendation given constraints
iSCAMinds

Combines indices into a single index using linear modelling (** Deprecated **)
avail

What objects of this class are available
doIfreq

Create indices that are sampled at various frequencies
makeMOM

Utility for making multi-OMs
makeTransparent

Make colors transparent
makeRel

MICE relationships for multi-OM
popdynOneMICE

Population dynamics for a MICE model (single year)
label.class-class

Label class union for performance metric objects
hrate

Derives the rate of exchange from one sex to another based on asymptotic fraction
makemov

Calculates movement matrices from user inputs for fraction in each area (fracs) and probability of staying in areas (prob)
Sense

Sensitivity analysis
RealFease

MP feasibility diagnostic using real data
makemov2

Calculates movement matrices from user inputs for fraction in each area (fracs) the relative fraction moving to other areas, plus a mean probability of staying in any given area.
movestockCPP

Apply the movement model to the stock for one time-step
popdynMICE

Population dynamics for a MICE model (multiyear)
plot.pars

Plot Operating Model Object
plot.MOM

Standard plot for an object of class MOM
iSCAM

Reads iSCAM files into a hierarchical R list object
plotOFL

A generic OFL plot for NOAA use
plotFun

Print out plotting functions
SimulatedData

SimulatedData Data
multidebug

A basic comparison of runMSE output (MSE) and multiMSE (MMSE)
optCPU

Determine optimal number of cpus
runMP

Run a Management Procedure
plotRel

Plot a relationship between stocks
smoothy

General purpose polynomial smoother
sample_steepness2

Sample steepness given mean and cv
Simulate

Run a Management Strategy Evaluation
Uses

Find the Management Procedures that use a particular data slot
SS2MOM

Import Stock Synthesis to MOM (2-sex multi-fleet) or OM (single-sex, single-fleet)
SS2DataMOM

Reads data Stock Synthesis file structure into a nested Data object analogous with multiMSE
plot.MSE

Plot MSE object
initialize-methods

~~ Methods for Function initialize ~~
summary,Data-method

Summary of Data object
alphaconv

Calculate parameters for beta distribution from mean and standard deviation in normal space
replic8

Enlarge (replicate) a DLM data object to create an additional dimension for simulation / sensitivity testing
qestMICE

Internal function for optimizing catchability (q) for a MICE model
tinyErr

Remove observation, implementation, and process error
runCOSEWIC

COSEWIC MSE run using the correct MPs and projected time horizon
quantile_plot

A quantile plot
trlnorm

Lognormal distribution
simmov2

Calculates movement matrices from user specified distribution among other areas
runInMP

Runs input control MPs on a Data object.
validcpars

Valid custom parameters (cpars)
simmov

Calculates movement matrices from user inputs
tune_MP

Tune MP
select_MP

Select DataList for an MP from MMSE@PPD
Turing

Turing Test
getEffhist

Calculate historical fishing mortality
movfit_Rcpp

Rcpp version of the Optimization function that returns the squared difference between user specified and calculated movement parameters.
applyMMP

Apply multi Management Procedures (class MMP) to a hierarchical list of Data class objects
boxplot.Data

Boxplot of TAC recommendations
multiData

Combine data among fleets
getclass

get object class
getMP

Search R session for MP
calcMean

Calculate Mean Probability
getfirstlev

Extract the first dimension of a hierarchical list of recommendation objects
popdynOneTScpp

Aging and Mortality for one time-step
optYield

Optimize yield for a single simulation
setup

Setup parallel processing
simCAL

Simulate Catch-at-Length Data
writeCSV

Internal function to write CSVs for objects
prob.class-class

Prob class union for performance metric objects
plotquant

A fairly tidy time-series quantile plot
plot.Data

Plot Data object
popdynCPP

Population dynamics model in CPP
show,PMobj-method

Show the output of a PM
simCAA

Simulate Catch-at-Age Data
summary,MMSE-method

Summary of MMSE object
sdconv

Get parameters of lognormal distribution from mean and standard deviation in normal space
plotmulti

A basic SSB plot for debugging runMSE output
show,Rec-method

Show the output of a single MP recommendation
show-MSEtool

Show MSEtool S4 objects
summary,MSE-method

Summary of MSE object
wormplot

Biomass wormplot
ASAP2OM

Convert ASAP 3 assessments into an operating model
BAM2MOM

Import a multi-stock, multi-fleet OM from a BAM object
BlankSelPlot

Internal function to create a blank plot for mapping selectivity at length
CSRAfunc

Optimization function for CSRA
Assess2MOM

Reads bootstrap estimates from a stock assessment model into a multi-fleet operating model.
CSRA

Catch at size reduction analysis
Blow_opt

Blow internal parallel optimization function
CALsimp

Simplifies the CAL slot of data object
Awatea2OM

Reads MCMC estimates from Awatea (Paul Starr) processed r file structure into an operating model
Assess2OM

Reads bootstrap estimates from a stock assessment model (including VPA) into an operating model. Assess2OM is identical to VPA2OM.