estSigmaI: Estimate Abundance Index Sigma

Description Usage Arguments Details Value Note See Also Examples

View source: R/estSigmaI.R

Description

Estimate the effective sigma (magnitude of observation noise) for a survey or commercial abundance index, based on the empirical standard deviation.

Usage

1
2
estSigmaI(model, what="s", series=NULL, init=NULL, FUN=mean, p=1,
          digits=2)

Arguments

model

fitted scape model containing element CPUE and/or Survey.

what

which effective sigma to estimate: "c"[ommercial] or "s"[urvey] abundance index.

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 NULL to suppress rounding.

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 class scape).

numeric vector

means those are the initial sigmas (same length as the number of years).

FALSE or 1

means use one effective sigma (sigmahat) 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:

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.

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

 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

scape documentation built on May 2, 2018, 1:04 a.m.