Chapter 12 Modifying the OM
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.
DLMtool includes several functions for this purpose.
12.1 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 built-in OM Components:
Notice that our OM includes process error and gradients in life-history parameters, as well as observation and implementation error:
## [1] 0.15 0.30
## numeric(0)
## [1] 0.2 0.6
## [1] 1.1 1.2
By default the tinyErr
function will remove all sources of uncertainty and variability:
## Removing all Observation Error
## Removing all Implementation Error
## Removing all Process Error
## Removing all Gradients
## [1] 0 0
## [1] 0 0
## [1] 0.00 0.05
## [1] 1 1
The obs
, imp
, proc
, and grad
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.
12.2 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
## Replacing sub-model: Obs
## Replacing sub-model: Imp