get_growth_post_prob {lhmixr}R Documentation

Posterior probability of sex being female based on growth

Description

get_growth_post_prob returns the probability of the observation(s) arising from the female component given a set of growth parameters and an assumed distribution (normal or lognormal). The component probability is given by Bayes' theorem. Used internally.

Usage

get_growth_post_prob(mixprop, muF, muM, sigmaF, sigmaM, data, distribution)

Arguments

mixprop

Numeric scalar of mixing proportion (overall sex ratio)

muF

Numeric vector with predicted female lengths

muM

Numeric vector with predicted male lengths

sigmaF

Numeric scalar for female residual standard deviation

sigmaM

Numeric scalar for male residual standard deviation

data

A data.frame with column "length". Note predicted means "muF" and "muM" must come from corresponding ages.

distribution

Character with options: "normal" or "lognormal".

Value

Numeric vector of the posterior probability of being female.

Source

Minto, C., Hinde, J. and Coelho, R. (2017). Including unsexed individuals in sex-specific growth models. Canadian Journal of Fisheries and Aquatic Sciences. DOI: 10.1139/cjfas-2016-0450.

Examples

get_growth_post_prob(mixprop = 0.5, muF = 4, muM = 6, sigmaF = 1,
                          sigmaM = 1, data = data.frame(length = 4.5), distribution = "normal")

[Package lhmixr version 0.1.0 Index]