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

459

Version

3.7.4

License

GPL-3

Maintainer

Adrian Hordyk

Last Published

June 4th, 2025

Functions in MSEtool (3.7.4)

CSRAfunc

Optimization function for CSRA
CSRA

Catch at size reduction analysis
BlankSelPlot

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

Identify management procedures (MPs) based on data availability
CheckMPs

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

Check the years to summarize performance
CalculateQ

Optimize for catchability (q)
CheckOM

Check OM object is complete
Choose

Manually map parameters for the historical period of operating model
CheckDuplicate

Check for duplicated MPs names
DFO_bar

Department of Fisheries and Oceans stock status bar plot
DFO_hist

Department of Fisheries and Oceans historical plot
CalcMPDynamics_MF

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

Calculate population dynamics from MP recommendation
CalcAsymptoticDist

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

Current default thresholds for COSEWIC satisficing
Cplot

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

Department of Fisheries and Oceans projection plot
DFO_quant

Department of Fisheries and Oceans biomass quantile plot
DFO_report

Create a standard DFO MSE report
DLMDataDir

Directory of the installed package on your computer
DFO_tab

Create a standard DFO performance table
Atlantic_mackerel

Data class objects
DFO_spider

DFO performance spider plot (top three MPs)
Data-class

Class 'Data'
Data2csv

Converts a Data object into a .csv data file
DataInit

Initialize Data Input Files
Dom

Determine dominate MPs
DataSlots

DataSlots
Data_xl

Read in Data object from Excel spreadsheet
DFO_plot2

Department of Fisheries and Oceans default plot 2
DFO_plot

Department of Fisheries and Oceans trade-off plot
DataDir

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

DataDescription
Fleet-class

Class 'Fleet'
FleetDescription

FleetDescription
Converge

Check Convergence
DFO_tab_formatted

A formatted version of the standard DFO performance plot, color coded by thresholds
CombineMMP

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

MP feasibility diagnostic
Emp

A flexible empirical management procedure.
FMSYref

Reference management procedures
HistMICE

Reconstruct historical dynamics
GenerateRandomWalk

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

Function to run a set of input control methods
Kplot

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

ImpDescription
MPCalcsNAs

Fill any NAs arising from MPCalcs (hermaphroditism mode)
ML2D

Depletion and F estimation from mean length of catches
HistDescription

HistDescription
Imp-class

Class 'Imp'
DecE_Dom

Fleet class objects
MOM-class

Class 'MOM'
Hist-class

Class 'Hist'
MMSE-class

Class 'MMSE'
Lag_Data

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

Linear interpolation of a y value at level xlev based on a vector x and y
LHdatabase

LHdatabase
Overages

Imp class objects
NOAA_plot

National Oceanographic and Atmospheric Administration default plot 1
L2A

Length to age conversion
MSYCalcs

Internal function to calculate MSY Reference Points
MSEextra

Load more data from MSEextra package
ObsDescription

ObsDescription
Obs-class

Class 'Obs'
OMdoc

Generate OM Documentation Report
MSEDescription

MSEDescription
Albacore_TwoFleet

MOM class objects
MSE-class

Class 'MSE'
NIL

Item in list: get the list values from a list of lists
Herm-int

Internal Herm functions
NAor0

Is a value NA or zero.
Replace

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

Initialize Operating Model
OMexample

Copy example OM XL and OM Documentation
Pplot2

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

MP feasibility diagnostic using real data
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
Report

Generate a Data Report
testOM

OM class objects
Range

Standardize values
Rec-class

Class 'Rec'
SS2MOM

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

Make stochastic variables certain for only one rep
StockDescription

StockDescription
SampleStockPars

Sample Stock parameters
Stock-class

Class 'Stock'
Sub

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

Taxa_Table
SubCpars

Subset the cpars slot in an operating model
Thresh_tab

Current default thresholds for DFO satisficing
Sense

Sensitivity analysis
MPtype

Management Procedure Type
LH2OM

Predict missing life-history parameters
SIL

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

Obs class objects
SubOM

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

Performance Whisker Plot
MPurl

Get help topic URL
OMDescription

OMDescription
SampleCpars

Sample custom pars
OM-class

Class 'OM'
WHAM2OM

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

Returns Results of a set of MICE relationships
PMobj-class

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

Create a table of Performance Limits and Performance Objectives
TAC

Calculate TAC recommendations for more than one MP
XL2Data

Import a Data object from Excel file
PerformanceMetric

Performance Metrics Methods
VOI2

Calculate Value Of Information 2
calcProb

Calculate Probability
VOIplot

Yet another Value of Information Plot
calcRefYield

