plotspmmod {MQMF} | R Documentation |
plotspmmod plots an spm model fit given parameters and data
Description
plotspmmod takes a parameter set and the spmdat matrix and plots the predicted depletion, catch, the CPUE and the model fit to CPUE. If plotprod=TRUE, it also plots the productivity curves
Usage
plotspmmod(
inp,
indat,
schaefer = TRUE,
limit = 0.2,
target = 0.48,
addrmse = FALSE,
fnt = 7,
plotout = TRUE,
vline = 0,
plotprod = FALSE,
maxy = 0
)
Arguments
inp |
a vector of model parameters at least (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 |
limit |
defaults to the Commonwealth limit of 0.2B0. |
target |
defaults to the Commonwealth target of 0.48B0. 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 |
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 |
vline |
defaults to 0 = no action but if a year is inserted, which should generally be between two years to designate some change in the time-series between two years, then a vertical line will be added on year-based plots |
plotprod |
if FALSE, the default, the productivity curves are not plotted. If TRUE, two extra plots are produced. |
maxy |
defaults to 0, if > 0 then that value will be used in the plot of CPUE |
Value
invisibly a list of dynamics, production curve, MSY, and Bmsy
Examples
data(dataspm)
pars <- log(c(0.264,4740,3064,0.2))
ans <- plotspmmod(pars,dataspm,schaefer=TRUE,plotprod=TRUE)
best <- nlm(negLL,pars,funk=simpspm,indat=dataspm,
logobs=log(dataspm[,"cpue"]),steptol=1e-05)
outfit(best,backtran = TRUE)
ans <- plotspmmod(best$estimate,dataspm,schaefer=TRUE,plotout=TRUE,
plotprod=FALSE,addrmse=TRUE)
str(ans)