idx.sim: generates FLIndex with lognormal annual and multinomial age...

View source: R/OMsim.R

idx.simR Documentation

generates FLIndex with lognormal annual and multinomial age composition observation error

Description

generates FLIndex with lognormal annual and multinomial age composition observation error

Usage

idx.sim(
  object,
  sel = catch.sel(object),
  ages = NULL,
  years = NULL,
  ess = 200,
  sigma = 0.2,
  q = 0.01
)

Arguments

object

FLStock

sel

FLQuant with selectivity.pattern

ages

define age range

years

define year range

ess

effective sample size for age composition sample

sigma

annual observation error for log(q)

q

catchability coefficient for scaling

Value

FLIndex

Examples

data(ple4)
sel = newselex(catch.sel(ple4),FLPar(S50=1.5,S95=2.1,Smax=4.5,Dcv=1,Dmin=0.1))
ggplot(sel)+geom_line(aes(age,data))+ylab("Selectivity")+xlab("Age")
object = propagate(ple4,10)
idx = idx.sim(object,sel=sel,ess=200,sigma=0.2,q=0.01,years=1994:2017)
# Checks
ggplot(idx@sel.pattern)+geom_line(aes(age,data))+ylab("Selectivity")+xlab("Age")
ggplot(idx@index)+geom_line(aes(year,data,col=ac(iter)))+facet_wrap(~age,scales="free_y")+
theme(legend.position = "none")+ylab("Index")

Henning-Winker/FLRef documentation built on July 14, 2024, 7:28 a.m.