interval2rate {intRvals}R Documentation

Conversion of interval estimates to rates

Description

Conversion of interval estimates to rates

Usage

interval2rate(
  data,
  minint = data$mu/100,
  maxint = data$mu + 3 * data$sigma,
  digits = max(3L, getOption("digits") - 3L),
  method = "exact"
)

Arguments

data

An object of class intRvals, usually a result of a call to estinterval

minint

the minimum interval value from which numerical integrations converting to rates are started

maxint

the maximum interval value up to which numerical integrations converting to rates are continued

digits

the number of digits for printing to screen

method

A string equal to 'exact' or 'taylor'. When 'exact' exact formula or numeric integration is used. When 'taylor' a Taylor approximation is used as in standard propagation of uncertainty in the case of division.

Details

Gamma-distributed intervals

When inter-arrival times (intervals) follow a gamma distribution with mean \mu and standard deviation \sigma, i.e. follow the probability density function GammaDist(shape=\alpha=\mu^2/\sigma^2, scale=\beta=\sigma^2/\mu), then the associated distribution of rates is given by an inverse gamma distribution with shape parameter \alpha and scale parameter 1/\beta.

The mean of this inverse gamma distribution is given by the formula

\mu_{rate}=\mu/(\mu^2 - \sigma^2)

provided that \alpha > 1, i.e. \mu > \sigma.

The variance of this inverse gamma distribution is given by the formula

\sigma^2_{rate}=\mu^2\sigma^2/((\mu^2 - \sigma^2)(\mu^2 - 2\sigma^2)^2

provided that \alpha > 2, i.e. \mu > sqrt(2) * \sigma.

Values \mu and \sigma are estimated on the interval data, and above formula are used to calculate the estimated mean and variance of the arrival rate.

If these formula cannot be used (because the provisions on the value of \alpha are not met), numerical integration is used instead, analagous to the procedure for normal-distributed intervals, see below.

Normal-distributed intervals

When inter-arrival times (intervals) x follow a normal distribution with mean \mu and standard deviation \sigma, i.e. follow the probability density function Normal(mean=\mu, sd=\sigma), then the mean rate (\mu_{rate}) can be calculated numerically by:

\mu_{rate}=\int_0^\infty (1/x) * \phi(x | \mu,\sigma)

and the variance of the rate (\sigma^2_{rate}) by:

\sigma^2_{rate}=\int_0^\infty (1/x^2) * \phi(x | \mu,\sigma) -\mu_{rate}^2

This approximation is only valid for distributions that have a negligable density near x=0, such that the distribution can be effectively truncated before x approaches zero, where the integral is not defined. For interval data with intervals x near zero, use of a gamma distribution is recommended instead.

Value

The function interval2rate computes and returns a named vector with the rate mean and standard deviation

Examples

data(goosedrop)
dr=estinterval(goosedrop$interval)
interval2rate(dr)

[Package intRvals version 1.0.1 Index]