a <- .001
b <- .07
x <- 0:100
mx1 <- a * exp(x * b)
mx2 <- a/2 * exp(x * b)
mx <- (mx1 + mx2) / 2
s <- sen_arriaga_instantaneous(mx, age = x)
s1 <- sen_arriaga_instantaneous(mx1, age = x)
s2 <- sen_arriaga_instantaneous(mx2, age = x)
s1_d <- sen_arriaga(mx1, mx2, age = x)
s2_d <- sen_arriaga(mx2, mx1, age = x)
delta <- mx2 - mx1
# dots give our point estimate of sensitivity at the average of the rates,
# which is different from the
plot(x,s*delta, ylim = c(0,.3))
lines(x,s1*delta,col = "red")
lines(x,s2*delta,col = "blue")
# the sensitivity of the average is different
# from the average of the sensitivities!
lines(x, ((s1+s2)) / 2 * delta)
# and these are different from the directional sensitivities
# covering the whole space from mx1 to mx2:
lines(x, s1_d*delta, col = "red", lty =2)
lines(x, s2_d*delta, col = "blue", lty =2)
Run the code above in your browser using DataLab