You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: break lines in .Rmd files at 72 chars #71
- uses vscode Rewrap extension
- required a little tinkering, but not much
* fix: line break in developer heading
Co-authored-by: Kathryn Doering <[email protected]>
Copy file name to clipboardExpand all lines: 01-code-of-conduct.Rmd
+23-6Lines changed: 23 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -2,22 +2,39 @@
2
2
3
3
## FIMS Contributor Conduct
4
4
5
-
All contributors participating and contributing to the FIMS project are expected to adhere to the [Contributor Covenant](https://www.contributor-covenant.org/version/2/1/code_of_conduct/). Briefly, these standards are adopted to ensure a positive and harassment-free enviroment for all participants. Examples of behavior that contributes to a positive environment for our community include:
5
+
All contributors participating and contributing to the FIMS project are
Briefly, these standards are adopted to ensure a positive and
9
+
harassment-free enviroment for all participants. Examples of behavior
10
+
that contributes to a positive environment for our community include:
6
11
7
12
* Demonstrating empathy and kindness toward other people
8
13
* Being respectful of differing opinions, viewpoints, and experiences
9
14
* Giving and gracefully accepting constructive feedback
10
-
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
11
-
* Focusing on what is best not just for us as individuals, but for the overall community
15
+
* Accepting responsibility and apologizing to those affected by our
16
+
mistakes, and learning from the experience
17
+
* Focusing on what is best not just for us as individuals, but for the
18
+
overall community
12
19
13
20
## Supporting Good Conduct
14
21
15
-
FIMS Community leaders will create default community health files (e.g. CONTRIBUTING, CODE_OF_CONDUCT) to be used in all repositories owned by FIMS.
22
+
FIMS Community leaders will create default community health files (e.g.
23
+
CONTRIBUTING, CODE_OF_CONDUCT) to be used in all repositories owned by
24
+
FIMS.
16
25
17
26
### Reporting Unacceptable Behavior
18
27
19
-
Questions about the FIMS Code of Conduct or reports of unacceptable behavior should be sent to [email protected]. Reports will be reviewed by a member of the NOAA Fisheries Office of Science and Technology who is not participating in the FIMS Project [Jim Berkson], but has the full support of FIMS Community Leaders. All reports will be reviewed promptly and fairly.
28
+
Questions about the FIMS Code of Conduct or reports of unacceptable
reviewed by a member of the NOAA Fisheries Office of Science and
31
+
Technology who is not participating in the FIMS Project [Jim Berkson],
32
+
but has the full support of FIMS Community Leaders. All reports will be
33
+
reviewed promptly and fairly.
20
34
21
35
### Consequences of Violating Conduct
22
36
23
-
People who violate the FIMS Contribute Conduct will face meaningful consequences, up to and including explusion from the FIMS Community. The Code of Conduct, as well as consequences for violations, apply equally to all participants.
37
+
People who violate the FIMS Contribute Conduct will face meaningful
38
+
consequences, up to and including explusion from the FIMS Community. The
39
+
Code of Conduct, as well as consequences for violations, apply equally
This section describes the implementation of the modules in FIMS in milestone 1. For the first milestone, we must implement enough complexity to adequately test a very standard population model. For this reason, we implement the minimum structure that can run the model described in [Li et al. 2020](). The product will be an age-structured integrated assessment model with two fleets (one survey, one fishery) and two sexes.
3
+
This section describes the implementation of the modules in FIMS in
4
+
milestone 1. For the first milestone, we must implement enough
5
+
complexity to adequately test a very standard population model. For this
6
+
reason, we implement the minimum structure that can run the model
7
+
described in [Li et al. 2020](). The product will be an age-structured
8
+
integrated assessment model with two fleets (one survey, one fishery)
9
+
and two sexes.
4
10
5
11
## Model variables and bounds
6
12
7
13
## Inherited functors from `TMB`
8
14
9
15
### Atomic functions
10
16
11
-
Wherever possible, `FIMS` should not reinvent atomic functions with extant definitions in `TMB`. If there is a need for a new atomic function the development team can add it to `TMB` using the `TMB_ATOMIC_VECTOR_FUNCTION()` macro following the instructions [here](https://kaskr.github.io/adcomp/_book/AtomicFunctions.html#example-adding-new-primitive-function-with-known-derivatives).
17
+
Wherever possible, `FIMS` should not reinvent atomic functions with
18
+
extant definitions in `TMB`. If there is a need for a new atomic
19
+
function the development team can add it to `TMB` using the
20
+
`TMB_ATOMIC_VECTOR_FUNCTION()` macro following the instructions
Where $R_t$ and $S_t$ are mean recruitment and spawning biomass in time $t$, $h$ is Mace-Doonan steepness, and $\phi_0$ are the unfished spawning biomass per recruit. The initial FIMS model will implement a static spawning biomass-per-recruit function, with the ability to overload the method in the future to allow for time-variation in mortality, maturity, and weight-at-age over time to account for changes in spawning biomass per recruit. Deviations are assumed to be lognormally distributed such that realized recruitment is the product of mean recruitment and the exponentiated recruitment deviation.
60
+
Where $R_t$ and $S_t$ are mean recruitment and spawning biomass in time
61
+
$t$, $h$ is Mace-Doonan steepness, and $\phi_0$ are the unfished
62
+
spawning biomass per recruit. The initial FIMS model will implement a
63
+
static spawning biomass-per-recruit function, with the ability to
64
+
overload the method in the future to allow for time-variation in
65
+
mortality, maturity, and weight-at-age over time to account for changes
66
+
in spawning biomass per recruit. Deviations are assumed to be
67
+
lognormally distributed such that realized recruitment is the product of
68
+
mean recruitment and the exponentiated recruitment deviation.
However, true $r_{dev,t}$ values are not known, so when using estimated recruitment deviations $\hat{r_{dev,t}}$ the following equation is applied to calculate mean unbiased recruitment $R*_t$ using a bias adjustment factor $b_y=\frac{E[SD(ry)]^2}{\sigma_R^2}$ (Methot and Taylor, 2011).
71
+
However, true $r_{dev,t}$ values are not known, so when using estimated
72
+
recruitment deviations $\hat{r_{dev,t}}$ the following equation is
73
+
applied to calculate mean unbiased recruitment $R*_t$ using a bias
74
+
adjustment factor $b_y=\frac{E[SD(ry)]^2}{\sigma_R^2}$ (Methot and
The recruitment function should take as input the $R$ , $S$ values, the $h$, $ln(R_0)$, and R parameters and $\phi_0$ and return mean and realized recruitment.
54
-
77
+
The recruitment function should take as input the $R$ , $S$ values, the
78
+
$h$, $ln(R_0)$, and R parameters and $\phi_0$ and return mean and
Where $C_{f,a,t}$ is the catch at age $a$ at time $t$ for fleet $f$, $F$ is instantaneous fishing mortality,
70
-
$M$ is assumed constant over ages and time in the minimum viable assessment model, $N_a,t$ is the number of
71
-
age $a$ fish at time $t$.
99
+
Where $C_{f,a,t}$ is the catch at age $a$ at time $t$ for fleet $f$, $F$
100
+
is instantaneous fishing mortality, $M$ is assumed constant over ages
101
+
and time in the minimum viable assessment model, $N_a,t$ is the number
102
+
of age $a$ fish at time $t$.
72
103
73
104
$$F_{a,t}=\sum_{a=0}^A s_{a,f,t}F$$
74
105
75
-
$s_a,f$ is selectivity at age $a$ for fleet $f$. Selectivity-at-age is constant over time.
106
+
$s_a,f$ is selectivity at age $a$ for fleet $f$. Selectivity-at-age is
107
+
constant over time.
76
108
77
-
Catch is in metric tons and survey is in number, so calculating catch weight ($CW_t$) is done as follows:
109
+
Catch is in metric tons and survey is in number, so calculating catch
110
+
weight ($CW_t$) is done as follows:
78
111
$$ CW_t=\sum_{a=0}^A C_{a,t}w_a $$
79
112
80
113
Survey numbers are calculated as follows
81
114
82
115
$$I_t=q\sum_{a=0}^AN_{a,t}$$
83
-
Where $I_t$ is the survey index and $q_t$ is survey catchability at time $t$.
116
+
Where $I_t$ is the survey index and $q_t$ is survey catchability at time
117
+
$t$.
84
118
85
119
86
120
87
121
## Modeling loops
88
122
89
-
This tier associates the expected values for each population section associated with a data source to that data source using a likelihood function. These likelihood functions are then combined into an objective function that is passed to TMB.
90
-
91
-
The population loop will be initialized at a user-specified age, time increment, and seasonal structure, rather than assuming ages, years, or seasons follow any pre-defined structure. Population categories will be described flexibly, such that subpopulations such as unique sexes, stocks, species, or areas can be handled identically to reduce duplication. Each subpopulation will have a unique set of attributes assigned to it, such that each subpopulation can share or have a different functional process (e.g. recruitment function, size-at-age) than a different category.
92
-
93
-
Spawning time and recruitment time are user-specified and can occur more than once per year. For the purposes of replicating model comparison project outputs, in milestone 1, all processes including spawning and recruitment occur January 1, but these should be specified via the `spawn_time` and `recruit_time` inputs into FIMS to allow for future flexibility. Spawning and recruitment timing can be input as a scalar or vector to account for multiple options.
94
-
95
-
Within the population loop, matrices denoting population properties at different partitions (age, season, sex) are translated into a single, dimension-folded index. A lookup table is computed at model start so that the dimension-folded index can be mapped to its corresponding population partition or time partition (e.g. population(sex, area, age, species, time, ...)) so the programmer can understand what is happening. The model steps through each specified timestep to match the data to expected values, and population processes occur in the closest specified timestep to the user-input process timing (e.g. recruitment) across a small timestep that is a predefined constant.
123
+
This tier associates the expected values for each population section
124
+
associated with a data source to that data source using a likelihood
125
+
function. These likelihood functions are then combined into an objective
126
+
function that is passed to TMB.
127
+
128
+
The population loop will be initialized at a user-specified age, time
129
+
increment, and seasonal structure, rather than assuming ages, years, or
130
+
seasons follow any pre-defined structure. Population categories will be
131
+
described flexibly, such that subpopulations such as unique sexes,
132
+
stocks, species, or areas can be handled identically to reduce
133
+
duplication. Each subpopulation will have a unique set of attributes
134
+
assigned to it, such that each subpopulation can share or have a
135
+
different functional process (e.g. recruitment function, size-at-age)
136
+
than a different category.
137
+
138
+
Spawning time and recruitment time are user-specified and can occur more
139
+
than once per year. For the purposes of replicating model comparison
140
+
project outputs, in milestone 1, all processes including spawning and
141
+
recruitment occur January 1, but these should be specified via the
142
+
`spawn_time` and `recruit_time` inputs into FIMS to allow for future
143
+
flexibility. Spawning and recruitment timing can be input as a scalar or
144
+
vector to account for multiple options.
145
+
146
+
Within the population loop, matrices denoting population properties at
147
+
different partitions (age, season, sex) are translated into a single,
148
+
dimension-folded index. A lookup table is computed at model start so
149
+
that the dimension-folded index can be mapped to its corresponding
150
+
population partition or time partition (e.g. population(sex, area, age,
151
+
species, time, ...)) so the programmer can understand what is happening.
152
+
The model steps through each specified timestep to match the data to
153
+
expected values, and population processes occur in the closest specified
154
+
timestep to the user-input process timing (e.g. recruitment) across a
155
+
small timestep that is a predefined constant.
96
156
97
157
## Expected numbers and quantities
98
158
99
-
The expected values are calculated as follows in the population.hpp file:
159
+
The expected values are calculated as follows in the population.hpp
160
+
file:
100
161
$$ B_t=\sum_{a=0}^AN_{a,t}w_a$$
101
-
where $B_t$ is total biomass in time $t$, $N$ is total numbers, $w_a$ is weight-at-age $a$ in kilograms.
162
+
where $B_t$ is total biomass in time $t$, $N$ is total numbers, $w_a$ is
163
+
weight-at-age $a$ in kilograms.
102
164
103
165
$$N_t=\sum_{a=0}^AN_{a,t}$$
104
166
where $N_t$ is the total number of fish in time $t$.
@@ -109,17 +171,23 @@ where $N_t$ is the total number of fish in time $t$.
109
171
The initial equilibrium recruitment ($R_{eq}$) is calculated as follows:
where $\phi_{F}$ is the initial spawning biomass per recruitment given fishing mortality.
174
+
where $\phi_{F}$ is the initial spawning biomass per recruitment given
175
+
fishing mortality.
113
176
114
177
## Likelihood calculations
115
178
116
-
Age composition likelihood links proportions at age from data to model using a multinomial likelihood function. The multinomial and lognormal distributions, including atomic functions are provided within `TMB`.
179
+
Age composition likelihood links proportions at age from data to model
180
+
using a multinomial likelihood function. The multinomial and lognormal
181
+
distributions, including atomic functions are provided within `TMB`.
117
182
118
-
Survey index likelihood links estimated CPUE to input data CPUE in biomass using a lognormal distribution. (model.hpp)
183
+
Survey index likelihood links estimated CPUE to input data CPUE in
184
+
biomass using a lognormal distribution. (model.hpp)
119
185
120
-
Catch index likelihood links estimated catch to input data catch in biomass using a lognormal distribution. (model.hpp)
186
+
Catch index likelihood links estimated catch to input data catch in
187
+
biomass using a lognormal distribution. (model.hpp)
121
188
122
-
Age composition likelihoods link catch-at-age to expected catch-at-age using a multinomial distribution.
189
+
Age composition likelihoods link catch-at-age to expected catch-at-age
0 commit comments