prior_fr: prior_fr

Description Usage Arguments Details Value Examples

View source: R/temporal_discounting.R

Description

Calculate the prior probability of freedom (year = k)

Usage

1
prior_fr(post_fr, intro)

Arguments

post_fr

The posterior probability of freedom (year = k-1)

intro

The annual probability of introduction

Details

In order to calculate the posterior probability of freedom (year = k) , the prior probability of freedom (year = k) is first calculated from the posterior probability of freedom (year = k-1) from the previous year and the annual probability that the disease is introduced into the population.

Value

A vector. The prior probability of freedom (year = k)

Examples

1
2
3
4
5
6
7
## Calculate the posterior probability of freedom after applying a
## sensitivity to a prior probability of freedom:
post_pf <- post_fr(0.5, 0.4)
## Then discount the probability of introduction (0.05) from the
## posterior probability of freedom to calculate the subsequent
## prior probability of freedom for the next time step:
prior_pf <- prior_fr(post_pf, 0.05)

freedom documentation built on Sept. 8, 2020, 5:06 p.m.