nwfsc-cb / phenomix

R package for fitting distributions to run timing data via maximum likelihood
5 stars 0 forks source link

Enhancements for in-season forecasting #2

Open marksorel8 opened 8 months ago

marksorel8 commented 8 months ago

I'm thinking that one particular use of this model could be projecting salmon run sizes based on dam counts observed in season. Specifically, we monitor daily counts at Bonneville Dam to update preseason forecasts of salmon returns. The idea is that if you know the counts through ~50% of the typical run, the total run should be twice those counts. You can imagine how having a model that predicts the shape of the run based on past years' counts and some observations for the current year could be useful for that.

I wonder if adding AR1 random effects to the linear predictor might be helpful for this purpose, because counts tend to have small peaks and troughs (often related to river flow, temperate, and dam operations) overlaid on the general run-timing curve.

I also wonder if having an optional linear predictor for Theta (the scaling parameter) might be useful for this purpose. I imagine one might input Jack returns from the previous year or a pre-season forecast as a covariate.

If these seem like useful enhancements, and you are interested in adding them to the package, I would be happy to help.

ericward-noaa commented 8 months ago

Hey Mark -- great ideas, these are both useful, and I'd love the help. I just moved this repo out of the official NOAA organization (to give you more access) and added you with push access.

Maybe hold off on making any changes for a week or so. One of the items on my TODO list has been to think about making a version of this that runs in RTMB, which should be easier for others to add things going forward. I will add that code on a branch -- and maybe we can work off of that

ericward-noaa commented 8 months ago

Added my local files to this branch for the time being: https://github.com/nwfsc-cb/phenomix/tree/rtmb

There's still some debugging I need to do to get examples working again, but it's close

marksorel8 commented 8 months ago

Awesome! That was fast! Cool to see this in rtmb, and I agree this will make further development more accessible.

After you merge the rtmb branch into main, I'll make a new branch to experiment with covariates for theta and AR1 random effects.

It also occurs to me that it might also be useful if I put together an example of my particular use case. Could be another vignette her, but probably best to start another repository for that? ... with the idea that it is more of a stand-alone analysis than an example, to compare in-season forecast performance using Phenomix to some other methods that we typically employ.