plottrajectory: plottrajectory literally plots predicted trajectories

View source: R/cMSY_funs.R

plottrajectoryR Documentation

plottrajectory literally plots predicted trajectories

Description

plottrajectory plots out the predicted trajectories from those paramter combinations that have been accepted. In addition, and more importantly, it identifies those trajectories that succeeded and puts them into a smaller matrix than the complete set of trialed rK combinations and each of the successful trajectories. This can project a limited number of trajectories, determined by oneplot and plotall. If oneplot is true it does not matter what is in plotall, all trajectories are given in a single plot along with the median values in red. Similarly for the harvest rate

Usage

plottrajectory(
  inR1,
  years,
  catch,
  inparbound,
  scalar = 1000,
  Bmax = 2,
  oneplot = TRUE,
  plotout = TRUE,
  plotall = 7
)

Arguments

inR1

the output from run_cMST

years

the vector of years

catch

the vector of catches per year

inparbound

the set of parameter vectors that were successful

scalar

literally scales the catch to the same units as biomass; defaults to 1000 so as to convert Kg to tonnes.

Bmax

Deprecated. No longer used. Remove from any code will be depleted from later iterations of datalowSA

oneplot

Plot all trajectories on top of each other rather than individually. defaults to TRUE.

plotout

produce a plot or not? Defaults to TRUE

plotall

when oneplot=FALSE how many plots to generate; defaults to 7, which plots the successful trajectories from the first seven r-K pairs that had successful outcomes. Useful numbers are 7 and 15 as the total catch history is also illustrated along with the mean MSY to aid in understandig the trajectories. To see all trajectories set plotall=TRUE.

Value

a list of the yes/no vector and of the accepted rK pairs. This is returned invisibly.

Examples

## Not run: 
 data(invert)
 fish <- invert$fish 
 glb <- invert$glb 
 reps <- 5000  # one would run at least 20000, preferably more 
 answer <- run_cMSY(fish,glb,n=reps,sigpR=0.04) 
 summcMSY <- summarycMSY(answer,fish,final=TRUE) 
 # plotprep(width=8,height=5,newdev=FALSE)
 out <- plottrajectory(answer$R1,fish$year,fish$catch,answer$parbound,
                      oneplot=FALSE,scalar=1.0,plotout=TRUE,plotall=7)

## End(Not run)  #

haddonm/datalowSA documentation built on Nov. 5, 2023, 6:40 p.m.