rand: rand

randFnR Documentation

rand

Description

Simulates a biodyn object for a catch series, given the parameter estimates in the param slot and variance covariance matrix http://young.physics.ucsc.edu/jackboot.pdf

Usage

randFn(n, object, sim)

Arguments

n

numeric with number of simulations

object

biodyn

sim

a biodyn object

...

other arguments

Value

biodyn with estimates of stock based on catch time series

Examples

## Not run: 
#simulate an object with known properties
bd=sim()
bd=window(bd,end=49)

#simulate a proxy for stock abundance
cpue=(stock(bd)[,-dims(bd)$year]+stock(bd)[,-1])/2
cpue=rlnorm(1,log(cpue),.2)

#set parameters
setParams(bd) =cpue
setControl(bd)=params(bd)
control(bd)[3:4,"phase"]=-1

#fit
bd=fit(bd,cpue)

bdJK=fit(bd,jackknife(cpue))


bdRnd  =rand(100,bd,bdJK)

plot(rand(100,stock(bd)[,40:45],stock(bdJK)[,40:45]))

## End(Not run)

laurieKell/mpb documentation built on Sept. 9, 2023, 9:47 p.m.