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

2,734

Version

3.7.5

License

GPL-3

Maintainer

Adrian Hordyk

Last Published

September 30th, 2025

Functions in MSEtool (3.7.5)

Can

Identify management procedures (MPs) based on data availability
CheckMPs

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

Calculate population dynamics from MP recommendation for multi-fleet operating models
CalculateQ

Optimize for catchability (q)
CheckDuplicate

Check for duplicated MPs names
DFO_plot2

Department of Fisheries and Oceans default plot 2
DFO_plot

Department of Fisheries and Oceans trade-off plot
DFO_quant

Department of Fisheries and Oceans biomass quantile plot
CheckOM

Check OM object is complete
DFO_proj

Department of Fisheries and Oceans projection plot
CombineMMP

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

Department of Fisheries and Oceans historical plot
DFO_bar

Department of Fisheries and Oceans stock status bar plot
DFO_spider

DFO performance spider plot (top three MPs)
DFO_report

Create a standard DFO MSE report
Data2csv

Converts a Data object into a .csv data file
CalcAsymptoticDist

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

Manually map parameters for the historical period of operating model
Converge

Check Convergence
ChkYrs

Check the years to summarize performance
Data-class

Class 'Data'
CalcMPDynamics

Calculate population dynamics from MP recommendation
DataDescription

DataDescription
DataDir

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

Function to run a set of input control methods
Fease

MP feasibility diagnostic
DecE_Dom

Fleet class objects
Kplot

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

Directory of the installed package on your computer
DataInit

Initialize Data Input Files
DataSlots

DataSlots
Atlantic_mackerel

Data class objects
Fleet-class

Class 'Fleet'
Cos_thresh_tab

Current default thresholds for COSEWIC satisficing
DFO_tab_formatted

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

Class 'Imp'
GenerateRandomWalk

Creates a time series per simulation that has a random normal walk with sigma
ImpDescription

ImpDescription
FleetDescription

FleetDescription
MPCalcsNAs

Fill any NAs arising from MPCalcs (hermaphroditism mode)
LinInterp

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

Class 'MOM'
Cplot

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

Create a standard DFO performance table
Dom

Determine dominate MPs
Data_xl

Read in Data object from Excel spreadsheet
NAor0

Is a value NA or zero.
NIL

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

Depletion and F estimation from mean length of catches
Herm-int

Internal Herm functions
LHdatabase

LHdatabase
Lag_Data

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

OM class objects
NOAA_plot

National Oceanographic and Atmospheric Administration default plot 1
MSYCalcs

Internal function to calculate MSY Reference Points
MSEextra

Load more data from MSEextra package
MSE-class

Class 'MSE'
MSEDescription

MSEDescription
PMLimit

Create a table of Performance Limits and Performance Objectives
OneRep

Make stochastic variables certain for only one rep
OMinit

Initialize Operating Model
PMobj-class

An object for storing data for analysis using data-limited methods
Overages

Imp class objects
L2A

Length to age conversion
Emp

A flexible empirical management procedure.
FMSYref

Reference management procedures
HistMICE

Reconstruct historical dynamics
MPtype

Management Procedure Type
Albacore_TwoFleet

MOM class objects
Hist-class

Class 'Hist'
MMSE-class

Class 'MMSE'
HistDescription

HistDescription
PWhisker

Performance Whisker Plot
OM-class

Class 'OM'
OMDescription

OMDescription
SS2Data

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

Reads data Stock Synthesis file structure into a nested Data object analogous with multiMSE
LH2OM

Predict missing life-history parameters
PerformanceMetric

Performance Metrics Methods
OMexample

Copy example OM XL and OM Documentation
OMdoc

Generate OM Documentation Report
Sense

Sensitivity analysis
SampleStockPars

Sample Stock parameters
Pplot

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

ReqData
Replace

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

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

MP feasibility diagnostic using real data
SSBrefplot

Plot Spawning stock biomass and reference points for both historical and projected period
Rec-class

Class 'Rec'
Generic_Obs

Obs class objects
Report

Generate a Data Report
Required

What management procedures need what data
Splot

Standard MSE projection plot
TradePlot

Generic Trade-Plot Function
VOI2

Calculate Value Of Information 2
Albacore

Stock class objects
Turing

Turing Test
VOIplot

Yet another Value of Information Plot
char.log-class

Class union for isRel slot
MPurl

Get help topic URL
ObsDescription

ObsDescription
SampleImpPars

Sample Implementation Error Parameters
SubCpars

Subset the cpars slot in an operating model
SampleObsPars

Sample Observation Parameters
Sub

Subset MSE object by management procedure (MP) or simulation.
Obs-class

Class 'Obs'
checkMSE

Utility functions for MSE objects
iSCAM

Reads iSCAM files into a hierarchical R list object
Thresh_tab

Current default thresholds for DFO satisficing
hrate

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

Taxa_Table
XL2OM

Load OM from Excel file
getDataList

Get part of an MP specific data-list
XL2Fleet