Calculate Reference Yield
boxplot.Data

Boxplot of TAC recommendations
getDataList

Get part of an MP specific data-list
XL2OM

Load OM from Excel file
XL2Fleet

Import Fleet Object from Excel file
SampleFleetPars

Sample Fleet Parameters
SampleImpPars

Sample Implementation Error Parameters
getBlow

Blow parallel optimization function
calcMean

Calculate Mean Probability
getclass

get object class
Splot

Standard MSE projection plot
Required

What management procedures need what data
Pplot

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

Wrapper for C++ function to generate length composition
ReqData

ReqData
getAFC

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

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

Sample Observation Parameters
TACfilter

TAC Filter
Albacore

Stock class objects
iSCAMinds

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

Extract the first dimension of a hierarchical list of recommendation objects
initialize-methods

~~ Methods for Function initialize ~~
hconv

Stock recruit parameterization
hist2

Wrapper for histogram function
addMMPs

Utility functions for multiMSE objects
applyMP

Apply Management Procedures to an object of class Data
VOI

Calculate Value Of Information
Uses

Find the Management Procedures that use a particular data slot
cparscheck

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

Tom's expand grid
char.log-class

Class union for isRel slot
checkMSE

Utility functions for MSE objects
TradePlot

Generic Trade-Plot Function
Turing

Turing Test
XL2Stock

Import Stock Object from Excel file
joinData

Join Data objects present in a list
cv

Calculate CV from vector of values
join_plots

Plot several plots with a shared legend
SSBrefplot

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

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

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

Combine data among fleets
optYield

Optimize yield for a single simulation
iSCAMcomps

Combines all iSCAM age composition data across fleets
plot.Data

Plot Data object
applyMMP

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

Calculate selectivity curve
multiDataS

Combine data among stocks
plotquant

A fairly tidy time-series quantile plot
getq_multi_MICE

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

Population dynamics model in CPP
select_MP

Select DataList for an MP from MMSE@PPD
sdconv

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

SimulatedData Data
optMSY_eq

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

A basic SSB plot for debugging runMSE output
plotRel

Plot a relationship between stocks
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
smoothy

General purpose polynomial smoother
plot.MMSE

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

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

Create indices that are sampled at various frequencies
avail

What objects of this class are available
quantile_plot

A quantile plot
qestMICE

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

Calculate a management recommendation given constraints
getmov2

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

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

Derives the rate of exchange from one sex to another based on asymptotic fraction
plot.MOM

Standard plot for an object of class MOM
simCAL

Simulate Catch-at-Length Data
simCAA

Simulate Catch-at-Age Data
plotFun

Print out plotting functions
movestockCPP

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

Population dynamics for a MICE model (multiyear)
summary,Data-method

Summary of Data object
runCOSEWIC

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

Calculates movement matrices from user inputs
replic8

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

A generic OFL plot for NOAA use
simmov2

Calculates movement matrices from user specified distribution among other areas
iSCAM

Reads iSCAM files into a hierarchical R list object
SketchFun

Manually map the historical relative fishing effort trajectory.
makeMOM

Utility for making multi-OMs
doHCR

Hockey Stick Harvest control rule that modifies TAC.
dnormal

Double-normal selectivity curve
getEffhist

Calculate historical fishing mortality
getMP

Search R session for MP
makemov

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

Make colors transparent
ldim

Dimensions of a hierarchical list object
popdynOneMICE

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

Label class union for performance metric objects
tune_MP

Tune MP
validcpars

Valid custom parameters (cpars)
summary,MMSE-method

Summary of MMSE object
summary,MSE-method

Summary of MSE object
tinyErr

Remove observation, implementation, and process error
trlnorm

Lognormal distribution
wormplot

Biomass wormplot
writeCSV

Internal function to write CSVs for objects
makeRel

MICE relationships for multi-OM
plot.MSE

Plot MSE object
Simulate

Run a Management Strategy Evaluation
plot.pars

Plot Operating Model Object
setup

Setup parallel processing
show,PMobj-method

Show the output of a PM
sample_steepness2

Sample steepness given mean and cv
runMP

Run a Management Procedure
runInMP

Runs input control MPs on a Data object.
multidebug

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

Determine optimal number of cpus
show-MSEtool

Show MSEtool S4 objects
prob.class-class

Prob class union for performance metric objects
popdynOneTScpp

Aging and Mortality for one time-step
show,Rec-method

Show the output of a single MP recommendation
Assess2OM

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

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

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

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

Convert ASAP 3 assessments into an operating model
CALsimp

Simplifies the CAL slot of data object
Blow_opt

Blow internal parallel optimization function