Estimate the effective sigma (magnitude of observation noise) for a survey or commercial abundance index, based on the empirical standard deviation.
which effective sigma to estimate:
vector of strings indicating which gears or surveys to analyze (all by default).
initial sigma, determining the relative pattern of the effective sigmas between years.
function to use when scaling a vector of sigmas.
effective number of parameters estimated in the model.
number of decimal places to use when rounding, or
init sigmas set a fixed pattern for the relative sigmas
between years. For example, if there are two years of abundance index
data and the initial sigmas are 0.1 in year 1 and 0.2 in year 2, the
effective sigma will be two times greater in year 2 than in year 1,
although both will be scaled up or down depending on how closely the
model fits the abundance index. The value of
init can be one of
means read the initial sigmas from the existing
CV column (default).
means read the initial sigmas from the
in that model (object of class
means those are the initial sigmas (same length as the number of years).
means use one effective sigma (sigmahat) across all years.
The idea behind
FUN=mean is to guarantee that regardless of the
init, the mean effective sigma will always be the
same. Other functions can be used to a similar effect, such as
Numeric vector of effective sigmas (one value if
init=1), or a
list of such vectors when analyzing multiple series.
This function uses the empirical standard deviation to estimate an effective sigma, which may be appropriate as likelihood weights for abundance index data. The better the model fits the data, the smaller the effective sigma.
estSigmaI can be used iteratively, along with
estSigmaR to assign likelihood
weights that are indicated by the model fit to the data. Sigmas and
sample sizes are then adjusted between model runs, until they
iterate function facilitates this procedure.
If rss is the residual sum of squares in log space, n is the number of abundance index data points, and p is the effective number of parameters estimated in the model, then the estimated effective sigma is:
sigmahat = sqrt(rss/(n-p))
There is no simple way to calculate p for statistical catch-at-age models. The default value of 1 is likely to underestimate the true magnitude of observation noise.
plotIndex shows what is behind the sigma estimation.
scape-package gives an overview of the package.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
## Exploring candidate sigmas: getSigmaI(x.cod) # sigma used in assessment 0.20 estSigmaI(x.cod) # model fit implies 0.17 plotIndex(x.cod) # model fit estSigmaI(x.cod, p=8) # eight estimated parameters implies 0.22 getSigmaI(x.sbw) # sigma used in assessment estSigmaI(x.sbw) # model fit implies smaller sigma estSigmaI(x.sbw, init=1) # could use 0.17 in all years ## Same mean, regardless of init: mean(estSigmaI(x.sbw, digits=NULL)) mean(estSigmaI(x.sbw, digits=NULL, init=1)) ## Same median, regardless of init: median(estSigmaI(x.sbw, FUN=median, digits=NULL)) median(estSigmaI(x.sbw, FUN=median, digits=NULL, init=1)) ## Multiple series: getSigmaI(x.oreo, "c") # sigma used in assessment getSigmaI(x.oreo, "c", digits=2) # rounded estSigmaI(x.oreo, "c") # model fit implies smaller sigma estSigmaI(x.oreo, "c", init=1) # could use 0.19 in all years estSigmaI(x.oreo, "c", init=1, digits=3) # series 2 slightly worse fit # estSigmaI(x.oreo, "c", init=1, p=11) # more parameters than datapoints getSigmaI(x.oreo, "c", series="Series 2-1") # get one series estSigmaI(x.oreo, "c", series="Series 2-1") # estimate one series
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.