estSigmaI {scape} | R Documentation |
Estimate Abundance Index Sigma
Description
Estimate the effective sigma (magnitude of observation noise) for a survey or commercial abundance index, based on the empirical standard deviation.
Usage
estSigmaI(model, what="s", series=NULL, init=NULL, FUN=mean, p=1,
digits=2)
Arguments
model |
fitted |
what |
which effective sigma to estimate: |
series |
vector of strings indicating which gears or surveys to analyze (all by default). |
init |
initial sigma, determining the relative pattern of the effective sigmas between years. |
FUN |
function to use when scaling a vector of sigmas. |
p |
effective number of parameters estimated in the model. |
digits |
number of decimal places to use when rounding, or
|
Details
The 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
the following:
NULL
means read the initial sigmas from the existing
CV
column (default).- model
means read the initial sigmas from the
CV
column in that model (object of classscape
).- numeric vector
means those are the initial sigmas (same length as the number of years).
FALSE
or1
means use one effective sigma (
\hat sigma
) across all years.
The idea behind FUN=mean
is to guarantee that regardless of the
value of init
, the mean effective sigma will always be the
same. Other functions can be used to a similar effect, such as
FUN=median
.
Value
Numeric vector of effective sigmas (one value if init=1
), or a
list of such vectors when analyzing multiple series.
Note
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
estN
and 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
converge. The 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:
\hat\sigma=\sqrt{\frac{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.
See Also
getN
, getSigmaI
, getSigmaR
,
estN
, estSigmaI
, and estSigmaR
extract and estimate sample sizes and sigmas.
iterate
combines all the get*
and est*
functions in one call.
plotIndex
shows what is behind the sigma estimation.
scape-package
gives an overview of the package.
Examples
## 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