lkerr / groundfish-MSE

Development of Robust Management Strategies for Northeast Groundfish Fisheries in a Changing Climate
MIT License
4 stars 2 forks source link

haddockGB problems #217

Closed mle2718 closed 2 years ago

mle2718 commented 2 years ago

This is all in the EconOnly2 branch. I recently merged main into EconOnly2.

edit: The codGOM model runs just fine by setting

stockExclude <- c('haddockGB', 'codGB', 'pollock', 'yellowtailflounderGB')

When I try to run a "Standard Fisheries" model with this:

stockExclude <- c('codGB', 'pollock', 'yellowtailflounderGB')

I get this red warning from ASAP

Estimating row 76 out of 76 for hessian
Estimated covariance matrix may not be positive definite
 3.48703e-09 1.19525e-08 9.47668e-08 1.30928e-07 1.77615e-07 2.07393e-07 2.57873e-07 3.34409e-07 3.96471e-07 4.48765e-07 4.73778e-07 5.43246e-07 5.65895e-07 6.82252e-07 7.45687e-07 7.64472e-07 8.55763e-07 9.09032e-07 1.02617e-06 1.30022e-06 1.33438e-06 1.4985e-06 1.53258e-06 1.83064e-06 1.9544e-06 2.36647e-06 2.43551e-06 2.64259e-06 2.77437e-06 2.88237e-06 2.92095e-06 3.27793e-06 3.52455e-06 3.5575e-06 4.31336e-06 4.50771e-06 4.96326e-06 5.17557e-06 5.57698e-06 5.78406e-06 5.84167e-06 6.17974e-06 6.42809e-06 6.50596e-06 6.68895e-06 6.97777e-06 7.25844e-06 7.43749e-06 7.6878e-06 7.94803e-06 8.31446e-06 8.37821e-06 8.46512e-06 8.51727e-06 9.27498e-06 1.02415e-05 1.03622e-05 1.13711e-05 1.21195e-05 1.25888e-05 1.29246e-05 1.35034e-05 1.4288e-05 1.50725e-05 1.54205e-05 1.61545e-05 1.68592e-05 1.6948e-05 1.7358e-05 1.8366e-05 1.88501e-05 1.94474e-05 2.05612e-05 2.08307e-05 2.66741e-05 4.85014e-05

starting time: Wed May 11 18:42:15 2022
finishing time: Wed May 11 18:42:17 2022
This run took: 0 hours, 0 minutes, 2 seconds.

This looks like a model failing to converge, but I don't know if it is causing the subsequent error message, so the above may be a red herring. But I do get this message:

Error in if (!type %in% c("BH", "BHSteep", "HS")) { : 
  argument is of length zero
Called from: get_recruits(type = type, type2 = type2, par = Rpar, SSB = SSB, 
    TAnom = TAnom, pe_R = sdR, R_ym1 = 1, block = "late", Rhat_ym1 = 1, 
    R_est = parpop$R)

traceback() gives this

5: get_recruits(type = type, type2 = type2, par = Rpar, SSB = SSB, 
       TAnom = TAnom, pe_R = sdR, R_ym1 = 1, block = "late", Rhat_ym1 = 1, 
       R_est = parpop$R) at Rfun_BmsySim.R#25
4: Rfun(type = stockEnv$R_typ, parpop = parpop, parenv = parenv, 
       parmgt = parmgt, SSB = c(N[y - 1, ]) %*% c(parpop$waa * parpop$mat), 
       sdR = stockEnv$pe_R, TAnom = Tanom[y], Rest = Rest) at get_proj.R#156
3: get_proj(type = "current", parmgt = parmgtproj, parpop = parpopproj, 
       parenv = parenv, Rfun = Rfun_BmsySim$forecast, F_val = F, 
       ny = 200, stReportYr = 2, stockEnv = stockEnv) at get_nextF.R#185
2: get_nextF(parmgt = mproc[m, ], parpop = tempStock$parpop, parenv = parenv, 
       RPlast = NULL, evalRP = TRUE, stock = tempStock) at get_advice.R#114
1: get_advice(stock = stock[[i]])

Not a clue what's going on here.

samtruesdell commented 2 years ago

This seems like it is also a recruitment issue so I wonder if it's related to the other issue -- possibly something in the codGOM parameter setup file

mle2718 commented 2 years ago

@samtruesdell : could be related. But it's not a codGOM problem -- the model runs on just codGOM.

lkerr commented 2 years ago

Yes, message indicates that stock assessment model failed to converge. GB haddock had been running fine recently for Mackenzie. I will look into this further

jerellejesse commented 2 years ago

I think the problem is in the haddockGB stock parameter file. It has R_mis specified in two different spots. One was set to false and the other to true, lines 48 and 91. Worked fine for me locally when I fixed that.

mle2718 commented 2 years ago

@jerellejesse nice catch. Do you mind fixing it? I have no clue whether it should be True or False.

jerellejesse commented 2 years ago

Yes, I'm working on merging these fixes into the master.

jerellejesse commented 2 years ago

For now the fix for haddock is in the dev branch while I work out the other issues for yellowtail and pollock!

mle2718 commented 2 years ago

@jerellejesse awesome. I've merged Dev into the EconOnly2 branch. I'll try to test out soon.

mle2718 commented 2 years ago

Tested working! Thanks again @jerellejesse