displayModel | R Documentation |
displayModel takes a set of parameters and the spmdat matrix and plots the predicted depletion, catch, the surplus production, and the CPUE and the model fit to CPUE,
displayModel(
inp,
indat,
schaefer = TRUE,
extern = FALSE,
limit = 0.2,
target = 0.48,
addrmse = FALSE,
filename = "",
resol = 200,
fnt = 7,
plotout = TRUE
)
inp |
a vector of model parameters (r,K,B0) |
indat |
a matrix with at least columns 'year', 'catch', and 'cpue' |
schaefer |
if TRUE, the default, then the Schaefer SPM is used. If FALSE then an approximate Fox SPM would be used |
extern |
defaults to FALSE, determines whether to plot the graphs in a separate window |
limit |
defaults to the Commonwealth limit of 0.2B0. |
target |
defaults to the Commonwealth target of 0.48B0. It determines the green line plotted on the exploitable biomass plot. |
addrmse |
default is FALSE but if set TRUE this will add the loess curve to the CPUE trend for comparison with the fitted line |
filename |
default is empty. If a filename is put here a .png file with that name will be put into the working directory. |
resol |
the resolution of the png file, defaults to 200 dpi |
fnt |
the font used in the plot and axes. Default=7, bold Times. Using 6 gives Times, 1 will give SansSerif, 2 = bold Sans |
plotout |
should one generate a plot or only do the calculations; default is TRUE |
invisibly a list of the dynamics, production curve, MSY, and Bmsy
## Not run:
data(dataspm)
fish <- dataspm$fish
glb <- dataspm$glb
plotfish(fish,glb)
pars <- c(0.264,4740,3064)
ans <- displayModel(pars,fish,schaefer=FALSE)
bestSP <- optim(par=pars,fn=negLL,callfun=simpspm,indat=fish,schaefer=FALSE)
outoptim(bestSP)
ans <- displayModel(bestSP$par,fish,schaefer=FALSE)
str(ans)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.