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

[Question/help] Why do we parameterize fishing mortality and recruitment using mean and deviations? #220

Open
JaneSullivan-NOAA opened this issue Aug 24, 2022 · 17 comments
Assignees
Labels
kind: question Further information is requested P2 mid-level priority status: needs discussion Dialogue is needed before a decision can be made. theme: NLL refactor Negative log likelihood
Milestone

Comments

@JaneSullivan-NOAA
Copy link
Contributor

The population and fleet subgroup (@Andrea-Havron-NOAA , @k-doering-NOAA, @nathanvaughan-NOAA) are working on implementing fishing mortality. We are trying to decide if we should estimate annual log_Fmort or use the log_mean_Fmort + log_Fmort_devs approach.

This conversation spurred several questions:

  1. Why is the mean + devs approach more commonly used in existing assessment models than annual values? What are the tradeoffs, other than one has an extra parameter?
  2. Which one should FIMS use for Fmort (and recruitment)?
  3. Will there be issues with random effects estimation of recruitment if the values are not centered around a mean? We could think of examples where random effects are not centered that seem to work fine but thought we'd poll the group.

@Rick-Methot-NOAA @timjmiller @cmlegault

@JaneSullivan-NOAA JaneSullivan-NOAA added the kind: question Further information is requested label Aug 24, 2022
@JaneSullivan-NOAA JaneSullivan-NOAA added this to the 1 milestone Aug 24, 2022
@Rick-Methot-NOAA
Copy link

I think the mean+dev approach should only be used when you expect no trend in the devs.
More generally, one uses fxn+dev, where the simplest form of fxn is a scalar (e.g. mean), a reasonable compromise might be fxn = linear trend, and in the case of recruitment the fxn is the spawner-recruitment relationship. Any estimate of the variance of the devs is conditioned on the degree of variance explained by fxn. If you choose too simple of a fxn and impose any penalty on the devs, then to some degree the resultant time series of fxn+dev will be flatter than might be indicated by the data.
In SS3, the F parameters are all freely estimated with no penalty because each F is highly informed by the total catch for that fleet in that year, and total catch is a datum known with high certainty. Also, F routinely has large trends over time so any constraint on the devs could create a bias.
In SS3, recruitment is done using the fxn+dev approach. This is partly because informative data are not routinely available and for some eras of the time series informative data may be absent.
For recruitment deviations, SS3 includes some alternatives to fxn+dev that seem to perform well, but a fuller test is needed. For example, one does R = R0 + dev, then imposes penalty using R-spawn_recruit_curve.

@cmlegault
Copy link
Contributor

ASAP uses the mean plus devs approach because it makes it easy to use phases to estimate the mean early and the devs later. However, with TMB and no need for phases, this does not seem like a good reason anymore.

For state-space models, we have seen some realizations blowing up (going to unbelievably high values) when using a random walk to simulate data including the process errors. When the simulations do not include the process errors, then this does not happen. An advantage of using the random walk process is that it lends itself well to including correlation in the process errors.

For FIMS v1, I think it makes sense to keep the mean plus devs approach to make it easier to compare to current models. In later versions, it will be "easy" to change to random walk if we want.

Cheers,
Chris

@timjmiller
Copy link
Contributor

I agree with @cmlegault that the modular programming in FIMS should allow for any number of alternative models for F and recruitment so any decision now hopefully doesn't disallow additional options later. Just for keeping parameters organized though, it may make sense to have a set of parameters that would always be fixed effects (e.g., first year value/mean, variance, correlation parameters) and a set of "deviation" parameters that may be treated as fixed or random effects. The subsets of each that are used would depend on the chosen option.

@Cole-Monnahan-NOAA
Copy link
Contributor

Maybe I misunderstand but it seems like the issue is whether to put a penalty on the devs, not whether to use them. If you constrain one of the devs so they sum to zero for instance, then the mean+devs approach will give the same values. You're still freely estimating N parameters.

