Giter VIP home page Giter VIP logo

ss3-source-code's Introduction

Stock Synthesis 3.30

GitHub release (latest by date) GitHub Release Date GitHub last commit GitHub release (latest by date)

Stock Synthesis (SS3) is a generalized age-structured population dynamics model implemented in ADMB. It is used to assess the effect of fisheries on fish and shellfish stocks while taking into account the influence of environmental factors.

Table of contents

Citing Stock Synthesis

Please cite Stock Synthesis as:

Methot, R.D. and Wetzel, C.R. (2013). Stock Synthesis: A biological and statistical
framework for fish stock assessment and fishery management. Fisheries Research, 
142: 86-99. https://doi.org/10.1016/j.fishres.2012.10.012

Installation

Download the latest compiled versions from Github Releases. For information on specific changes with each release, please refer to the change log on GitHub for changes from v.3.30.19 onward and the Excel spreadsheet version of the change log for changes prior to v.3.30.19.

How can I learn how to use Stock Synthesis?

To learn more about how to use Stock Synthesis, see the SS3 website for tutorials to get started and build your own models as well as topic-focused vignettes.

The Stock Synthesis user manual provides the complete documentation of Stock Synthesis.

How do I ask questions about Stock Synthesis?

Please look for answers or submit questions to the Stock Synthesis Google Group (must request to join first). Questions can also be asked by opening an issue in this repository or by emailing [email protected].

How can I contribute to Stock Synthesis?

Have feature requests or bug reports? Want to contribute code? Please open an issue or submit a pull request. For complete details, please see CONTRIBUTING.md

This project and everyone participating in it is governed by the NMFS Fisheries Toolbox Code of Conduct. By participating, you are expected to uphold this code.

Tools for working with Stock Synthesis

As Stock Synthesis usage has grown, so has the number of tools to work with it. These include repositories on github with the stock-synthesis topic as well as:

  • r4ss: Create plots of Stock Synthesis output and functions to work with Stock Synthesis in R.
  • ss3diags: Run advanced diagnostics for Stock Synthesis models.
  • ss3sim: Conduct simulation studies using Stock Synthesis.
  • SSI: Stock Synthesis Interface, a GUI for developing models and running Stock Synthesis. Links to r4ss.
  • SS3 Shiny helper app: Visualize common selectivity pattern options available within Stock Synthesis.
  • SSMSE: Use Stock Synthesis operating models in Management Strategy Evaluation.
  • sa4ss: Create accessible R markdown stock assessment documents with results from Stock Synthesis models. Note this tool is intended for use by analysts within the Northwest and Southwest Fisheries Science Centers currently.
  • Data limited tools - Options included Simple Stock Synthesis (SSS) and Extended Simple Stock Synthesis (XSSS), as well as SS-DL-tool, a shiny app that includes XSSS and SSS in its functionality.

Have a tool to work with Stock Synthesis that should be mentioned here? Open an issue or pull request to let us know!

Disclaimer

This repository is a scientific product and is not official communication of the National Oceanic and Atmospheric Administration, or the United States Department of Commerce. All NOAA GitHub project code is provided on an ‘as is’ basis and the user assumes responsibility for its use. Any claims against the Department of Commerce or Department of Commerce bureaus stemming from the use of this GitHub project will be governed by all applicable Federal law. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation or favoring by the Department of Commerce. The Department of Commerce seal and logo, or the seal and logo of a DOC bureau, shall not be used in any manner to imply endorsement of any commercial product or activity by DOC or the United States Government.

ss3-source-code's People

Contributors

arni-magnusson avatar e-perl-noaa avatar iantaylor-noaa avatar johnoel avatar k-doering-noaa avatar kellijohnson-noaa avatar nathanvaughan-noaa avatar nschindler-noaa avatar rick-methot-noaa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ss3-source-code's Issues

parameter range for low fecundity spawner-recruitment

Imported from redmine, Issue #46844
Opened by @RickMethot on 2018-02-23
Status when imported: On Hold

investigation of the low fecundity spawner-recruitment function reveals combos that ill-perform. May need to add some transformations or bounds to keep configuration in a reasonable space. A spreadsheet was created: test_LFSR.xls

movement is fxn of mean length-at-age

Imported from redmine, Issue #68519
Opened by @RickMethot on 2019-09-12
Status when imported: New

Consider making a new movement option that is a fxn of mean length-at-age. Then with platoons, the larger platoon would have advanced movement.

create ss_new files in ICES standard format

Imported from redmine, Issue #67864
Opened by @RickMethot on 2019-08-27
Status when imported: New

there is interest in creating a link from SS input files to ICES standard age-structured input files. An older description of that format is in attached file.

I plan to do this by putting all the tables into one file and then letting user parse them using R as needed.

RIck

area-specific growth

Imported from redmine, Issue #40367
Opened by @RickMethot on 2017-11-02
Status when imported: New

Is it feasible to have an area-specific growth effect on all morphs while in an area.

When fish of a given morph move to a different area, the mean size of fish of that morph in the recipient area becomes the weighted average of fish of that morph already in the area and the size of fish entering the area.

So do a calculation like that for the plus group.

Thank you Andre for this thought.

conditional compilation

Imported from redmine, Issue #67698
Opened by @RickMethot on 2019-08-23
Status when imported: New

IF statements in the code slow it down, so begin using conditional compilation so unnecessary statements are included in SS, but not in SS_OPT

include in versioninfo_safe
#define DO_ONCE

but do not include that line in versioninfo_opt

then use it in the code as follows:
#ifdef DO_ONCE
if(do_once==1) echoinput<<" retained size "<<exp_l_temp_ret<<endl<<" retained age "<<exp_truea_ret<<endl;;
#endif

so line of code will only be included in ss and will be omitted from ss_opt.

Implementing new recruitment dev vector approach

Imported from redmine, Issue #57889
Opened by @RickMethot on 2018-11-23
Status when imported: In Progress

create new recruitment deviation vector approach
do_recdev==3

With this approach:
exp_rec(y,4) = R0_adj * mfexp(dev(y))
where R0_adj is R0 adjusted for blocks, etc. on R0;
and dev(y) is a simple vector of unconstrained deviations

Then in the objective function:
rather than getting the -logL from the dev vector, now create a new deviation which is dev=log(exp_rec(y,3)/exp_rec(y,4));
where exp_rec(y,4) is shown above and exp_rec(y,3) is the expected value of recruitment adjusted for spawn_recr curve, regimes and env, and bias-adjustment.

Initial test shows that the -logL is about same as using do_recrdev==2 which is simple devs in which exp_rec(y,4) = exp_rec(y,3) * mfexp(dev(y))

implement depletion survey as a parameter for XSSS

Imported from redmine, Issue #47209
Opened by @RickMethot on 2018-03-01
Status when imported: On Hold

from Jason Cope:
If it is a parameter, we are able to access the MCMC machinery for estimation for SSS (we have a way of putting all the draws in the .pin file, which makes calculation really fast) and allows us to bypass AIS and use MCMC, which makes the integration and ultimate processing of output much better.
If it is a parameter, then if can have a prior.
I would create another SRR function (or 2 if you are currently using 2) and add one more parameter to be read. That parameter would be the depletion (hate that word; it really is escapement) level. Because it is a parameter, it can have a prior.
Then I would create a new survey type to make the correct logL calculation between this parameter and the expected value for escapement in the right year.
Trying to think through how this will work in MCMC

A MCMC parameter draw will create:
value for this new parameter, P
value for the prior likelihood from P-Pprior
value for escapement' from R0 and other model parameters
value for the survey likelihood from P-escapement'

so it will be critical to be smart about the specified prior se relative to the se used for the survey logL
so if the prior se is small, then either the MLE or the MCMC will move R0 and other parameters towards producing escapement values that are close to the prior for P.

rebuild.sso Add new lines for sigma, pstar, and implementation error

Imported from redmine, Issue #37863
Opened by @chantelwetzel-noaa on 2017-09-11
Status when imported: On Hold

The updated rebuilder requires input lines for sigma and pstar following the harvest control rule line. Additionally, new inputs for implementation error have been added to the rebuilder executable. SS needs to write out this section in the file as:

# Projection type
1
#Definiton of the control rule
0.1 0.4
# Sigma Assessment Error
0.36
# Pstar
0.45
# Constrain catches by the ABC (1=yes; 2=no)
1
# Implementation Error (0=no; 1=lognormal; 2=uniform)
0
# Parameters of Implementation Error
1 0.3
# Calculate coefficients of variation (1=yes)
0
# Number of replicates to use
10
# Random number seed
-99004

I have also attached an example file.

condition factor

Imported from redmine, Issue #68520
Opened by @RickMethot on 2019-09-12
Status when imported: New

Someone in France working on sardine is interested in condition factor. I think you could do this now by entering mean length-at-age AND mean weight-At-age observations. Then SS would reconcile them by estimating the Length-Weight parameters

fleet-specific F method

Imported from redmine, Issue #53098
Opened by @RickMethot on 2018-07-25
Status when imported: In Progress

It seems advantageous to allow fleet-specific F method so that only fleets with high F will need to use F as parameters

Instability in initial F near Fmsy

Imported from redmine, Issue #36394
Opened by @RickMethot on 2017-07-24
Status when imported: In Progress

There is a non-monotonic relationship that can interfere with initial F estimation if the option to allow spawner-recruitment to operate inside initial year is used and if the input initial catch is near MSY. In the attached file there is a profile on initial F bracketing Fmsy. It shows, quite logically, that values of F greater or less than Fmsy give initial catch < MSY and that only init F = Fmsy produces an equilibrium catch equal to MSY. So there are two pathological problems:

  1. if initial catch is near MSY (of course, SS has not yet calculated Fmsy yet), then the search for init F will encounter the non-monotonic situation
  2. if initial catch is > MSY, then the mismatch between observed and estimated initial catch cannot be reduced by increasing init F further. However, it might be possible for SS to increase R0 or other parameters in order to increase MSY indirectly.

