Pacific-salmon-assess / samSim

3 stars 0 forks source link

Wrong bm values will be produced if RickerSurv recruitment and "habitat" benchmarks are used #17

Closed catarinawor closed 2 years ago

catarinawor commented 2 years ago

This is not an issue that will happen for the study cases we are working on now, but may happen if we expand this study. I noticed that for the priming period Smsy and Sgen are used for the habitat benchmarks. The problem is that refAlpha[k] is used, which will produce wacky benchmarks if model[k] == "rickerSurv".

I suggest modifying this condition to:


if (bm == "habitat"){
                # this gives same result as stockRecruit for nPrime period
                sMSY_habitat[y, k, n] <- sMSY[y, k, n]      
                sGen_habitat[y, k, n] <- sGen[y, k, n]
                upperBM[y, k] <- ifelse(!is.na(sMSY_habitat[y, k, n]),
                                        0.8 * sMSY_habitat[y, k, n],
                                        0)
                lowerBM[y, k] <- ifelse(!is.na(sGen_habitat[y, k, n]),
                                        sGen_habitat[y, k, n],
                                        0)
              }
carrieholt commented 2 years ago

I agree. Thanks. Please go ahead and make the change.

catarinawor commented 2 years ago

Done. thanks!