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

treatment of excluded index observations in plot comparing all indices? #813

Open
iantaylor-NOAA opened this issue May 23, 2023 · 1 comment

Comments

@iantaylor-NOAA
Copy link
Contributor

@EJDick-NOAA noted that an index with all observations excluded via negative fleet number was not appearing in the plot comparing all indices created by SS_plots(). The current logic (in https://github.com/r4ss/r4ss/blob/main/R/SSplotIndices.R#L631-L632) is to not show the index at all if all of the the observations are excluded, but if at least one observation is included in the likelihood, then all of them appear in the plot.

The status-quo setup doesn't make much sense as it leads to silly plots like the one below for 2022 hake where the years without a survey have dummy observations in order to get expected values from the model. In this case the points should not appear in the plot. On the other hand, this plot could be useful to see how an index compares to the others even if it's not included in the likelihood for the final model.

Two options for cleaning this up are

  1. Never plot observations that are excluded from the likelihood. This would solve the hake plot issue. If you want to exclude an index from the model but include it in this figure, you would need to set lambda = 0 (as described below) and keep the fleet numbers positive.
  2. Add an additional input to give the user control over whether excluded observations get plotted or not.

I like option 1 better but thought I would post this for feedback before making any changes.

image

Note: to exclude an index via lambda = 0, you would include something like the lines below near the bottom of your control file:

# read changes to default Lambdas (default value is 1.0)
# Like_comp codes:  1=surv; 2=disc; 3=mnwt; 4=length; 5=age; 6=SizeFreq; 7=sizeage; 8=catch; 9=init_equ_catch; 
# 10=recrdev; 11=parm_prior; 12=parm_dev; 13=CrashPen; 14=Morphcomp; 15=Tag-comp; 16=Tag-negbin; 17=F_ballpark; 18=initEQregime
#like_comp fleet  phase  value  sizefreq_method
 1         1      1      0      999
-9999  1  1  1  1  #  terminator
@kellijohnson-NOAA
Copy link
Contributor

I honestly haven't thought all of the way through this but option one seems to muddy the waters with settings in the control file dictating output for {r4ss} where I see the control file as settings just for SS3. That is, I wouldn't want to have to change my control file to make {r4ss} plot something differently so I think that it should be an input argument to the function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants