ppnAgeErr: Generate log-normal error associated with proportions data

Description Usage Arguments Value Examples

View source: R/ppnErr.R

Description

This function generates proporations at age with multivariate logistic error (Schnute and Richards 1995, eqns.S.9 and S.10). Includes an adjustment to skip calculations when dealing with populations that have fixed age struc- tures (e.g. pink salmon).

Usage

1
ppnAgeErr(ppnAgeVec, tau, error)

Arguments

ppnAgeVec

A numeric vector of proportions of individuals returning at a given age. nAges = length(ppnAgeVec).

tau

A numeric specifying the parameter representing average variation in proportions (e.g. observed interannual variation in age stracuture).

error

A numeric vector of length nAges that specifies random values to deviate proportions by (generally generated from a uniform dis- tribution bounded by 0 and 1).

Value

Returns a numeric vector of length nAges representing pro- portions for each class.

Examples

1
2
3
4
5
ppnAgeVec <- c(0.2, 0.4, 0.3, 0.1)
nAges <- length(ppnAgeVec)
tau <- 0.7
error <- runif(nAges, 0.0001, 0.9999)
ppnAgeErr(ppnAgeVec, tau, error)

TESA-workshops/TESAsamSim documentation built on Feb. 6, 2021, 12:25 a.m.