Learn R Programming

acmeR (version 1.1.0)

acme.post: Posterior Calculation of Mortality

Description

Calculates and plots the posterior distribution of mortality count.

Usage

acme.post(C = 0, Rstar = 0.2496, T = 0.174, gam = c(0.5, 0.9), I = 7, xlim, Mmax = 200, xi = 1/2, lam = 0, ps = "", plotit = TRUE)

Arguments

C
Observed mortality count. Non-negative integer.
Rstar
ACME inverse-inflation factor R*, reported by acme.summary() as "Rstar."
T
The first term in recursive calculation of Rstar, from acme.summary.
gam
Values for highest posterior density credible interval.
I
Interval length, days.
xlim
2-element vector of plotting ranges. Default first element of 0, second element of 2 greater than maximum calculated for larger hpd.
Mmax
Maximimum value for which posterior probability is calculated.
xi
First parameter of gamma prior. Default is 1/2 for Objective prior.
lam
Second parameter of gamma prior. Default is 0 for Objective prior.
ps
Postscript message. Default empty string suppresses output.
plotit
Boolean to determine if plot should be created. Default is TRUE.

Value

The function invisibly returns a vector with input C, ACME estimate, posterior mean, and credible interval ranges. If plotit = TRUE, it also plots the posterior probabilities for values in the range of xlim, and prints a short summery including the true coverage probabilities.The parameter plotit should almost never be set to FALSE - if the user desires the vector that is inivisibly returned, it is suggested to use the wrapper function acme.table.

Details

Assuming a Gamma(xi, lam) on the average daily mortality rate m, this model treats the mortality M for the current period as Poisson-distributed with mean m*I. The carcass count C will include "new" carcasses with a Bi(M,T) distribution as well as "old" carcasses (if bt > 0). For derivation of resulting conditional pdf see Wolpert (2015).

Examples

Run this code
acme.post(C=5, Rstar = .25, T = .2, gam = c(.9,.95), I = 5, xi = .5,lam = 0)

Run the code above in your browser using DataLab