In the lecture we computed a bound for the tail probability \[ P(X - \lambda > \epsilon) = P(X > \lambda + \epsilon) \] for \( X \) a \( \Gamma \)-distributed random variable. First we look at the logaritm of the bound as a function of the free parameter \( t \). We found that it was minimized for a particular choice of \( t \) depending on \( \epsilon \) and the shape parameter \( \lambda \).
lambda <- 10
epsilon <- 10
curve(-t*(epsilon + lambda) - lambda * log(1-t),
0, 1, xname = "t", ylab = "log-bound")
abline(v = epsilon/(epsilon + lambda))
Then we plot the actual tail probability, which can be computed via the pgamma
function in R, and compare it to the bound (red) and the (weaker) bound we get from Chebychev's inequality (blue).
curve(pgamma(x, lambda, lower.tail = FALSE),
lambda, lambda + 30,
ylab = "probability",
main = "Gamma tail",
ylim = c(0, 1))
curve(exp(lambda - x)*(x/lambda)^lambda, lambda, lambda + 30,
add = TRUE, col = "red")
curve(lambda/(x-lambda)^2, lambda, lambda + 30,
add = TRUE, col = "blue")
It is not clear from this plot how dramatic the difference between the bounds is for the small probabilities. To better see the difference we plot the log-probabilities and log-bounds instead.
curve(pgamma(x, lambda, lower.tail = FALSE, log.p = TRUE),
lambda, lambda + 30,
ylab = "log-probability",
main = "Logarithm of Gamma tail",
ylim = c(-20, 0))
curve(lambda - x + lambda*log(x/lambda), lambda, lambda + 30,
add = TRUE, col = "red")
curve(-2 * log(x-lambda) + log(lambda), lambda, lambda + 30,
add = TRUE, col = "blue")