The bias @Rick-Methot-NOAA mentioned comes about when you penalize the devs with a hyperdistribution. Agreed that if you have a trend then a simple iid normal penalty is violated (they're not exchangeable) and so it doesn't make sense to use that formulation.

I suppose I'm a fan of the fnx+dev approach too, at least initially. But if we want it to match existing software, e.g. F in SS3, then we'll have to find a way to enforce the sum-to-zero constraint. I think? Or we map off the mean and estimate the Fdevs separately with no penalty. Either way we have to drop a parameter and have no hierarchical penalty.

@Cole-Monnahan-NOAA
Copy link
Contributor

I forgot to respond to the actual questions

  1. Probably so people can do random effects? SAM does that for Fs too I think.
  2. I vote to use fnx+devs approach
  3. I don't think so? E.g. WHAM models log_naa as random effects rather than deviations centered at zero. Just have to parameterize it correctly internally to be statistically consistent I think.

@Rick-Methot-NOAA
Copy link

@Cole-Monnahan-NOAA correction. F in SS3 is just a vector of free parameters. Dev approach not used.
For recruitment, the fxn + sum-to-zero-dev approach was used in SS3 so that the resultant mean could be used in the equilibrium calcs for MSY, etc. But subsequent development and testing leads me to see more merit in simpler fxn+devs

@Cole-Monnahan-NOAA
Copy link
Contributor

@Rick-Methot-NOAA Yes I meant that we can parameterize F as mean+devs and then mimic SS3 by fixing the mean at 0 and having no penalty on the devs (they become freely estimated fixed effects). And we can mimic SAM by turning the mean back on and integrating out the devs as random effects (I think, I know very little about SAM). So I think that approach gives us sufficient flexibility for now.

@nathanvaughan-NOAA
Copy link
Contributor

Great point @Cole-Monnahan-NOAA. I had been leaning towards independent parameters but didn't think of just fixing the mean at zero to replicate independent parameters. That is a great idea! If we have that flexibility and non-zero-centered devs in general then including internal derived mean and variance parameters would allow us/users to run the model/optimizer however we/they prefer and run comparisons easily to see if one approach has significantly improved performance.

@JonBrodziak
Copy link
Contributor

JonBrodziak commented Oct 11, 2022 via email

@ChristineStawitz-NOAA ChristineStawitz-NOAA self-assigned this Nov 14, 2022
@ChristineStawitz-NOAA
Copy link
Contributor

from @jimianelli :

  • For population models where optimizations require getting the scale (magnitude) close, estimating the mean first can help avoid crazy non-plausible parameter space (i.e., using earlier phases for mean, latter phases for deviations)

  • have devs centered on mean zero should help with regularization or Bayesian applications, including having a switch for treating them as random effects

  • provides clarity in errors-in-variables applications (which I guess is similar to 2nd bullet)

  • provides some flexibility that otherwise might be less general and require case-specific code

Had a quick look a Bard (1974) which has been the bible for estimation, maybe something in there on it (didn't try very hard to find)

@ChristineStawitz-NOAA ChristineStawitz-NOAA modified the milestones: 1, MQ Dec 16, 2022
@ChristineStawitz-NOAA
Copy link
Contributor

Right now the approach is to have F be a vector of free parameters and recruitment to be parameterized with a mean recruitment function + devs which is similar to SS3 and should be fine for testing, but consider rearchitecting F as simple devs + mean for MQ

@timjmiller
Copy link
Contributor

wham followed asap3 and uses a "random walk" parameterization of F (initial logF and subsequent deviation parameters) that are all unpenalized fixed effects. A couple of days ago while working on an extension of wham, I changed to annual F parameters and found when estimating at least one of my test models a lack of convergence when starting from the same initial parameters so I changed back to using the deviations approach.

@Andrea-Havron-NOAA Andrea-Havron-NOAA added the status: needs discussion Dialogue is needed before a decision can be made. label Jul 11, 2023
@Andrea-Havron-NOAA Andrea-Havron-NOAA moved this to Needs Discussion in MQ Jul 12, 2023
@Andrea-Havron-NOAA Andrea-Havron-NOAA added the P2 mid-level priority label Jul 18, 2023
@Andrea-Havron-NOAA Andrea-Havron-NOAA modified the milestones: MQ, 2 Sep 26, 2023
@Andrea-Havron-NOAA Andrea-Havron-NOAA removed this from MQ Sep 26, 2023
@ChristineStawitz-NOAA ChristineStawitz-NOAA added the theme: NLL refactor Negative log likelihood label Jan 12, 2024
@ChristineStawitz-NOAA ChristineStawitz-NOAA modified the milestones: 2, Parking lot May 20, 2024
@ChristineStawitz-NOAA
Copy link
Contributor

is this a different issue than #186 or should we close one of them out?

@iantaylor-NOAA
Copy link
Contributor

They could be merged, but currently each contains unique suggestions that aren't represented in the other.

@ChristineStawitz-NOAA
Copy link
Contributor

Adding comments from #186 here to close that one out

Currently, we have implemented a vector of recruitment deviations and PrepareConstrainedDeviations method in FIMS M1 to add the sum-to-zero constraint to recruitment deviations without penalty. There are other recruitment dev options available.

Describe the solution you would like.
Comment from @Rick-Methot-NOAA:
Note that I hope FIMS considers SS3 recruitment dev options 3 and 4 also:
1=devvector (R=F(SSB)+dev);
2=deviations (R=F(SSB)+dev);
3=deviations (R=R0*dev; dev2=R-f(SSB)); [here penalty is based on dev2]
4=like 3 with sum(dev2) adding penalty
see nmfs-ost/ss3-source-code#29 for additional info

@ChristineStawitz-NOAA
Copy link
Contributor

from @k-doering-NOAA I'm not sure this if this is the best place to put this, but Liz Brooks just authored a perspective piece on modeling recruitment that may be of interest.

@Rick-Methot-NOAA
Copy link

Thanks Kathryn. We are evaluating that in SS3 at: nmfs-ost/ss3-source-code#191

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: question Further information is requested P2 mid-level priority status: needs discussion Dialogue is needed before a decision can be made. theme: NLL refactor Negative log likelihood
Projects
None yet
Development

No branches or pull requests

10 participants