Import Fleet Object from Excel file
getBlow

Blow parallel optimization function
alphaconv

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

Sample custom pars
getq_multi_MICE

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

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

Calculate Value Of Information
Uses

Find the Management Procedures that use a particular data slot
calcProb

Calculate Probability
getsel

Calculate selectivity curve
Range

Standardize values
SampleFleetPars

Sample Fleet Parameters
Stock-class

Class 'Stock'
iSCAM2OM

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

Combines all iSCAM age composition data across fleets
makeTransparent

Make colors transparent
StockDescription

StockDescription
SIL

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

Returns Results of a set of MICE relationships
TACfilter

TAC Filter
TEG

Tom's expand grid
XL2Stock

Import Stock Object from Excel file
calcRefYield

Calculate Reference Yield
addMMPs

Utility functions for multiMSE objects
genSizeCompWrap

Wrapper for C++ function to generate length composition
applyMMP

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

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

Stock recruit parameterization
hist2

Wrapper for histogram function
iSCAMinds

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

Combine data among fleets
movfit_Rcpp

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

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

~~ Methods for Function initialize ~~
optMSY_eq

Internal wrapper function to calculate MSY reference points (now using MSYCalcs)
movestockCPP

Apply the movement model to the stock for one time-step
plot.MSE

Plot MSE object
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.
optQ

Optimize q for a single simulation
SketchFun

Manually map the historical relative fishing effort trajectory.
SimulatedData

SimulatedData Data
plot.pars

Plot Operating Model Object
doIfreq

Create indices that are sampled at various frequencies
doRec

Calculate a management recommendation given constraints
sample_steepness2

Sample steepness given mean and cv
sdconv

Get parameters of lognormal distribution from mean and standard deviation in normal space
summary,MMSE-method

Summary of MMSE object
summary,Data-method

Summary of Data object
popdynOneTScpp

Aging and Mortality for one time-step
SubOM

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

Calculate TAC recommendations for more than one MP
print.multiHist

Print method for multiHist objects
WHAM2OM

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

Import a Data object from Excel file
plotFun

Print out plotting functions
plotOFL

A generic OFL plot for NOAA use
boxplot.Data

Boxplot of TAC recommendations
multiDataS

Combine data among stocks
getfirstlev

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

get object class
simmov2

Calculates movement matrices from user specified distribution among other areas
avail

What objects of this class are available
applyMP

Apply Management Procedures to an object of class Data
calcMean

Calculate Mean Probability
cparscheck

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

Calculate CV from vector of values
doHCR

Hockey Stick Harvest control rule that modifies TAC.
dnormal

Double-normal selectivity curve
SimulateMOM

Run a multi-fleet multi-stock Management Strategy Evaluation
prob.class-class

Prob class union for performance metric objects
qestMICE

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

Search R session for MP
label.class-class

Label class union for performance metric objects
show-MSEtool

Show MSEtool S4 objects
show,PMobj-method

Show the output of a PM
getmov2

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

Calculate historical fishing mortality
ldim

Dimensions of a hierarchical list object
plot.MMSE

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

Standard plot for an object of class MOM
smoothy

General purpose polynomial smoother
validcpars

Valid custom parameters (cpars)
wormplot

Biomass wormplot
multidebug

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

Determine optimal number of cpus
popdynOneMICE

Population dynamics for a MICE model (single year)
popdynMICE

Population dynamics for a MICE model (multiyear)
runCOSEWIC

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

Count independent variables for a MICE relationship at position x in a Rel list
show,Rec-method

Show the output of a single MP recommendation
runInMP

Runs input control MPs on a Data object.
plotRel

Plot a relationship between stocks
simCAA

Simulate Catch-at-Age Data
join_plots

Plot several plots with a shared legend
plotmulti

A basic SSB plot for debugging runMSE output
joinData

Join Data objects present in a list
makeRel

MICE relationships for multi-OM
makeMOM

Utility for making multi-OMs
runMP

Run a Management Procedure
Simulate

Run a Management Strategy Evaluation
summary,MSE-method

Summary of MSE object
tinyErr

Remove observation, implementation, and process error
optYield

Optimize yield for a single simulation
plot.Data

Plot Data object
select_MP

Select DataList for an MP from MMSE@PPD
plotquant

A fairly tidy time-series quantile plot
popdynCPP

Population dynamics model in CPP
quantile_plot

A quantile plot
setup

Setup parallel processing
simCAL

Simulate Catch-at-Length Data
simmov

Calculates movement matrices from user inputs
trlnorm

Lognormal distribution
replic8

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

Tune MP
writeCSV

Internal function to write CSVs for objects
ASAP2OM

Convert ASAP 3 assessments into an operating model
CALsimp

Simplifies the CAL slot of data object
Assess2MOM

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

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

Import a multi-stock, multi-fleet OM from a BAM 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.
CSRAfunc

Optimization function for CSRA
CSRA

Catch at size reduction analysis
Blow_opt

Blow internal parallel optimization function