lhPar: Generates life history parameters

View source: R/backup/lhPar.R View source: R/FLife-lhPar.R

lhParR Documentation

Generates life history parameters

Description

Uses life history theory to derive parameters for biological relationships, i.e. or growth, maturity, natural mortality. Selectivity by default is set so age at peak selectivity is the same as age at 50% mature (a50) As a minimum all 'lhPar' requires is 'linf' the asymptotic length of the von Bertalannfy growth equation.

Uses life history theory to derive parameters for biological relationships, i.e. or growth, maturity, natural mortality. Selectivity by default is set so age at peak selectivity is the same as age at 50% mature (a50) As a minimum all 'lhPar' requires is 'linf' the asymptotic length of the von Bertalannfy growth equation.

Usage

lhPar(
  ...,
  m = list(model = "gislason", params = c(m1 = 0.55, m2 = -1.61, m3 = 1.44)),
  k = function(params, a = 3.15, b = -0.64) a * params["linf"]^b,
  t0 = function(params, a = -0.3922, b = -0.2752, c = -1.038) -exp(a - b *
    log(params$linf) %-% (c * log(params$k))),
  l50 = function(params, a = 0.72, b = 0.93) a * params["linf"]^b
)

lhStk(
  ...,
  k = function(params, a = 3.15, b = -0.64) a * params["linf"]^b,
  t0 = function(params, a = -0.3922, b = -0.2752, c = -1.038) -exp(a - b *
    log(params$linf) %-% (c * log(params$k))),
  l50 = function(params, a = 0.72, b = 0.93) a * params["linf"]^b,
  gowth = vonB,
  mat = logistic,
  sel = dnormal,
  sr = "bevholt",
  m = list(model = "gislason", params = c(m1 = 0.55, m2 = -1.61, m3 = 1.44)),
  fmult = function(x) refpts(x)["msy", "harvest"] %*% FLQuant(seq(0, 2, length.out =
    100)),
  range = c(min = 0, max = 40, minfbar = 1, maxfbar = 40, plusgroup = 40),
  spwn = 0,
  fish = 0.5,
  midyear = 0.5
)

Arguments

t0

of von Bertalanffy. This is a default that isnt normally derived from life history theory, as are the following args.

sr

obsolete now replaced by sel3

params

FLPar object with parameters for life history equations and selection pattern. Need Linfinity to estimate other parameters, if any other parameters supplied in code then these are not provided by the algorithm

a

coefficient of length weight relationship

b

exponent of length weight relationship

ato95

age at which 95% of fish are mature, offset to age at which 50% are mature

s

steepness of stock recruitment relationship

v

virgin biomass

sel1

selectivity-at-age parameter for double normal, age at maximum selectivity by default set to same as age at 100% mature

sel2

selectivity-at-age parameter for double normal, standard deviation of lefthand limb of double normal, by default 5

sel3

selectivity-at-age parameter for double normal, standard deviation of righthand limb of double normal, by default 5000

sl

obsolete now replaced by sel2

m1

m-at-age parameter by default for Gislason empirical relationship

m2

m-at-age parameter, by default for Gislason empirical relationship

m3

m-at-age parameter, by default for Gislason empirical relationship

Value

object of class FLPar with missing parameters calculated from life history theory

object of class FLPar with missing parameters calculated from life history theory

See Also

loptAge, lhRef, lhPar, lhEql

loptAge, lhRef, lhPar, lhEql

Examples

## Not run: 
#COMPARE with output of FLife::lhPar

x <- as(lhpar(linf=100), 'list')
x <- x[sort(names(x))]
y <- as(lhPar(FLPar(linf=100)), 'list')
y <- y[sort(names(y))]

all.equal(x,y)

for(i in seq(length(x)))
   cat(names(x[i]), ":", unlist(x[i]), "-", names(y[i]), ":", unlist(y[i]), "\n")
   
 # CALL with iters
 lhpar(FLPar(linf=100), v=rnorm(100, 300, 200))
 
 lhPar(FLPar(linf=rnorm(100, 80, 10)))
 lhPar(FLPar(linf=100, v=rnorm(100, 300, 200)))
 lhPar(FLPar(linf=100), FLPar(v=rnorm(100, 300, 200)))
 lhPar(FLPar(linf=100, v=rnorm(100, 300, 200)), t0=-1, data.frame(a=1,b=7))
 
 attributes(lhpar(FLPar(linf=100), v=rnorm(100, 300, 200)))$mmodel

## End(Not run)

## Not run: 


flr/FLife documentation built on March 29, 2024, 5:50 p.m.