Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
AEP2ARI <- function(AEP){
1/-log(1-AEP)
}
ARI2AEP <- function(ARI){
(exp(1/ARI) - 1)/exp(1/ARI)
}
EY2AEP <- function(EY){
ARI2AEP(1/EY)
}
test_ARI <- c(0.17, 0.25, 0.33, 0.5, 1, 1.44, 2, 4.48, 5, 9.49, 20, 50, 100)
test_AEP <- c(99.75, 98.17, 95.02, 86.47, 63.21, 50, 39.35, 20, 18.13, 10, 5, 2, 1)/100
test_EY <- c(12, 6, 4, 3, 2, 1)
ARI2AEP(test_ARI)
AEP2ARI(test_AEP)
EY2AEP(test_EY)
data_frame(EY = 1/test_ARI,
AEP = test_AEP,
AEP_check = ARI2AEP(test_ARI),
AEP_1inX = 1/AEP,
ARI = test_ARI,
ARI_check = AEP2ARI(test_AEP))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment