q_x <- 0.5
l_x <- 2
u <- seq(0, 1, length.out = 200) # Fraction of the year elapsed
l_next <- l_x * (1 - q_x)
old_par <- par(mar = c(3.5, 4.2, 1, 0.8), mgp = c(2.3, 0.7, 0))
plot(NA_real_, NA_real_, xlim = c(-0.25, 1.25), ylim = c(0.75, 2.25),
xaxs = "i", yaxs = "i", axes = FALSE,
xlab = "Time",ylab = expression("\u2113"[0] * S[T](t)))
axis(1, at = c(0, 1), labels = expression(x, x + 1))
axis(2, at = c(l_next, l_x),
labels = expression("\u2113"[x + 1], "\u2113"[x]))
box(bty = "l")
segments(-0.25, c(l_x, l_next), c(0, 1), c(l_x, l_next),
col = "grey65", lty = 3)
segments(c(0, 1), 0.75, c(0, 1), c(l_x, l_next),
col = "grey65", lty = 3)
lines(u, l_x * (1 - u * q_x), lty = 1)
lines(u, l_x * (1 - q_x)^u, lty = 2)
lines(u, l_x * (1 - q_x) / (1 - (1 - u) * q_x), lty = 3)
legend("topright", c("Uniform", "Constant force of mortality", "Balducci"),
lty = 1:3, bty = "n")