It is often desirable to created modified versions of an OM for testing purposes such as series of robustness tests or to evaluate whether an MP is performing as expected under ideal conditions.
openMSE
includes several functions for this purpose.
The tinyErr
function
The tinyErr
function can be used to remove observation, implementation, and process error, as well as any gradients in life-history parameters. For example, we first create an Operating Model using some example Stock, Fleet, Obs, and Imp objects :
OM <- new("OM", Albacore, Generic_IncE, Imprecise_Biased, Overages)
Notice that our OM includes process error in the life-history parameters, as well as observation and implementation error:
OM@Perr # recruitment process error
## [1] 0.15 0.30
OM@Msd # inter-annual variability in M
## [1] 0.0 0.1
OM@Cobs # error in observations
## [1] 0.2 0.6
OM@TACFrac # implementation error in TAC
## [1] 1.1 1.2
The tinyErr
function will remove all sources of uncertainty and variability:
OM2 <- tinyErr(OM)
## Removing all Observation Error
## Removing all Implementation Error
## Removing all Process Error
## Removing all Gradients
OM2@Perr # no recruitment process error
## [1] 0 0
OM2@Msd # no inter-annual variability in M
## [1] 0 0
OM2@Cobs # very low observation error
## [1] 0.00 0.05
OM2@TACFrac # no implementation error
## [1] 1 1
The obs
, imp
, and proc
arguments to the tinyErr
function can be used to control which sources of error and variability to remove from the OM. See ?tinyErr
for more details.
The Replace
function
The can be used to replace individual Stock
, Fleet
, Obs
, or Imp
components in an Operating Model.
For example, to replace the Stock
object in an OM we provide Replace
with a new Stock object:
OM1 <- new("OM", Albacore, Generic_DecE, Generic_Obs, Overages)
OM2 <- Replace(OM1, Blue_shark, Name="Blue_shark OM based on OM1")
## Replacing sub-model: Stock
Likewise, to replace any of the other OM components:
OM1 <- new("OM", Albacore, Generic_DecE, Generic_Obs, Overages)
OM2 <- Replace(OM1, Generic_IncE, Name="OM1 with new Fleet")
## Replacing sub-model: Fleet
OM3 <- Replace(OM2, Perfect_Info, Name="OM2 with new Obs")
## Replacing sub-model: Obs
OM4 <- Replace(OM3, Perfect_Imp, Name="OM2 with new Imp")
## Replacing sub-model: Imp