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

user supplied priors and rrs parameterization of alpha_W and alpha_H #58

Open
tbuehrens opened this issue Jun 4, 2024 · 8 comments
Open
Assignees
Labels

Comments

@tbuehrens
Copy link
Collaborator

right now, with user supplied priors, you can only give two shape parameters for alpha_W and alpha_H...meaning in effect you have to have the same prior on both...in effect this means that you MUST use very vague priors for alpha_W or the model will force alpha_H to be similar (and delta to be small) due to the inability to give separate priors to each. I remain convinced that it would be better to parameterize the model in terms of alpha_W and delta_alpha (where delta_alpha is calculated by diveision rather than subtraction) so that you can put a prior on alpha_W and a prior on the relative productivity of alpha_H as a percentage of alpha_W (i.e., alpha_H = alpha_W * delta_alpha).

in my real worked case where this is a problem, I have a short timeseries where alpha_W for chinook is being estimated at 11 with super vague priors and alpha_H is near zero... if I tighten the prior on alphas then alpha_W drops but alpha_H increases...part of this is that the model must assign more recruits to the hatchery spawners, but part of the reason is that I can only supply the SAME prior for both alphas.... @ebuhle, should we change this parameterization or leave....interested in your thoughts

@tbuehrens
Copy link
Collaborator Author

tbuehrens commented Jun 4, 2024

current param also enables totally unreasonable RRS values...reparam in terms of delta (as ratio) would facilitate informative priors that constrain RRS to reasonable values: (RRS = alpha_H/alpha_W when Rmax is same for H and W)...also note ive truncated x axis but ratio goes to 15000
image

@tbuehrens
Copy link
Collaborator Author

here's another pathology--banana shaped posterior bi-plot of alpha_W and alpha_H:
image

@tbuehrens
Copy link
Collaborator Author

here's a version with the axes truncated...lest you worry that the plot above is dominated by outliers...still banana shaped:
image

@ebuhle
Copy link
Owner

ebuhle commented Jun 4, 2024

Hi @tbuehrens. Yes, it's true that the current implementation uses the same prior for $\alpha_\text{W}$ and $\alpha_\text{H}$, and for $R_\text{max,W}$ and $R_\text{max,H}$. It would be possible to relax this, so that if RRS != "none" you could specify separate priors for the respective W and H parameters. I'm working on the RRS S-R functions now; I'll add this to the to-do list.

To be clear, the deltas are defined as log-ratios, i.e. differences on the log scale, like $\delta_\alpha = \log\left(\alpha_\text{H} / \alpha_\text{W}\right)$. My rationale for parameterizing by the S-R parameters themselves rather than the deltas is that the latter implies structurally different priors on the W and H parameters, and past experience convinced me that this asymmetry is problematic, especially in the typical low-information context where we'd be fitting these RRS models. In other words, it becomes really difficult to tell whether any apparent differences between the W and H parameters are actually driven by the data / likelihood or merely an artifact of the prior asymmetry. Thinking of an RRS S-R function as a surface defined on a plane, I've found the best practice is to treat the shape parameters along both dimensions the same.

Given this challenging and data-hungry estimation problem, I guess I'm not too surprised to see long-tailed posteriors (which are common enough even with $\alpha$ in the standard S-R functions) or strong posterior correlations between $\alpha_\text{W}$ and $\alpha_\text{H}$. I would generally plot these parameters on the log scale -- since that's what the sampler sees, it gives us a better idea of whether the behavior is in fact pathological or just weakly informed.

@janohlberger
Copy link
Collaborator

Hard to say how problematic the asymmetry is without having looked at it... not optimal, but the benefit of making the log-ratio of productivities the primitive parameter would be that we can set rather informative priors, which may also help with estimation as it excludes a lot of unrealistic parameter space being sampled.

@ebuhle
Copy link
Owner

ebuhle commented Jun 6, 2024

Independent priors on the W and H parameters could also be informative, though. For example, if prior information suggests $\alpha_\text{H} / \alpha_\text{W}$ is likely to be around $r$, so $\delta_\alpha \approx \log(r)$, you could set $\log(\alpha_\text{W}) \sim N(m_\text{W}, s_\text{W})$ and $\log(\alpha_\text{H}) \sim N(m_\text{W} + \log(r), s_\text{H})$.

The advantage of this approach is that it still allows the option of setting identical, weakly informative priors on the W and H parameters to let the data speak. By contrast, suppose the primitive parameters and their priors are $\log(\alpha_\text{W}) \sim N(m_\text{W}, s_\text{W})$ and $\delta_\alpha \sim N(\log(r), s_\delta)$. Then the implied prior on $\log(\alpha_\text{H})$ is $N\left(m_\text{W} + \log(r), \sqrt{s_\text{W}^2 + s_\delta^2}\right)$, so it is always more diffuse than its W counterpart. To make matters worse, the specific form of the asymmetry depends on which spawner origin is arbitrarily chosen as the baseline; it would make just as much sense to parameterize by $(\alpha_\text{H}, \delta_\alpha)$.

When I was developing these RRS S-R functions with the Snake Spring / Summer Chinook populations -- a very large and informative data set by the standards of such things -- I found that the baked-in asymmetry of this parameterization made it impossible to tell whether posterior differences between the W and H parameters were "real". Independent priors on the W and H parameters would give you the flexibility to represent evidence that H spawners are less productive, or to check prior sensitivity by using identical reference priors.

@tbuehrens
Copy link
Collaborator Author

hey all, had a good chat with Eric and he won me over to the idea that there are some downsides of both parameterizations but probably the lowest hanging fruit is to modify the existing parameterization to enable distinct priors for hatchery and wild fish, as well as the multivariate equivalent in the pp model (separate hyper means and variances)...then we give those models a test drive and see if life is good...happy to catch anyone up on the phone if they want to hear the play by play of my 1 hr call with Eric ;-)

ebuhle added a commit that referenced this issue Jun 11, 2024
If user-specified priors are not provided, the default priors for W and H are the same

Addresses #58
@ebuhle
Copy link
Owner

ebuhle commented Jun 11, 2024

OK, the proposed approach of allowing independent priors on W and H S-R parameters has been implemented for the IPM_SS_np model in the rrs branch. The syntax should be self-explanatory; from ?salmonIPM::priors:

If RRS != "none", the global spawner-recruit parameters must be replaced with their W and H counterparts; e.g. if RRS == "alpha" then instead of a prior on alpha one would specify priors on alpha_W and alpha_H. If the former is provided, it will have no effect. See [salmonIPM()] for details of the RRS argument.

(Relatedly, the Markdown table showing which parameters in each model can take user-defined priors is no longer rendering properly for some reason. 😕)

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

No branches or pull requests

4 participants