Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jolly and Hampton (1990) documentation updates #281

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ sphinx:
extra_extensions: [
'sphinx_automodapi.automodapi',
'numpydoc',
# 'sphinx.ext.autodoc',
'sphinx.ext.autodoc',
'sphinxcontrib.bibtex',
'sphinx.ext.intersphinx',
'sphinx.ext.mathjax',
Expand Down
Binary file removed docs/images/abundance_to_nasc_conversion.jpg
Binary file not shown.
Binary file removed docs/images/aged_abundance_apportionment.jpg
Binary file not shown.
Binary file not shown.
Binary file removed docs/images/aged_all_sex_number_proportion.jpg
Binary file not shown.
Binary file not shown.
Binary file removed docs/images/biomass_to_abundance_conversion.jpg
Binary file not shown.
Binary file removed docs/images/core_data_structure.jpg
Binary file not shown.
Binary file removed docs/images/example_indexing.jpg
Binary file not shown.
Binary file removed docs/images/initial_biomass_summation.jpg
Binary file not shown.
Binary file removed docs/images/length_age_sex_stratification.jpg
Binary file not shown.
Binary file removed docs/images/length_age_stratification.jpg
Binary file not shown.
Binary file removed docs/images/length_sex_stratification.jpg
Binary file not shown.
Binary file removed docs/images/length_stratification.jpg
Binary file not shown.
Binary file removed docs/images/total_apportioned_abundance.jpg
Binary file not shown.
Binary file removed docs/images/unaged_abundance_apportionment.jpg
Binary file not shown.
Binary file removed docs/images/unaged_all_sex_number_proportion.jpg
Binary file not shown.
Binary file not shown.
133 changes: 79 additions & 54 deletions docs/theory/apportion_abundance.md

Large diffs are not rendered by default.

125 changes: 103 additions & 22 deletions docs/theory/stratification.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,42 +78,123 @@ $$
\sum_{s,\ell,\alpha} L^i_{s,\alpha,\ell} = 1
$$

## Jolly-Hampton (1990) stratified sampling
This analysis provides a coefficient of variation ($\textit{CV}$) for the entire survey by reweighting biomass estimates for $k$ based on the length of each transect $t$ stratified by $i$ to derive estimates of the mean and variance. The first step is summing biomass estimates for each $k$ within each $t$:

$$
B^t =
\sum_{k} B^{k,t}
\label{eq:biomass_transect} \tag{1}
$$

Total transect distance $d_{x,y}^t$ for each $t$ is similarly computed:

$$
d_{x,y}^t =
\sum_{k} d_{x,y}^{k,t}
\label{eq:distance_transect} \tag{2}
$$

These transect distances are then summed for each $i$:

$$
D_{x,y} =
\sum_{t} d_{x,y}^{t}
\label{eq:distance_stratum} \tag{3}
$$

Values of $B^t$ $\eqref{eq:biomass_transect}$, $d_{x,y}^t$ $\eqref{eq:distance_transect}$, and $D_{x,y}$ $\eqref{eq:distance_stratum}$ are then all used to compute the mean transect-length-weighted biomass estimates for each $i$:

$$
\tilde{\rho} =
\frac{\sum\limits_{t} B^t d_{x,y}^t}{D_{x,y}}
\label{eq:mean_estimate} \tag{4}
$$

Next $B^t$ $\eqref{eq:biomass_transect}$ for each $t$ is standardized to provide a mean biomass-per-distance estimate:

$$
\tilde{\rho}^{~t} =
\frac{B^t}{d_{x,y}^{t}}
\label{eq:transect_estimate} \tag{5}
$$

which can then be used to compute the squared deviation from the mean along with $\tilde{\rho}$ $\eqref{eq:mean_estimate}$ for each $t$ within $i$:

$$
\tilde{s}^{~t} =
(\tilde{\rho}^{~t} - \tilde{\rho})^2
\label{eq:squared_deviation} \tag{6}
$$

This can then be used to calculate the sum of weighted squared deviations:

<!-- ## Jolly-Hampton (1990) stratified sampling
$$
\tilde{s} =
\sum\limits_{t} w_t^{2} \tilde{s}^t
\label{eq:summed_squared_deviation} \tag{7}
$$

where the stratified weights ($w_t$) for each $t$ are:

$$
w_t =
\frac{d_{x,y}^t}{\bar{D}_{x,y}}
\label{eq:stratified_weights} \tag{8}
$$

The variance ($\tilde{\sigma}$) for each $i$ is then calculated:

$$
\tilde{\sigma} =
\frac{\tilde{s}}{\nu}
\label{eq:variance} \tag{9}
$$

Mean density for stratum $i$:
where the $\nu$ represents the degrees of freedom:

$$
\hat{ \rho }_{A,B}^{ i } =
\frac{1}{ n^{ i } }
\sum\limits_{i=0}^{n^{i} } w^{i,j} \hat{ \rho }_{A,B}^{ i,j,k}
\begin{equation}
\nu =
\begin{cases}
n^t(n^t-1), & \text{if } n^t > 1 \\
(n^t)^2, & \text{if } n^t = 1
\end{cases}
\tag{10} \label{eq:dof}
\end{equation}
$$

where $w^{i,j}$ is the transect weight calculated via:
Variance estimates for each $i$ are then weighted by the total area ($A$) for $i$ to compute the overall (weighted) survey variance:

$$
w^{i,j} = \frac{
d(x,y)^{i,j}
}{
\frac{1}{n^{i}}
\sum\limits_{j=1}^{n^{i}} d(x,y)^{i,j}
}
\hat{\sigma} =
\sum\tilde{\sigma} A^2
\label{eq:weighted_variance} \tag{11}
$$

where $d(x,y)^{i,j}$ is the transect length of $n^{i}$ transects within each stratum.
This procedure is then repeated by using the different areas ($A^{i}$) of each stratum to
weight the final $\hat{ \rho }_{A,B}$ estimate:
where:

$$
\hat{ \rho }_{A,B} =
\frac{
\sum\limits_{i} A_{i} \hat{ \rho_{A,B}^{ i } }
}{
\sum\limits_{i} A_{i}
}
$$ -->
A =
\sum\limits_k A^k
\label{eq:transect_area} \tag{12}
$$

Similar to the weighted variance estimates $\eqref{eq:weighted_variance}$, biomass estimates for each $i$ were also weighted by $A$ to calculate the overall (weighted) survey mean:

$$
\hat{\mu} =
\sum \tilde{\rho} A
\label{eq:weighted_mean} \tag{13}
$$

The overall survey variance $\eqref{eq:weighted_variance}$ and mean $\eqref{eq:weighted_mean}$ are then both used to calculate $\textit{CV}$:

$$
\textit{CV} =
\frac{\sqrt{\hat{\sigma}}}{\hat{\mu}}
\label{eq:cv} \tag{14}
$$

## Stratification schemes used in the hake survey
For Pacific hake, two types of stratifications are used:
Expand Down