Error when undertaking a forecast with zero F
Hi,
the stockasssessment::forecast function now returns a summary tables with quantiles for a stochastic forecast but this causes an error if you're projecting a stock with zero catch advice in any year, i.e.
forecast(fit, fval = c(0.8,0.6,0,0.2), ave.years=2017:2019, rec.years=2005:2019, splitLD=TRUE, nosim = 50001)
Error in quantile.default(x, c(0.5, 0.025, 0.975)) : missing values and NaN's not allowed if 'na.rm' is FALSE
Hi,
This is correct F=0 will fail in the current implementation. A quick workaround is to set F to a very small number instead (e.g. F=1e-9)
Hi,
Thanks, yes this is what I ended doing. To understand, are you saying this is a feature, i.e. expected behaviour in this case?