brianlangseth-NOAA / Spatial-Workshop-SPASAM

Spatially stratified simulation-estimation framework incorporating multistage stock-recruit relationships and incorporating larval IBM outputs
1 stars 0 forks source link

TO DO: Model scale #23

Closed brianlangseth-NOAA closed 2 years ago

brianlangseth-NOAA commented 2 years ago

Currently, Rave is entered as B0/1000. Need to confirm whether catch values also need to be rescaled.

brianlangseth-NOAA commented 2 years ago

Below is the data inputs (or derived quantities) that are subject to scaling, and the scales they are entered as in parenthesis. @JDeroba I dont see any scale issues. To answer the original question, R0 should be divided by 1000 to get that in 1000s of individuals.

Entered data inputs -R0 (currently entered in as 1000s of individuals - bdat$B0/1000 in data_loading.R) -Catches (current numbers are 1000s of individuals - barplot(colSums(dat$catch[,1:7])/1000) gives similar scale as Figure 4 in OM description so dat$catch is in 1000s) -Initial abundance (1000s of individuals - same as R0, exponentially decayed from R_ave) -weight (kg) -length bins (cm)

Derived quantities -SSB0 (calculated as metric tons; 1000 individuals x kg per individual) -Biomass (same as SSB0) -Weight/length parameters (properly scaled so that weight is in kg if length is in cm)

JDeroba commented 2 years ago

Text from an email from Jon to Brian, April 1, 3:16pm EST:

I kind of sort of figured out the initial conditions issues, and they harken back to issues of scale. I'm not sure if it is an error in scale for how we entered the data (I know you checked this I agreed that it seemed OK) or just an issue of the model itself not being able to pin down what the scale of the population should be. Here was my process:

1) Only estimate Rave and q. Specify InitN (not estimated or calculated in the model at all). As you know, the population starts huge at our InitN and then crashes. I thought maybe F was really high and keeping the population on the descending limb of the BH curve, which would just drive the population to crash since recruitment was deterministic (i.e., not estimating devs) 2) I estimated rec devs. This didn't fix the problem, although the model fit in a couple hours with a descent gradient. 3) Since I initially thought F might be crashing the population, I set F equal to 0.02 for all fleets and years. This delayed the crash but didn't prevent it. 4) At this point, I know mortality is not causing the crash, so it has to be something misspecified or a problem with recruitment. After some sleuthing, I found that Rave was being estimated to be an order of magnitude less than the value we were specifying for age-1 InitN. So we were starting the population an order of magnitude higher than what the model thinks average recruitment should be. So again, either something is wrong with the scale of the data as we entered it, or the model itself is struggling to pin down the scale of the population during estimation. The estimated Rave was eerily close to exactly an order of magnitude less than our age-1 InitN (we used 97251, the estimate was ~9333). 5) My "solution" was to divide our InitN at age values by ten. This fixed the problem in the sense that the population doesn't crash and finds a stable level after a few years. 6) Now, still just estimating Rave and q, I tried estimating InitN at age to see what the model wanted to do. Other than age-1 (=Rave), the model estimated all InitN as 0. So this failed. I then set InitN as exponential decay from Rave and this worked just fine (worked in the sense of 5). 7) Now using the model described in 6 (estimate Rave and q; InitN as exponential decay), I estimated the logistic survey selectivity parameters. This worked great! We actually nail the scale of the survey biomass observations. 8) I'm trying to do a run now that estimates fishery selectivity, but I'm getting some oddities and increased run times.

Attached is the dat and diagnostics from 7 (note the scale of the biomass figures in the diagnostics file don't go to zero). It runs in a reasonable time (I didn't time it exactly but say 15 minutes). Do you think I should push this dat to the github page?

Seems like progress to me. Although I'm still not sure what's up with the scale and our interpretation of InitN. Perhaps we mistakenly used grams instead of kilograms somewhere? That would create a difference of an order of magnitude. I don't know though

Model_Diagnostics_survest.pdf

brianlangseth-NOAA commented 2 years ago

Im going to close this. Current models estimate Rdev near to what is expected and our scale doesn't seem to be an issue. Larger issues are addressed in #32 (discussing decay from R0 option) and #34 (exploring why population crashes and have really high F estimates)