opt.bisect: Bisection approach to optimise x for maximising y

View source: R/SimRefs.R

opt.bisectR Documentation

Bisection approach to optimise x for maximising y

Description

The plain bisection algorithm (Burden & Douglas, 1985) is employed here to find the value of a given forecast target quantity (e.g. 'fbar') for which a selected value of a performance statistic is obtained over a chosen period.

Usage

opt.bisect(
  stock,
  sr,
  deviances = rec(stock) %=% 1,
  metrics,
  statistic,
  years,
  pyears = years,
  tune,
  tol = 0.001,
  maxit = 15,
  log = TRUE,
  verbose = TRUE
)

Arguments

stock

object class FLStock

sr

object class FLSR

metrics

FLQuant of FLStock to be defined

statistic
years

years to be evaluated

tune

range for input x

tol

tolerance level

maxit

number of optimisation steps

log

if TRUE, optimise on log-scale

Author(s)

Credits to Iago Mosqueira

References

Burden, Richard L.; Faires, J. Douglas (1985), "2.1 The Bisection Algorithm", Numerical Analysis (3rd ed.), PWS Publishers, ISBN 0-87150-857-5

Examples

data(ple4)
stock <- propagate(stf(ple4, end=2118), 200)
srr <- predictModel(model=rec ~ ifelse(ssb <= b, a * ssb, a * b), params=FLPar(a=1.29, b=1.35e+06))
# GENERATE SRR deviances
devs <- ar1rlnorm(rho=0.4, 2018:2118, iters=200, meanlog=0, sdlog=0.5)
# DEFINE MMY statistic
statistic <- list(MMY=list(~apply(L,1,median), name="MMY",
  desc="ICES Maximum Median Yield"))
# CALL bisect over 100 years, Fmmy calculated over last 50.
fmmy <- opt.bisect(stock, sr=srr, deviances=devs, metrics=list(L=landings), 
statistic=statistic, years=2018:2118,
pyears=2069:2118, tune=list(fbar=c(0.01, 0.2)))
# fmmy
mean(fbar(fmmy)[,ac(2069:2118)])  

Henning-Winker/FLRef documentation built on Dec. 16, 2024, 7:23 p.m.