calcFM | R Documentation |
Calculate FM based on target catch
calcFM(
obj,
Ctarget = 1000,
FMStart = NULL,
lower = 0.01,
upper = 2,
year = NULL,
seed = 1,
abstol = 5
)
obj |
bla |
Ctarget |
bla |
FMStart |
bla |
lower |
bla |
upper |
bla |
year |
bla |
seed |
bla |
abstol |
numeric. Absolute tolerance for quota |
unit |
bla |
season |
bla |
area |
bla |
iter |
bla |
value
set.seed(1)
stk <- create.FLIBM(year=ac(2000:2009))
range(stk$stock.a)[c("minfbar", "maxfbar")] <- c(1,3)
stk <- spinup.FLIBM(stk, nyearsmax = 20, nyearsslope = 5)
stk <- adv.FLIBM(obj = stk, year = ac(2000:2004))
plot(stk$stock.a@stock.n)
plot(simplifySeason(stk))
# optim version
system.time(res <- calcFM(obj = stk, Ctarget = 1200, year = "2005", seed = 1))
res$par # best val
res$value # difference to target
# check
set.seed(1)
stk2 <- stk
stk2$harvest$params$FM <- c(res$par)
stk2 <- adv.FLIBM(obj = stk2, year = "2005")
# total catches
apply(stk2$stock.a@catch.n * stk2$stock.a@catch.wt, 2, sum, na.rm=TRUE)
# fishing mortality
apply(harvest(stk2$stock.a),1:2, sum, na.rm=TRUE)
fbar(simplifySeason(stk2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.