create comprehensive approach for survey Q and parm dev link functions

Imported from redmine, Issue #12352
Opened by @RickMethot on 2015-10-08
Status when imported: Under Review

Have already changed specification of special selectivities (e.g. len selex=30 to 37) from the len selex input section to the survey units section of the data file.

Next need to modify the Q_power option to be a entry point for entering a variety of link functions

Need to decide whether to require 3 parameters (intercept, slope, power) for all link functions, or to make the N parameters specific to the requested function.

proposed set of links is:
Code Function
1 Y=qX
2 Y=a+q
X
3 Y=a+q*(X^(1+c))
4 ln(Y)=ln(q)+ln(X)
5 ln(Y)=ln(q)+(1+c)ln(X)
6 Y=q
(X-Xbar)
7 Y=a+q*(X/Xbar)^(1+c)
8 Y=qX/(a+X)
9 Y=a/(1+exp(-q
(X-Xbar))
10 Y=a+b*ln(X)

Automatic set-up for size selex 6 and age selex 17 and others

Imported from redmine, Issue #17504
Opened by teresa.amar on 2016-04-05
Status when imported: New

Add automatic set-up for size selex 6 (non-parametric) and age selex 17 (random walk)

Pattern 6 (non-parametric size selectivity)
number of parameters: 2 + special value
This pattern uses a set of linear segments. The first
waypoint is at Length = p1 and the last waypoint is at Length=p2. The total
number of waypoints is specified by the value of the Special factor in the
selectivity set-up, so the N intervals is one less than the number of waypoints.
Intermediate waypoints are located at equidistant intervals between p1 and p2.
Parameters 3 to N are the selectivity values at the waypoints, entered as logistic,
e.g. 1/(1+exp(-x)). Ramps from –10 to p3 if L<p1. Constant at pN if L>p2.

Pattern 17 (age selectivity)
number of parameters: Nages + 1
This selectivity pattern provides for a random walk in ln(selectivity). In typical
usage:

  • First parameter (for age 0) could have a value of -1000 so that the age 0 fish
    would get a selectivity of 0.0;
  • Second parameter (for age 1) could have a value of 0.0 and not be estimated, so
    age 1 is the reference age against which subsequent changes occur;
  • Next parameters get estimated values. To assure that selectivity increases for the
    younger ages, the parameter min for these parameters could be set to 0.0 or a
    slightly negative value.
  • If dome-shaped selectivity is expected, then the parameters for older ages could
    have a range with the max set to 0.0 so they cannot increase further.
  • To keep selectivity at a particular age the same as selectivity at the next younger
    age, set its parameter value to 0.0 and not estimated. This allows for all older
    ages to have the same selectivity.
  • To keep a constant rate of change in selectivity across a range of ages, use the -
    999 flag to keep the same rate of change in ln(selectivity) as for the previous age.

empirical length-at-age

Imported from redmine, Issue #48305
Opened by @RickMethot on 2018-03-27
Status when imported: New

create new growth option that allows user to input vector of length-at-age

Consider Tim Miller's state space model approach

Imported from redmine, Issue #12334
Opened by teresa.amar on 2015-08-19
Status when imported: New

See the following references:

https://afs.confex.com/afs/2015/webprogram/Paper19188.html

A State-Space Approach to Incorporating Environmental Effects in Stock Assessment and Biological Reference Points

Tim Miller, Northeast Fisheries Science Center, Woods Hole, MA Jonathan Hare, National Marine Fisheries Service, NOAA/NMFS/NEFSC, Narragansett, RI Larry A. Alade, Population Dynamics branch, NOAA Northeast Fisheries Science Center, Woods Hole, MA David Mountain, University of Arizona, Tucson, AZ

Abstract: There are many studies of environmental effects on fish stocks, some of which incorporate these effects mechanistically in stock assessment models. Most of these models do not account for error in environmental observations and use ad-hoc approaches to deal with missing observations. We present a state-space age-structured assessment model that treats environmental and traditional data components consistently. This approach offers a statistically appropriate method for dealing with both error in and missingness of observations as well as the stochastic nature of the environmental and population processes. State-space models also allow information-theoretic approaches to model selection and potentially multi-model inference. We demonstrate the approach with an application to Southern New England yellowtail flounder to evaluate effects of the Mid-Atlantic shelf cold pool on recruitment and further demonstrate how uncertainty in the effects can be propagated in biological reference points and population projections important for management.

http://www.nefsc.noaa.gov/GARM-Public/1.DataMeeting/F.3%20GARM-maturity-6-3.pdf

http://www.sciencedirect.com/science/article/pii/S0165783614003105

http://www.math.uct.ac.za/maram/workshop/IWS2011/index.php?file=MARAM%20IWS_DEC11_H_MODEL_P1.pdf

Richards growth coefficient range

Imported from redmine, Issue #46842
Opened by @RickMethot on 2018-02-23
Status when imported: In Progress

Richards growth coeff can be positive or negative, but not 0.0. Need to trap for this

Standardize terminology: morph/growth pattern/platoon, and standard error/std dev/CV

Imported from redmine, Issue #66091
Opened by @k-doering-NOAA on 2019-07-16
Status when imported: On Hold

There are some inconsistencies in how terms are used. I didn't see this issue yet in the tracker, but please let me know if I missed it and this is a duplicate.

Email from Rick about morph/ growth pattern/ platoon:

I started working on something with Chantel and realized how misleading the following section of control.ss_new is:
1  #_N_Growth_Patterns
1 #_N_platoons_Within_GrowthPattern 
#_Cond 1 #_Morph_between/within_stdev_ratio (no read if N_morphs=1)
#_Cond  1 #vector_Morphdist_(-1_in_first_val_gives_normal_approx)

It should be:
1  #_N_Morphs (e.g. Growth_Patterns)
1 #_N_platoons_Within_Morphs 
#_Cond 1 #_Platoon_between/within_stdev_ratio (no read if N_platoons=1)
#_Cond  1 #vector_of_platoon_dist_(-1_in_first_val_gives_normal_approx)

In addition, I've noticed that standard error/standard deviation/CV are used interchangeably in the SS input files, which is confusing. For example, in the variance adjustment factors section of the control file, the additive survey input variance is labeled "survey CV", but the manual states that it is actually a log-scale standard deviation. Using consistent and correct terminology with regards to these values would be helpful to users. It would also be good to make sure it is clear when inputs are on a nominal or log scale, too. Users incorrectly assuming the wrong scale, values, or units can lead to model misspecification.

One idea to help with term standardization is to have an "official" SS glossary somewhere (for example, we could create this in the redmine wiki). Here we can specify technical terms and what they mean. We could also specify synonomous terms for the time being and which one is preferable to use.

If there are more inconsistently used terms, perhaps we can add them onto this issue or any ideas you have for doing this.

separate vector of rec devs by area

Imported from redmine, Issue #68522
Opened by @RickMethot on 2019-09-12
Status when imported: New

When there are multiple areas, it is cumbersome to have SS create a main rec dev and then to have time-varying devs used to partition that into area-specific devs

A sleaker alternative would apply the partition to the expected value to get an expected value for each area, then to let each area have a vector of devs. This would create completely uncorrelated devs among the areas, so might not be ideal for all situations.

A similar approach could be used to partition total recruitment by settlement time, but for this the uncorrelated approach seems not good.

measuring predictive capability

Imported from redmine, Issue #19284
Opened by @RickMethot on 2016-05-29
Status when imported: New

There is a need to create a measure of the predictive capability of SS. Basically to estimate parameters using data through year y, then calculate the goodness-of-fit to data in year y+1 without including those data in the objective function.

This can be doable using suitable modification of the retrospective feature and storing the goodness-of-fit info in a convenient way.

These years do not need to be part of the forecast. All we need to do is to set the fleet value to a negative value for the year to be predicted without changing "endyear". Then store the logLs and rmse for those data. Be careful that any negative fleet data are not already included in the data file.

Consult with Ian Stewart regarding his methods in this regard.

selex 44 and 45 for sex-specific non-parametric age selectivity

Imported from redmine, Issue #49900
Opened by @RickMethot on 2018-05-02
Status when imported: In Progress

          case 44:  //  like age selex 17 but with separate parameters for males and with revised controls
        {
          //  sp(1) is first age with non-zero selectivity; can be age 0
          //  seltype(f,4) is number of selectivity change parameters beginning at age=first_age+1
          //  sp(2) is first age for which mean selex=1
          //  sp(3) is last age  for which mean selex=1
          //  sp(4) is male mean selex relative to female mean.
          //  -999 code means to keep the change unchanged from previous age (so keeps same rate of change)
          // -1000 code is only for males and sets the male change to be same as female change
          //  gg is the index for sex, where 1=female, 2=male


          case 45:  //  like age selex 14 but with separate parameters for males and with revised controls
        {
          //  parameter value is logit(selectivity)
          //  peak selex in logit space is penalized towards value of 8.0, which gives selex near 1.0
          //  sp(1) is first age with non-zero selectivity; can be age 0
          //  seltype(f,4) is number of selectivity parameters beginning at age=first_age
          //  sp(2) is first age in mean for peak selex
          //  sp(3) is last age  in mean for peak selex
          //  sp(4) is male mean selex relative to female mean.
          //  -999 code means to keep the selex same as previous age
          // -1000 code is only for males and sets the male selex to be same as female selex
          //  gg is the index for sex, where 1=female, 2=male

Need to test performance of the penalty applied in selex 44

add option to adjust recdev settings automatically for retrospectives?

Imported from redmine, Issue #55783
Opened by @iantaylor-NOAA on 2018-10-02
Status when imported: Under Review

Chantel pointed out in an r4ss issue (r4ss/r4ss#245) that when the age and length comps from teh final years of the model are removed by the retrospective input in the starter file, the best practice would be to shift the "last year of main recr_devs" input back as well, as this break is often dependent on the final year of comp data with information about recruitment. Likewise, the "last_yr_fullbias_adj_in_MPD" and "first_recent_yr_nobias_adj_in_MPD" inputs should likely be adjusted in parallel with the break between main and late recdevs when data are removed from the end of the model. These changes are easy to make manually, but typically aren't done, especially when using the r4ss function SS_doReto which iteratively modifies the starter file and runs the model in a successive set of folders.

It would be possible to implemented this suite of linked changes in r4ss but would likely be more straightforward in SS itself. It might be good to give the user the option to control whether this happens or not, rather than forcing it on them.

Area-specific spawner-recruitment

Imported from redmine, Issue #18311
Opened by @RickMethot on 2016-04-28
Status when imported: New

  1. Conceptual problem in equilibrium calcs if fish move between areas
    Equil_Calc takes some total recruitment (Equ_Recr)
    it distributes according to recr_dist,
    then calculates equilibrium numbers at age taking into account F and movement between areas
    if outputs a value for total SPR (spawners per recruit)
    then SPR is input to Equ_Spawn_Recr_Fxn
    to calculate the equilibrium total recruits and spawners from this SPR

but if recruitment to an area depends on that areas SPB, then SPR needs to be area-specific
but with movement between areas, the SPB in an area depends on the movement
so SPR cannot be calculated independently for each area if there is movement
so equil_calc will need to output area-specific SPR; this seems feasible

but it is still somewhat circular because the distribution of recruits to areas
in equil_calc will depend on the SPB by area calculated by equil_calc

  1. Need to reconcile the area-aspect of recr_dist with the R=F(SPB_area)
    area-specific R0
    global steepness
    movement mixes B between areas
    fishing reduces area-specific B
    reduced area-specific B reduces E(area-specific R)

does global R=E(sum B) equal R = sum (E(Ba)) ??

current approach:

  1. Given some reference recruitment level - R
  2. Call equil_calc
    a. distribute R to areas according to recr_dist
    b. loop areas within ages
    c. for each age,/area calc SPB, Yield, Survivors
    d. for each age mix survivors among areas according to movement specs
    e. accumulate total SPB and Yield and return from equil_calc
  3. calc SPB/R and Yield/R
  4. call Equ_Spawn_Recr_Fxn to get B_equil and R_equil from SPB/R and SR parms

Proposed two-stage iterative area-specific approach for equilibrium calcs:
step A:

  1. Given some reference recruitment level - R
  2. Call equil_calc
    a. distribute R to areas according to unfished recr_dist (which needs to be defined here)
    b. loop areas within ages
    c. for each age,/area calc SPB, Yield, Survivors
    d. for each age mix survivors among areas according to movement specs
    e. accumulate total and area-specific total SPB and Yield and return from equil_calc
  3. calc area-specific SPB/R and Yield/R, using area-specific R
  4. call Equ_Spawn_Recr_Fxn for each area to get B_equil and R_equil from SPB/R and SR parms
  5. sum across areas to get adjusted total B_equil and R_equil
  6. use ratio of B_equils among areas to calculate adjustment to recr_dist
    step B:
  7. call equil_calc again, using the adjusted recr_dist

virtual availability

Imported from redmine, Issue #61493
Opened by @RickMethot on 2019-03-18
Status when imported: New

create concept of explicit availability, as distinct from availability as a component of selectivity.

Also create an option such that 1-availability be an option ffor 2 area models such that fish that are available in fleets in one virtual area are the complement of fish available in the other area

Plan development in conjunction with IATTC and SWFSC

guiding parameter min, max, and default values

Imported from redmine, Issue #64838
Opened by @RickMethot on 2019-06-10
Status when imported: New

Information about a parameter's usage is known when the parameter label is assigned, but the input values for the parameter have not been read at that time. This means that knowledge of good min and max values could be assigned at that time and then compared to the actual parameter line when it is read.

option 1: create that info as parameters are created and then do comparison after all parameters are read
// when a parameter is defined and its label (hence usage) is created,
// the value of its min, max, init, prior have not yet been read
// so when it gets created, need to pushback a code to indicate what special conditions affect it
// also may want to save indicator of whether the parameter is multiplier, logit, etc.
// so pushback a code to the ivector Parm_minmax
// and add a string to the adstring_array Parm_info
ivector minmax_types(1,10) // set of canned min-max typesexample
ParmLabel+="L_at_Amin_"+GenderLbl(gg)+GP_Lbl(gp);
Parm_info+="val";
Parm_minmax.push_back (3);

above is comparable to the current parameter type concept, see below.

option 2: integrate all such checks into code section that creates the parameter
parameter values themselves are read with
init_matrix MGparm_1(1,N_MGparm,1,14) // matrix with natmort and growth parms controls

but could be integrated into above using a pushback approach

then mgp_type is assigned later, but could be moved up to be done along with label
there already is:
ivector mgp_type(1,N_MGparm) // contains category to parameter (1=natmort; 2=growth; 3=wtlen & fec; 4=recr_dist&femfrac; 5=movement; 6=ageerrorkey; 7=catchmult)

then there is a generic check for time-vary MG parms

Document parameter devs approach implemented in 3.30.13

Imported from redmine, Issue #66186
Opened by @k-doering-NOAA on 2019-07-18
Status when imported: In Progress

From the release notes for 3.30.13:

Greetings Stock Synthesis (SS) Users,
In this release of Stock Synthesis 3.30.13.00 we have included some fixes, augmentations and new features.  Thanks to some users
who were pushing the envelope on time-varying parameters for finding some needed fixes to the code.  You can find all the changes 
listed in the Change Log and below.   The fixes were minor and mostly in the output, but there is one big fix affecting the 
calculation of the log likelihood for the parameter deviations.  We will put out a fuller report on that later and encourage you 
to contact us if you need info on this change sooner.

To the best of my knowledge, the fuller report did not get finished, so I am opening this issue as a reminder to the team. Rick, I added you as the assignee for now, but feel free to change.

fix retention setup to allow mirroring

Imported from redmine, Issue #52776
Opened by @RickMethot on 2018-07-16
Status when imported: Under Review

The mirroring option for retention parameters was not turning on the Do_Retain(f) flag, so was not using retention when calculating expected values.

This gets fixed in 3.30.12 beta on July 16, 2018

selectivity as data input:

Imported from redmine, Issue #19955
Opened by @RickMethot on 2016-06-21
Status when imported: New

add a way to input selectivity at a specified fleet/time/age as data

time will allow field measurements of selectivity to be input to the model., as well as allowing such input to be a "prior" on selectivity

Document and sim test recruitment dev_vector options

Imported from redmine, Issue #49212
Opened by @RickMethot on 2018-05-11
Status when imported: In Progress

Find while working with Cole Monnahan that the dev_vector approach to the recruitment deviations does not perform well in mceval_phase().

Three alternatives:

  1. ADMB developers find a fix;
  2. deprecate use of the dev_vector and add a penalty to the mean deviation to keep it close to 0.0. Feasible because this mean covaries strongly with ln(R0).
  3. add the mean deviation to ln(R0) before using ln(R0) in the spawner-recruitment relationship; need to be careful about effects on early and forecast recruitments and on recruitments outside of the dev range.

masking of pre-settlement fish

Imported from redmine, Issue #29095
Opened by @RickMethot on 2017-02-10
Status when imported: On Hold

In 3.24, all fish recruited at the beginning of a season.
In 3.30, settlement events can occur anytime during a season, but the settlers are actually assigned to the numbers-at-age matrices at the beginning of the season of settlement. This means that they exist and can contribute to fisheries and surveys if selected. This is contrary of the idea of settlement events which was to mask out the pre-settlement "larval phase".

Create a new array called keep_age which has a value of 0.0 before settlement and 1.0 after settlement and use this to achieve the desired masking when the numbers-at-age matrix is sampled to created the sampled age-length matrix.

Doing the masking for fishing mortality and catch will be more difficult, but needs to happen.

Tag recapture - major revamp

Imported from redmine, Issue #18312
Opened by @RickMethot on 2017-11-07
Status when imported: New

need:
time-vary parameters
sharing of parameters
fleet-specific and release specific reporting rates

Deprecate SIS_table.sso

Imported from redmine, Issue #39805
Opened by @chantelwetzel-noaa on 2015-10-08
Status when imported: Under Review

I spoke with Stacey and a couple of items could be added to the SIS_table file to improve its usability and reduce the number of places ones needs to look to identify all quantities required for SIS.

  1. Add a list of survey/cpue index names used in the model. I also think an additional column showing the lambda associated should be added to easily interpret if the index was used in the model fitting or was only present for exploration.

  2. The time-series table currently only has forecast values for biomass. It would be useful to complete this table with the forecasted removals and other values.

  3. Output the SPR and Bproxy values set in the forecast file.

  4. Table of the derived harvest target rates, target biomass, and yields based on SPR, Btarget, and MSY.

fleet_type = 4 = Predator to create M2

Imported from redmine, Issue #67572
Opened by @RickMethot on 2019-08-21
Status when imported: New

requirements could include:

  1. input of consumption amount in biomass or numbers
  2. input predator abundance as a "survey" of effort
  3. functional form to relate "F" by the predator to the predator abundance
  4. composition data is from gut contents

A predator fleet will look a lot like a bycatch fleet. What's different?

Nice to be able to tune the F to match the discard amount for both.

Perhaps change model so that catch entries for a bycatch fleet are treated as total catch and SS tunes to them just like it does for retained catch of fleet type=1, but still need to generate a F in designated years for which there is no input catch amount.

revise the SE's approach to fitting shrimp effort time series

Imported from redmine, Issue #65948
Opened by @RickMethot on 2019-07-11
Status when imported: New

convergence in these models is very slow as model seeks to hyper-fit the effort time series using the shrimp fleet F values. Could this be done by putting the input effort in the catch section and then only estimating a Q parameter?

review implementation of parameter random effects

Imported from redmine, Issue #39714
Opened by @RickMethot on 2015-10-29
Status when imported: In Progress

In 3.30, the deviations are assumed to be unit normal and are multiplied by a stddev before being used. However, they may not actually be unit normal in any instance and this caused consternation for at least one user, Grant Thompson.

change reporting of time-varying parameters after adjustments

Imported from redmine, Issue #21185
Opened by @iantaylor-NOAA on 2016-08-11
Status when imported: On Hold

Current structure has three tables.

The first is MGparm_By_Year_after_adjustments with one row per year and one column for each MGparm.

The other two are selparm(Size)_By_Year_after_adjustments and selparm(Age)_By_Year_after_adjustments which have one row per combination of fleet/year and different numbers of columns per row depending on the number of parameters for each fleet's selectivity.

An alternative structure, discussed on 8/11/16, is to have a single table containing all time-varying parameters. It could maintain the pattern of 1 row per year but only include columns for parameters that are time-varying. The parameter label in the header would be adequate to figure out which parameters were MGparms, selectivity parm, etc. And by only including those parameters which change over time, the total number of columns is likely to be reasonable.

add option to include constant of integration for Dirichlet-Multinomial likelihood

Imported from redmine, Issue #51972
Opened by @iantaylor-NOAA on 2018-06-22
Status when imported: On Hold

Jim Thorson just noted in an email to me that constant of integration for the Dirichlet-Multinomial is not included in the likelihood. This isn't an issue unless you wanted to do a comparison of the likelihoods between the D-M and the multinomial. In theory, the switch

1 #_sd_offset; must be 1 if any growthCV, sigmaR, or survey extraSD is an estimated parameter

could be used to turn on or off this constant term.

This is a low priority but I'm posting here to remind me to look into this in the future as time allows.

otolith weight as proxy for age, generalized age comp

Imported from redmine, Issue #35753
Opened by @RickMethot on 2017-06-30
Status when imported: In Progress

Our Panama City lab has done fairly extensive analyses demonstrating the relationship between otolith weight and age (see attached presentation) for GOM species. Beverly Barnett (copied), Guy Davenport, Gary Fitzhugh and to some extent Bonnie have expressed interest in better understanding the value of this information for stock assessment. I also believe the Panama City lab is interested in reducing the number of otoliths that are aged, and want to know if there is a cost-effective approach to substitute some age comp with otolith weight - age keys (see attached manuscript).

Short of full simulation study, do you have any suggestions for how we could test the value of this information for stock assessment? For example, can SS be configured to use an otolith weight at age key rather than an ALK, and if so, are there particular performance metrics that could be used to assess improved model performance? I know folks are loath to give up age comp data, but for some species we oversample age comp, and for others we have very few observations. Using otolith weight could be an attractive and low-cost option for our lower priority stocks.

Shannon


You could enter otolith weight bins as the age bins, then to enter as the age transition info the mean and standard deviation of otolith weight for each true age.

The problem is that SS only allows for one set of age bins, so trying to do both otolith weights and regular ages in the same model might be tricky, but not impossible if the otolith weights were re-scaled to "look" like ages.

Add projected survey indices to forecasts

Imported from redmine, Issue #30394
Opened by teresa.amar on 2017-03-20
Status when imported: Resolved

Output projected values for survey indices

Where? In Report.sso -> INDEX_2

Need to add forecast years to survey index arrays

See emails on 2017-03-17 between Shannon Calay, IGT, and RDM

add survey type for environment "survey" that inform recruitment devs or any time-varying parameter

Imported from redmine, Issue #65847
Opened by @RickMethot on 2019-07-09
Status when imported: New

svy_units 31, 32 and 33 get expected value from various transformations of recruitment, but none relate directly to recr_devs
svy_units 35 allows entry of environmental data as a devs, but can only be related to parameter devs, not recr devs

Need to create svy_unit=36 to allow direct linkage to recdev(y)

Also need an associated link function that can take 2 parameters, offset and slope

year-specific MSY

Imported from redmine, Issue #12338
Opened by teresa.amar on 2015-08-28
Status when imported: New

Make it easier do year-specific SPR and MSY calculations.

Currently the user needs to do this with iterative calls while adjusting the forecast.ss file accordingly.

Mean size in plus group

Imported from redmine, Issue #12336
Opened by teresa.amar on 2015-08-25
Status when imported: New

There is an approximation in SS for which I'm seeking your input.

The issue is the mean body length of fish in the plus group. That length drives body weight, fecundity, size selectivity, and M (for Lorenzen M approach).

Hence the order of operations in SS is to do growth first, then M and fecundity, and then all the selectivities. The mean body length in the plus group is a function of the growth parameters, the number of age groups (which controls how much growth occurs before entering the plus group) and Z. Because growth comes first, SS is hardwired to use Z=0.2 for that mean size calculation (note this is just for the mean size, the actual Z for that time step is used for the N calculations later). Also note that this whole issue is meaningless if fish achieve a high fraction of Linf before they reach the accumulator age.

During the time series, the updating of the mean size in the plus group is an easy weighted average of the mean size of fish already in the plus group and the mean size of the fish just entering the plus group. Easy.

The challenge is the mean size in the plus group under equilibrium conditions where the calculations become circular. As noted earlier, this uses Z=0.2 and runs out to 3*maxage to create a better mean size for the plus group under equil conditions.

However, this means that the mean size is the same for virgin, initial equilibrium, and for all steps of the F profiling for SPR and MSY calculations. All models are approximations......

I could replace that 0.2 factor with a user input, but that wouldn't solve the dynamical issue when profiling on F.

I have been pondering the equil_calc() section of SS (which calculates equil numbers-at-age from input M, F, selectivity) to see if it might be feasible to update the mean size there before calculating equilibrium SSB and Catch. It seems feasible, but still wouldn't allow updating of size selectivity or Lorenzen M.

add check code after each category of the file read

Imported from redmine, Issue #54562
Opened by @RickMethot on 2018-08-29
Status when imported: On Hold

consider adding a code, say 98765, after each section of the input files so that user gets immediately notified when the read gets out-of-sync. Might have to do this in about 20 places or so.

Probably need to add a 0/1 in starter so that user can choose whether or not to use this feature when reading an existing set of files, then always put this code into the ss_new files.

dynamic spawner-recruitment logic in benchmarks and projections

Imported from redmine, Issue #56287
Opened by @RickMethot on 2018-10-15
Status when imported: On Hold

The following code seems incomplete in its logic.
Currently, if R0 is time-varying, SS will recalculate SSB_use and in doing so will use the current year's biology-at-age. However, if R0 is not time-varying, but growth or M is time-varying, then SSB_use will remain same as SSB_virgin. It seems useful to consider whether SSB_use should be updated when there is dynamic growth to be more like a complete dynamic B0. Your thoughts appreciated.

  if(SR_parm_timevary(1)==0)  //  R0 is not time-varying
  {R0_use=Recr_virgin; SSB_use=SSB_virgin;}
  else
  {
    R0_use=mfexp(SR_parm_work(1));
    equ_Recr=R0_use;
    Fishon=0;
    eq_yr=y;
    bio_yr=y;
    Do_Equil_Calc(R0_use);                      //  call function to do equilibrium calculation and get SSB_equil
    if(fishery_on_off==1) {Fishon=1;} else {Fishon=0;}
    SSB_use=SSB_equil;
  }
  Recruits=Spawn_Recr(SSB_use,R0_use,SSB_current);  // calls to function Spawn_Recr

interaction of bycatch fleets and F0.1 reference point

Imported from redmine, Issue #68202
Opened by @RickMethot on 2019-09-05
Status when imported: Assigned

find that the F0.1 search can fail if bycatch fleets are used and bycatch setting includes that fleet's catch in the catch to be optimized.
Find this issue while working on Max's vendance model that has seals as a predator via the bycatch fleet approach
Add a warning to this effect in readdata.tpl
Need to add similar note to the documentation
make a couple of tweaks to the F0.1 search to hopefully improve its performance

Note that it would be good if such searches could be on log(F) so the derived F could never go negative

report more info on deviations to PARAMETERS section of Report.sso

Imported from redmine, Issue #17862
Opened by @iantaylor-NOAA on 2016-04-15
Status when imported: On Hold

Currently columns in PARAMETERS section for Phase, Min, Max, and Init are underscores and Prior, Pr_SD, and Prior_Like are blank. However, these could get filled in with useful information which would with tasks like plotting parameters relative to their prior distributions.

Currently it seems that recdevs are bounded at -5 and 5 and MGparm devs are bounded at -10 and 10. Init and Prior values would generally be 0 but could be changed in control or par file, Pr_SD would be sigmaR or the chosen sigma for the parameter devs. The likelihood contribution for the devs is presumably available somewhere.

Add other options to _CV_Growth_Pattern for log(SD)

Imported from redmine, Issue #17993
Opened by teresa.amar on 2016-04-20
Status when imported: New

Request from someone at the April 2016 UMassD training:

Add option for log(SD) = f(LAA) and log(SD) = f(A)
to _CV_Growth_Pattern (in the control file)

Richards growth interacts with timevary growth trap

Imported from redmine, Issue #46843
Opened by @RickMethot on 2018-02-23
Status when imported: In Progress

The join function to prevent shrinkage interferes with Richards growth because the join works on transofrmed space.
Temporarily remove the join fxn to allow Richards to work

suggest that join be reinstated to work on untransformed size-at-age and only be invoked it timevary growth is active

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.