ppnAgeErr: Generate log-normal error associated with proportions data

View source: R/ppnErr.R

ppnAgeErrR Documentation

Generate log-normal error associated with proportions data

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

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

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)


CamFreshwater/samSim documentation built on Sept. 25, 2023, 10:22 a.m.