Learn R Programming

lhmixr (version 0.1.0)

get_growth_post_prob: 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.

Examples

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

Run the code above in your browser using DataLab