RI2BP: Calculate Breeding Proportion from Remigration Interval.

View source: R/RI2BP.R

RI2BPR Documentation

Calculate Breeding Proportion from Remigration Interval.

Description

This function calculates breeding proportion (BP) from Remigration Interval (RI).
RI can be a vector of RI, one per individual, or an aggregated value with mean and sd and several categories can exist. See examples.

Usage

RI2BP(
  proportion = 1,
  RI = c(mean = 2, sd = 0),
  sampling = 10000,
  replicates = 100
)

Arguments

proportion

A vector of the proportion of different categories

RI

The RI of individuals - See description

sampling

Number of individuals for sampling

replicates

Number of replicates to estimate SE

Details

RI2BP calculate Breeding Proportion from Remigration Interval.

Value

Return a vector with mean and se.

Author(s)

Marc Girondot marc.girondot@gmail.com

See Also

Other Model of Remigration Interval: Bayesian.remigration(), LnRI_norm(), RI(), plot.Remigration()

Examples

## Not run: 
library(phenology)
# Example
RI <- c(mean=3, sd=0)
RI2BP(RI=RI)

RI <- c(mean=2, sd=0.3)
RI2BP(RI=RI)

RI <- c(mean=4, sd=0)
RI2BP(RI=RI)

RI <- c(mean=c(2, 10), sd=c(0, 0))
proportion <- c(0.5, 0.5)
RI2BP(proportion=proportion, RI=RI)

c <- c(c1=0.1, c2=0.72, c3=0.126, c4=0.0378, c5=0.0162)
plot(1:5, c, xlab="RI", ylab="Proportion", las=1, bty="n", type="h")
RI2BP(proportion=c, RI=c(mean=1:5, sd=rep(0, 5)))

# To generate random RI with known mean and sd using 
# a truncated lognormal distribution (because 0 does not exist)
mean <- 2.5 - 1
sd <- 1
location <- log(mean^2 / sqrt(sd^2 + mean^2)) 
shape <- sqrt(log(1 + (sd^2 / mean^2)))   
RI <- round(rlnorm(100, meanlog = location, sdlog = shape))+1
mean(RI); sd(RI) # All is ok !
plot(table(RI), xlab="RI", ylab="Proportion", las=1, bty="n", type="h")
RI2BP(proportion=proportion, RI=RI)


## End(Not run)

phenology documentation built on June 17, 2025, 9:08 a.m.