srSim {FSATeach}  R Documentation 
Plots hypothetical number of recruits versus stock size for four parameterizations of the BevertonHolt and three parameterizations of the Ricker stockrecruit models. Slider bars are used to alter the parameters of each model.
srSim(S = NULL, R = NULL, data = NULL, type = c("BevertonHolt", "Ricker"), param = 1, max.S = 500, max.R = 1000)
S 
An optional vector containing observed numbers of spawning stock or a formula as described in the details. 
R 
An optional vector containing observed numbers of recruits. See details. 
data 
An optional data frame containing the
variables if 
type 
A single string indicating which stockrecruitment model to use. See details. 
param 
A single numeric indicating which
parameterization of the 
max.S 
A single numeric indicating the maximum
spawning stock to use for scaling the xaxis. Ignored if

max.R 
A single numeric indicating the maximum
recruitment to use for scaling the yaxis. Ignored if

This function can be used to explore the dynamics of
stockrecruitment models for various parameter choices.
In these instances of model exploration the S=
and
R=
arguments should be (left) set at NULL
.
This function can also be used to visually “fit” a
stockrecruit model to a set of observed stock and
recruitment data in order to determine reasonable
starting values for the nonlinear leastsquares fit of
the stockrecruit model. In this instance, observed data
are plotted by including the vectors of observed stock
sizes and recruits in a model of the form S~R
, in
conjunction with the data=
argument.
The type=
argument is used to choose either the
"BevertonHolt"
or "Ricker"
models.
Different parameterizations of these two models are
chosen with the param=
argument. Four
paramaterizations of the BevertonHolt model and three
parameterizations of the Ricker model are allowed. See
srModels
for a representation of each
parameterization.
None. However a dynamic graphic connected to slider bar controls of the ‘a’, ‘b’, or ‘Rp’ parameters specific to the chosen stockrecruit model.
srModels
if (interactive()) { # Defaults  BevertonHolt, first parameterization srSim() # BevertonHolt, second parameterization srSim(param=2) # Ricker model first parameterization srSim(type="Ricker") # Ricker model second parameterization srSim(type="Ricker", param=2) # Ricker model first parameterization with Norwegian Cod data from the FSA package library(FSA) data(CodNorwegian) srSim(recruits~stock,data=CodNorwegian,type="Ricker",param=1) } # end if interactive