ProbToRate: Convert a probability to a rate

Description Usage Arguments Value Examples

View source: R/transition.R

Description

Converts a vector of probabilities to a vector of rates.

Usage

1
ProbToRate(p, t = 1)

Arguments

p

A vector of probabilities.

t

The time frame of the probability.

Value

A vector of rates in the unit of time t. If any probabilities are less than 0 or greater than 1, the function returns NULL.

Examples

1
2
3
# For a cumulative probability of 50% over 2 years
ProbToRate(0.5,2) # returns an annual rate of 0.35
ProbToRate(0.5,24) # returns a monthly rate of 0.02 

austinnam/modeltools documentation built on Aug. 3, 2019, 7:20 p.m.