# Probability distribution functions

library(anovir)

### Parameters

The expressions for the probability distributions used in this package are given below. In each case, at time t,

• S(t) is the cumulative survival function,

• f(t) is the probability distribution function,

• h(t) is the hazard function, where

• a is the location parameter, and

• b the scale parameter.

### Weibull distribution

$$\quad S(t) = \exp \left[ - \exp (z) \right]$$

$$\quad f(t) = \frac{1}{bt} \exp \left[ z - \exp(z) \right]$$

$$\quad h(t) = \frac{1}{bt} \exp \left[ z \right]$$

where

$$\quad z = \frac{\log t - a}{b} \\$$

### Gumbel distribution

$$\quad S(t) = \exp \left[ - \exp (z) \right]$$

$$\quad f(t) = \frac{1}{b} \exp \left[ z - \exp(z) \right]$$

$$\quad h(t) = \frac{1}{b} \exp \left[ z \right]$$

where

$$\quad z = \frac{t - a}{b} \\$$

### Fréchet distribution

$$\quad S(t) = 1 - \exp \left[ - \exp (-z) \right]$$

$$\quad f(t) = \frac{1}{bt} \exp \left[ -z - \exp(-z) \right]$$

$$\quad h(t) = \frac{f(t)}{S(t)}$$

where

$$\quad z = \frac{\log t - a}{b}$$

### Exponential distribution

This is a special case of the Weibull distribution when b = 1

$$\quad S(t) = \exp \left[ - \exp (z) \right]$$

$$\quad f(t) = \frac{1}{t} \exp \left[ z - \exp(z) \right]$$

$$\quad h(t) = \frac{1}{t} \exp \left[ z \right]$$

where

$$\quad z = \log t - a$$

The hazard function is constant over time at, h(t) = exp(-a)

\begin{align} \log\left(-\log \left[S \left(t \right) \right] \right) &= \frac{1}{b} \log t - \frac{a}{b} \\ \\ \log\left[-\log S \left(t \right) \right] &= \frac{1}{b} t - \frac{a}{b} \\ \\ -\log\left(-\log \left[1 - S \left(t \right) \right] \right) &= \frac{1}{b} \log t - \frac{a}{b} \\ \\ \log\left(-\log \left[S \left(t \right) \right] \right) &= \log t - a \\ \\ \end{align}