lnorms: Generate random lognormal values for fertility rates

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/lnorms.R

Description

Converts standard normal random values to lognormals with defined means and variances

Usage

1
lnorms(n, mean = 2, var = 1)

Arguments

n

number of observations

mean

mean value of the fertility rate, default 2

var

variance of the vital rate (not standard deviation), default 1

Details

converted Matlab code from Box 8.4 in Morris and Doak (2002)

Value

A vector of random lognormal values

Note

This function could probably be replaced with built-in functions for the Log Normal Distribution rlnorm

Author(s)

Original Matlab code by Morris and Doak (2002: 281). Adapted to R by Patrick Nantel, 20 June 2005.

References

Morris, W. F., and D. F. Doak. 2002. Quantitative conservation biology: Theory and practice of population viability analysis. Sinauer, Sunderland, Massachusetts, USA.

See Also

stretchbetaval

Examples

1
2
3
4
5
6
7
8
lnorms(1)
# Generate lognormal random fertilities
# for a population of 1000 mature individuals with mean fertility of
# 3 and inter-individual variance in fertility of 1.5.
rndfert  <- lnorms(1000, 3,1.5)
summary(rndfert)
hist(rndfert,40, main="Lognormal random fertilities",
xlab="Fertility rate", col="blue")

cstubben/popbio documentation built on Sept. 26, 2019, 3:57 a.m.