Created
July 5, 2017 01:52
-
-
Save TonyLadson/9ebe8b311cc927f5cdde1b48c3b580bd to your computer and use it in GitHub Desktop.
Functions to convert between EY, ARI and AEP see https://tonyladson.wordpress.com/2017/07/04/converting-between-ey-aep-and-ari/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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