calc_d.tsa: (SPFI) Calculate the distribution parameters grouped by...

Description Usage Arguments Details Value Examples

Description

This is equivalent to equation 1 in the draft SPFI document. This function does a single estimate of the d values. It does not perform iterations to optimize.

Usage

1
calc_d.tsa(r.tsa.sum, n.ysa, hcwt.ty = NULL, standardize.bol = FALSE)

Arguments

r.tsa.sum

Output from calc_tsa.sum.

n.ysa

Synonymous with CWTPop in VB or: hrj.df[hrj.df$data.type=="Pop" & hrj.df$fishery.index == 1,]

hcwt.ty

Output from calc_hcwt.ty.

standardize.bol

A Boolean, default=FALSE.

Details

The initial call of this function will have no data for hcwt.ty. If this is true, then the values are set to 0.01 as is done in the Visual Basic.

Value

A data frame of the distribution parameter estimates grouped by fishery stratum, stock, and age.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
#look to \code{\link{buildSPFIscript}} for creating hrj.df
hrj.df <- hrj.df[hrj.df$spfiflag==1,]
cwtpop <- hrj.df[hrj.df$data.type=="Pop" & hrj.df$fishery.index == 1 & hrj.df$Stock.Number %in% stock.subset,]
cwtpop <- subset(cwtpop,select = -fishery.index) #n.ysa
cwtcatch <- hrj.df[hrj.df$data.type=="NomCat" & hrj.df$fishery.index %in% fishery.subset & hrj.df$Stock.Number %in% stock.subset,]
if(region=="seak") cwtcatch <- adjustAlaska(x = cwtcatch, data.catch = data.catch)
r.tsa.sum <- calc_tsa.sum(x = cwtcatch, newvar.name = "r.tsa.sum")
d.tsa <- calc_d.tsa(r.tsa.sum = r.tsa.sum, n.ysa = cwtpop, standardize.bol = TRUE)

## End(Not run)

MichaelFolkes/ctctools documentation built on May 7, 2019, 4:56 p.m.