├── .gitignore ├── data ├── Mi06F.rda ├── Mi06M.rda ├── Mi85F.rda ├── Mi85M.rda ├── RV04F.rda ├── RV04M.rda ├── GAM71F.rda ├── GAM71M.rda ├── GAM83F.rda ├── GAM83M.rda ├── GAM94F.rda ├── GAM94M.rda ├── CSO58FALB.rda ├── CSO58FANB.rda ├── CSO58MALB.rda ├── CSO58MANB.rda ├── CSO80FALB.rda ├── CSO80FANB.rda ├── CSO80MALB.rda ├── CSO80MANB.rda ├── GAM94FANB.rda ├── GAM94MANB.rda ├── MAyP0206CAF.rda ├── MAyP0206CAM.rda ├── CSO80FALBsmoker.rda ├── CSO80FANBsmoker.rda ├── CSO80MALBsmoker.rda ├── CSO80MANBsmoker.rda ├── MAyP0206activeF.rda ├── MAyP0206activeM.rda ├── CSO2001FALBsmoker.rda ├── CSO2001FANBsmoker.rda ├── CSO2001MALBsmoker.rda ├── CSO2001MANBsmoker.rda ├── CSO80FALBnonsmoker.rda ├── CSO80FANBnonsmoker.rda ├── CSO80MALBnonsmoker.rda ├── CSO80MANBnonsmoker.rda ├── MAyP0206retiredF.rda ├── MAyP0206retiredM.rda ├── ArgentinaINDEC9092F.rda ├── ArgentinaINDEC9092M.rda ├── CSO2001FALBnonsmoker.rda ├── CSO2001FANBnonsmoker.rda ├── CSO2001MALBnonsmoker.rda ├── CSO2001MANBnonsmoker.rda └── ArgentinaINDEC9092comb.rda ├── .Rbuildignore ├── R ├── GAM94M.R ├── GAM94F.R ├── RV04F.R ├── RV04M.R ├── GAM83F.R ├── GAM83M.R ├── Mi85M.R ├── Mi85F.R ├── MAyP0206activeF.R ├── MAyP0206activeM.R ├── CSO58MALB.R ├── GAM94MANB.R ├── MAyP0206retiredF.R ├── MAyP0206retiredM.R ├── CSO58FALB.R ├── CSO80MALB.R ├── GAM94FANB.R ├── CSO58FANB.R ├── CSO58MANB.R ├── CSO80FALB.R ├── CSO80FANB.R ├── CSO80MANB.R ├── ArgentinaINDEC9092M.R ├── MAyP0206CAF.R ├── MAyP0206CAM.R ├── ArgentinaINDEC9092F.R ├── GAM71F.R ├── GAM71M.R ├── CSO80MALBsmoker.R ├── CSO80FALBsmoker.R ├── CSO80MANBsmoker.R ├── is_integer.R ├── CSO2001MALBsmoker.R ├── CSO80FANBsmoker.R ├── CSO2001FALBsmoker.R ├── CSO80FALBnonsmoker.R ├── CSO80MALBnonsmoker.R ├── CSO2001FANBsmoker.R ├── CSO2001MANBsmoker.R ├── CSO80MANBnonsmoker.R ├── CSO2001MALBnonsmoker.R ├── CSO80FANBnonsmoker.R ├── CSO2001FALBnonsmoker.R ├── CSO2001MANBnonsmoker.R ├── ArgentinaINDEC9092comb.R ├── CSO2001FANBnonsmoker.R ├── contmeses.R ├── Mi06M.R ├── Mi06F.R ├── sf.R ├── af.R ├── Table_Moivre.R ├── Survival.R ├── Table_Dormoy.R ├── Table_Gompertz.R ├── JointSurvival.R ├── qfrac.R ├── Table_Makeham.R ├── ACont..R ├── Fractional_table.R ├── aCont.R ├── PremiumFrac.R ├── E.R ├── a.R ├── A..R ├── Am..R ├── aD.R ├── av.R ├── avg.R ├── V_E.R ├── am.R ├── V_a.R ├── Av..R └── V_A..R ├── man ├── GAM94M.Rd ├── GAM94F.Rd ├── RV04M.Rd ├── RV04F.Rd ├── GAM83M.Rd ├── Mi85M.Rd ├── GAM83F.Rd ├── Mi85F.Rd ├── sf.Rd ├── af.Rd ├── CSO58MALB.Rd ├── CSO80MALB.Rd ├── GAM94MANB.Rd ├── MAyP0206activeM.Rd ├── CSO58FALB.Rd ├── CSO58MANB.Rd ├── GAM94FANB.Rd ├── MAyP0206activeF.Rd ├── CSO58FANB.Rd ├── CSO80FALB.Rd ├── CSO80FANB.Rd ├── CSO80MANB.Rd ├── MAyP0206retiredM.Rd ├── MAyP0206retiredF.Rd ├── GAM71M.Rd ├── MAyP0206CAM.Rd ├── GAM71F.Rd ├── MAyP0206CAF.Rd ├── ArgentinaINDEC9092M.Rd ├── ArgentinaINDEC9092F.Rd ├── CSO80MALBsmoker.Rd ├── CSO80FALBsmoker.Rd ├── CSO80MANBsmoker.Rd ├── CSO80FANBsmoker.Rd ├── CSO2001MALBsmoker.Rd ├── CSO2001FALBsmoker.Rd ├── CSO2001MANBsmoker.Rd ├── CSO80MALBnonsmoker.Rd ├── CSO2001FANBsmoker.Rd ├── CSO80FALBnonsmoker.Rd ├── CSO80MANBnonsmoker.Rd ├── CSO80FANBnonsmoker.Rd ├── CSO2001FALBnonsmoker.Rd ├── CSO2001MALBnonsmoker.Rd ├── CSO2001MANBnonsmoker.Rd ├── CSO2001FANBnonsmoker.Rd ├── ArgentinaINDEC9092comb.Rd ├── Mi06F.Rd ├── Mi06M.Rd ├── Table_Moivre.Rd ├── JointSurvival.Rd ├── Survival.Rd ├── Table_Dormoy.Rd ├── Table_Gompertz.Rd ├── Table_Makeham.Rd ├── Fractional_table.Rd ├── Rate_converter.Rd ├── qfrac.Rd ├── E.Rd ├── ACont..Rd ├── aCont.Rd ├── Loan_amortization.Rd ├── A..Rd ├── a.Rd ├── Am..Rd ├── PremiumFrac.Rd ├── aD.Rd ├── AD..Rd ├── am.Rd ├── V_Payment_Protection.Rd ├── V_E.Rd ├── avg.Rd ├── Avg..Rd ├── av.Rd ├── Av..Rd ├── Em.Rd ├── V_A..Rd ├── V_a.Rd ├── Payment_Protection.Rd ├── V_aD.Rd ├── V_AD..Rd ├── V_avg.Rd ├── V_Av..Rd ├── V_Avg..Rd └── V_av.Rd ├── DetLifeInsurance.Rproj ├── NAMESPACE ├── DESCRIPTION └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | doc 6 | Meta 7 | -------------------------------------------------------------------------------- /data/Mi06F.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/Mi06F.rda -------------------------------------------------------------------------------- /data/Mi06M.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/Mi06M.rda -------------------------------------------------------------------------------- /data/Mi85F.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/Mi85F.rda -------------------------------------------------------------------------------- /data/Mi85M.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/Mi85M.rda -------------------------------------------------------------------------------- /data/RV04F.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/RV04F.rda -------------------------------------------------------------------------------- /data/RV04M.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/RV04M.rda -------------------------------------------------------------------------------- /data/GAM71F.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/GAM71F.rda -------------------------------------------------------------------------------- /data/GAM71M.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/GAM71M.rda -------------------------------------------------------------------------------- /data/GAM83F.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/GAM83F.rda -------------------------------------------------------------------------------- /data/GAM83M.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/GAM83M.rda -------------------------------------------------------------------------------- /data/GAM94F.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/GAM94F.rda -------------------------------------------------------------------------------- /data/GAM94M.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/GAM94M.rda -------------------------------------------------------------------------------- /data/CSO58FALB.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/CSO58FALB.rda -------------------------------------------------------------------------------- /data/CSO58FANB.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/CSO58FANB.rda -------------------------------------------------------------------------------- /data/CSO58MALB.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/CSO58MALB.rda -------------------------------------------------------------------------------- /data/CSO58MANB.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/CSO58MANB.rda -------------------------------------------------------------------------------- /data/CSO80FALB.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/CSO80FALB.rda -------------------------------------------------------------------------------- /data/CSO80FANB.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/CSO80FANB.rda -------------------------------------------------------------------------------- /data/CSO80MALB.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/CSO80MALB.rda -------------------------------------------------------------------------------- /data/CSO80MANB.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/CSO80MANB.rda -------------------------------------------------------------------------------- /data/GAM94FANB.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/GAM94FANB.rda -------------------------------------------------------------------------------- /data/GAM94MANB.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/GAM94MANB.rda -------------------------------------------------------------------------------- /data/MAyP0206CAF.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/MAyP0206CAF.rda -------------------------------------------------------------------------------- /data/MAyP0206CAM.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/MAyP0206CAM.rda -------------------------------------------------------------------------------- /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | ^doc$ 4 | ^Meta$ 5 | ^cran-comments\.md$ 6 | ^README\.html$ 7 | -------------------------------------------------------------------------------- /data/CSO80FALBsmoker.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/CSO80FALBsmoker.rda -------------------------------------------------------------------------------- /data/CSO80FANBsmoker.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/CSO80FANBsmoker.rda -------------------------------------------------------------------------------- /data/CSO80MALBsmoker.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/CSO80MALBsmoker.rda -------------------------------------------------------------------------------- /data/CSO80MANBsmoker.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/CSO80MANBsmoker.rda -------------------------------------------------------------------------------- /data/MAyP0206activeF.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/MAyP0206activeF.rda -------------------------------------------------------------------------------- /data/MAyP0206activeM.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/MAyP0206activeM.rda -------------------------------------------------------------------------------- /data/CSO2001FALBsmoker.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/CSO2001FALBsmoker.rda -------------------------------------------------------------------------------- /data/CSO2001FANBsmoker.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/CSO2001FANBsmoker.rda -------------------------------------------------------------------------------- /data/CSO2001MALBsmoker.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/CSO2001MALBsmoker.rda -------------------------------------------------------------------------------- /data/CSO2001MANBsmoker.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/CSO2001MANBsmoker.rda -------------------------------------------------------------------------------- /data/CSO80FALBnonsmoker.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/CSO80FALBnonsmoker.rda -------------------------------------------------------------------------------- /data/CSO80FANBnonsmoker.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/CSO80FANBnonsmoker.rda -------------------------------------------------------------------------------- /data/CSO80MALBnonsmoker.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/CSO80MALBnonsmoker.rda -------------------------------------------------------------------------------- /data/CSO80MANBnonsmoker.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/CSO80MANBnonsmoker.rda -------------------------------------------------------------------------------- /data/MAyP0206retiredF.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/MAyP0206retiredF.rda -------------------------------------------------------------------------------- /data/MAyP0206retiredM.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/MAyP0206retiredM.rda -------------------------------------------------------------------------------- /data/ArgentinaINDEC9092F.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/ArgentinaINDEC9092F.rda -------------------------------------------------------------------------------- /data/ArgentinaINDEC9092M.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/ArgentinaINDEC9092M.rda -------------------------------------------------------------------------------- /data/CSO2001FALBnonsmoker.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/CSO2001FALBnonsmoker.rda -------------------------------------------------------------------------------- /data/CSO2001FANBnonsmoker.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/CSO2001FANBnonsmoker.rda -------------------------------------------------------------------------------- /data/CSO2001MALBnonsmoker.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/CSO2001MALBnonsmoker.rda -------------------------------------------------------------------------------- /data/CSO2001MANBnonsmoker.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/CSO2001MANBnonsmoker.rda -------------------------------------------------------------------------------- /data/ArgentinaINDEC9092comb.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAuza/DetLifeInsurance/HEAD/data/ArgentinaINDEC9092comb.rda -------------------------------------------------------------------------------- /R/GAM94M.R: -------------------------------------------------------------------------------- 1 | #' @title GAM94 Male 2 | #' 3 | #' @description Mortality table (ultimate): Group Annuity Mortality. Year: 1994. Sex: Male. 4 | #' @name GAM94M 5 | #' @docType data 6 | #' @usage data(GAM94M) 7 | #' @format a dataframe containing a column for age (x) and a column for death probability (q) 8 | #' @references \url{https://mort.soa.org/} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/GAM94F.R: -------------------------------------------------------------------------------- 1 | #' @title GAM94 Female 2 | #' 3 | #' @description Mortality table (ultimate): Group Annuity Mortality. Year: 1994. Sex: Female. 4 | #' @name GAM94F 5 | #' @docType data 6 | #' @usage data(GAM94F) 7 | #' @format a dataframe containing a column for age (x) and a column for death probability (q) 8 | #' @references \url{https://mort.soa.org/} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/RV04F.R: -------------------------------------------------------------------------------- 1 | #' @title RV04 Female 2 | #' 3 | #' @description Mortality table (ultimate): Renta Vitalicia. Nation: Chile. Year: 2004. Sex: Female. 4 | #' @name RV04F 5 | #' @docType data 6 | #' @usage data(RV04F) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=1500} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/RV04M.R: -------------------------------------------------------------------------------- 1 | #' @title RV04 Male 2 | #' 3 | #' @description Mortality table (ultimate): Renta Vitalicia. Nation: Chile. Year: 2004. Sex: Male. 4 | #' @name RV04M 5 | #' @docType data 6 | #' @usage data(RV04M) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=1499} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/GAM83F.R: -------------------------------------------------------------------------------- 1 | #' @title GAM83 Female 2 | #' 3 | #' @description Mortality table (ultimate): Group Annuity Mortality. Nation: United States of America. Year: 1983. Sex: Female. 4 | #' @name GAM83F 5 | #' @docType data 6 | #' @usage data(GAM83F) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=825} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/GAM83M.R: -------------------------------------------------------------------------------- 1 | #' @title GAM83 Male 2 | #' 3 | #' @description Mortality table (ultimate): Group Annuity Mortality. Nation: United States of America. Year: 1983. Sex: Male. 4 | #' @name GAM83M 5 | #' @docType data 6 | #' @usage data(GAM83M) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=826} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/Mi85M.R: -------------------------------------------------------------------------------- 1 | #' @title Mi85 Male 2 | #' 3 | #' @description Mortality table (ultimate): Mortalidad Invalidez. Nation: Chile. Year: 1985. Sex: Male. 4 | #' @name Mi85M 5 | #' @docType data 6 | #' @usage data(Mi85M) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{http://servicios.infoleg.gob.ar/infolegInternet/anexos/80000-84999/81029/norma.htm} 9 | #' @keywords datasets table 10 | NULL 11 | 12 | -------------------------------------------------------------------------------- /R/Mi85F.R: -------------------------------------------------------------------------------- 1 | #' @title Mi85 Female 2 | #' 3 | #' @description Mortality table (ultimate): Mortalidad Invalidez. Nation: Chile. Year: 1985. Sex: Female. 4 | #' @name Mi85F 5 | #' @docType data 6 | #' @usage data(Mi85F) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{http://servicios.infoleg.gob.ar/infolegInternet/anexos/80000-84999/81029/norma.htm} 9 | #' @keywords datasets table 10 | NULL 11 | 12 | -------------------------------------------------------------------------------- /R/MAyP0206activeF.R: -------------------------------------------------------------------------------- 1 | #' @title MAyP0206 Active Female 2 | #' 3 | #' @description Mortality table (ultimate): Mortalidad Activos y Pasivos. Nation: Argentina. Year: 2002-2006. Sex: Female. Status: Active. 4 | #' @name MAyP0206activeF 5 | #' @docType data 6 | #' @usage data(MAyP0206activeF) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=20005} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/MAyP0206activeM.R: -------------------------------------------------------------------------------- 1 | #' @title MAyP0206 Active Male 2 | #' 3 | #' @description Mortality table (ultimate): Mortalidad Activos y Pasivos. Nation: Argentina. Year: 2002-2006. Sex: Male. Status: Active. 4 | #' @name MAyP0206activeM 5 | #' @docType data 6 | #' @usage data(MAyP0206activeM) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=20004} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/CSO58MALB.R: -------------------------------------------------------------------------------- 1 | #' @title CSO58 Male Age Last Birthday 2 | #' 3 | #' @description Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1958. Sex: Male. Basis: Age Last Birthday. 4 | #' @name CSO58MALB 5 | #' @docType data 6 | #' @usage data(CSO58MALB) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=7} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/GAM94MANB.R: -------------------------------------------------------------------------------- 1 | #' @title GAM94 Male Age Nearest Birthday 2 | #' 3 | #' @description Mortality table (ultimate): Group Annuity Mortality. Nation: United States of America. Year: 1994. Sex: Male. Basis: Age Nearest Birthday. 4 | #' @name GAM94MANB 5 | #' @docType data 6 | #' @usage data(GAM94MANB) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=835} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/MAyP0206retiredF.R: -------------------------------------------------------------------------------- 1 | #' @title MAyP0206 Retired Female 2 | #' 3 | #' @description Mortality table (ultimate): Mortalidad Activos y Pasivos. Nation: Argentina. Year: 2002-2006. Sex: Female. Status: Retired. 4 | #' @name MAyP0206retiredF 5 | #' @docType data 6 | #' @usage data(MAyP0206retiredF) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=20007} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/MAyP0206retiredM.R: -------------------------------------------------------------------------------- 1 | #' @title MAyP0206 Retired Male 2 | #' 3 | #' @description Mortality table (ultimate): Mortalidad Activos y Pasivos. Nation: Argentina. Year: 2002-2006. Sex: Male. Status: Retired. 4 | #' @name MAyP0206retiredM 5 | #' @docType data 6 | #' @usage data(MAyP0206retiredM) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=20006} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/CSO58FALB.R: -------------------------------------------------------------------------------- 1 | #' @title CSO58 Female Age Last Birthday 2 | #' 3 | #' @description Mortality table (ultimate): Commissioner's Standard Ordinary. Year: 1958. Nation: United States of America. Sex: Female. Basis: Age Last Birthday. 4 | #' @name CSO58FALB 5 | #' @docType data 6 | #' @usage data(CSO58FALB) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=8} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/CSO80MALB.R: -------------------------------------------------------------------------------- 1 | #' @title CSO80 Male Age Last Birthday 2 | #' 3 | #' @description Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1980. Sex: Male. Basis: Age Last Birthday. 4 | #' @name CSO80MALB 5 | #' @docType data 6 | #' @usage data(CSO80MALB) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=41} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/GAM94FANB.R: -------------------------------------------------------------------------------- 1 | #' @title GAM94 Female Age Nearest Birthday 2 | #' 3 | #' @description Mortality table (ultimate): Group Annuity Mortality. Nation: United States of America. Year: 1994. Sex: Female. Basis: Age Nearest Birthday. 4 | #' @name GAM94FANB 5 | #' @docType data 6 | #' @usage data(GAM94FANB) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=834} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/CSO58FANB.R: -------------------------------------------------------------------------------- 1 | #' @title CSO58 Female Age Nearest Birthday 2 | #' 3 | #' @description Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1958. Sex: Female. Basis: Age Nearest Birthday. 4 | #' @name CSO58FANB 5 | #' @docType data 6 | #' @usage data(CSO58FANB) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=6} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/CSO58MANB.R: -------------------------------------------------------------------------------- 1 | #' @title CSO58 Male Age Nearest Birthday 2 | #' 3 | #' @description Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1958. Sex: Male. Basis: Age Nearest Birthday. 4 | #' @name CSO58MANB 5 | #' @docType data 6 | #' @usage data(CSO58MANB) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=5} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/CSO80FALB.R: -------------------------------------------------------------------------------- 1 | #' @title CSO80 Female Age Last Birthday 2 | #' 3 | #' @description Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1980. Sex: Female Age method: Age Last Birthday. 4 | #' @name CSO80FALB 5 | #' @docType data 6 | #' @usage data(CSO80FALB) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=35} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/CSO80FANB.R: -------------------------------------------------------------------------------- 1 | #' @title CSO80 Female Age Nearest Birthday 2 | #' 3 | #' @description Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1980. Sex: Female. Basis: Age Nearest Birthday. 4 | #' @name CSO80FANB 5 | #' @docType data 6 | #' @usage data(CSO80FANB) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=36} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/CSO80MANB.R: -------------------------------------------------------------------------------- 1 | #' @title CSO80 Male Age Nearest Birthday 2 | #' 3 | #' @description Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1980. Sex: Male. Age method: Age Nearest Birthday. 4 | #' @name CSO80MANB 5 | #' @docType data 6 | #' @usage data(CSO80MANB) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=42} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /man/GAM94M.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/GAM94M.R 3 | \docType{data} 4 | \name{GAM94M} 5 | \alias{GAM94M} 6 | \title{GAM94 Male} 7 | \format{ 8 | a dataframe containing a column for age (x) and a column for death probability (q) 9 | } 10 | \usage{ 11 | data(GAM94M) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Group Annuity Mortality. Year: 1994. Sex: Male. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /DetLifeInsurance.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: No 4 | SaveWorkspace: No 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | 18 | BuildType: Package 19 | PackageUseDevtools: Yes 20 | PackageInstallArgs: --no-multiarch --with-keep.source 21 | PackageCheckArgs: --as-cran 22 | PackageRoxygenize: rd,collate,namespace,vignette 23 | -------------------------------------------------------------------------------- /R/ArgentinaINDEC9092M.R: -------------------------------------------------------------------------------- 1 | #' @title ArgentinaINDEC9092 Male 2 | #' 3 | #' @description Mortality table (ultimate): Argentina Instituto Nacional de Estadistica y Censos (INDEC). Nation: Argentina. Year: 1990-1992. Sex: Male. 4 | #' @name ArgentinaINDEC9092M 5 | #' @docType data 6 | #' @usage data(ArgentinaINDEC9092M) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=20001} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/MAyP0206CAF.R: -------------------------------------------------------------------------------- 1 | #' @title MAyP0206 Combined Active and Retired Female 2 | #' 3 | #' @description Mortality table (ultimate): Mortalidad Activos y Pasivos. Nation: Argentina. Year: 2002-2006. Sex: Female. Status: Combined Active and Retired. 4 | #' @name MAyP0206CAF 5 | #' @docType data 6 | #' @usage data(MAyP0206CAF) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=20009} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/MAyP0206CAM.R: -------------------------------------------------------------------------------- 1 | #' @title MAyP0206 Combined Active and Retired Male 2 | #' 3 | #' @description Mortality table (ultimate): Mortalidad Activos y Pasivos. Nation: Argentina. Year: 2002-2006. Sex: Male. Status: Combined Active and Retired. 4 | #' @name MAyP0206CAM 5 | #' @docType data 6 | #' @usage data(MAyP0206CAM) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=20008} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /man/GAM94F.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/GAM94F.R 3 | \docType{data} 4 | \name{GAM94F} 5 | \alias{GAM94F} 6 | \title{GAM94 Female} 7 | \format{ 8 | a dataframe containing a column for age (x) and a column for death probability (q) 9 | } 10 | \usage{ 11 | data(GAM94F) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Group Annuity Mortality. Year: 1994. Sex: Female. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /R/ArgentinaINDEC9092F.R: -------------------------------------------------------------------------------- 1 | #' @title ArgentinaINDEC9092 Female 2 | #' 3 | #' @description Mortality table (ultimate): Argentina Instituto Nacional de Estadistica y Censos (INDEC). Nation: Argentina. Year: 1990-1992. Sex: Female. 4 | #' @name ArgentinaINDEC9092F 5 | #' @docType data 6 | #' @usage data(ArgentinaINDEC9092F) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=20002} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/GAM71F.R: -------------------------------------------------------------------------------- 1 | #' @title GAM71 Female 2 | #' 3 | #' @description Mortality table (ultimate): Group Annuity Mortality. Nation: United States of America. Year: 1971. Sex: Female. 4 | #' @name GAM71F 5 | #' @docType data 6 | #' @usage data(GAM71F) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=817}, \url{http://servicios.infoleg.gob.ar/infolegInternet/anexos/80000-84999/81029/norma.htm} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/GAM71M.R: -------------------------------------------------------------------------------- 1 | #' @title GAM71 Male 2 | #' 3 | #' @description Mortality table (ultimate): Group Annuity Mortality. Nation: United States of America. Year: 1971. Sex: Male. 4 | #' @name GAM71M 5 | #' @docType data 6 | #' @usage data(GAM71M) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=818}, \url{http://servicios.infoleg.gob.ar/infolegInternet/anexos/80000-84999/81029/norma.htm} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/CSO80MALBsmoker.R: -------------------------------------------------------------------------------- 1 | #' @title CSO80 Male Age Last Birthday Smoker 2 | #' 3 | #' @description Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1980. Sex: Male. Basis: Age Last Birthday. Smoker: Yes. 4 | #' @name CSO80MALBsmoker 5 | #' @docType data 6 | #' @usage data(CSO80MALBsmoker) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=45} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/CSO80FALBsmoker.R: -------------------------------------------------------------------------------- 1 | #' @title CSO80 Female Age Last Birthday smoker 2 | #' 3 | #' @description Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1980. Sex: Female. Basis: Age Last Birthday. Smoker: Yes. 4 | #' @name CSO80FALBsmoker 5 | #' @docType data 6 | #' @usage data(CSO80FALBsmoker) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=39} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/CSO80MANBsmoker.R: -------------------------------------------------------------------------------- 1 | #' @title CSO80 Male Age Nearest Birthday Smoker 2 | #' 3 | #' @description Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1980. Sex: Male. Basis: Age Nearest Birthday. Smoker: Yes. 4 | #' @name CSO80MANBsmoker 5 | #' @docType data 6 | #' @usage data(CSO80MANBsmoker) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=46} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/is_integer.R: -------------------------------------------------------------------------------- 1 | #' @title Integer 2 | 3 | #' @description Returns 1 if the number or elements of a vector is integer or 0 if it's not. 4 | #' @param x A numeric type value or a vector. 5 | #' @keywords Integer 6 | #' @return NULL 7 | #' @noRd 8 | #' 9 | 10 | 11 | is_integer<-function(x){ 12 | suma<-0 13 | for(i in 1:length(x)){ 14 | if(round(x[i],0)==x[i]){ 15 | suma<-suma+1 16 | }else{ 17 | suma<-suma+0 18 | } 19 | } 20 | if(suma==length(x)){ 21 | return(1) 22 | }else{ 23 | return(0) 24 | } 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /R/CSO2001MALBsmoker.R: -------------------------------------------------------------------------------- 1 | #' @title CSO2001 Male Age Last Birthday Smoker 2 | #' 3 | #' @description Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 2001. Sex: Male. Basis: Age Last Birthday. Smoker: yes. 4 | #' @name CSO2001MALBsmoker 5 | #' @docType data 6 | #' @usage data(CSO2001MALBsmoker) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=1518} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/CSO80FANBsmoker.R: -------------------------------------------------------------------------------- 1 | #' @title CSO80 Female Age Nearest Birthday Smoker 2 | #' 3 | #' @description Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1980. Sex: Female. Basis: Age Nearest Birthday. Smoker: Yes. 4 | #' @name CSO80FANBsmoker 5 | #' @docType data 6 | #' @usage data(CSO80FANBsmoker) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=40} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/CSO2001FALBsmoker.R: -------------------------------------------------------------------------------- 1 | #' @title CSO2001 Female Age Last Birthday Smoker 2 | #' 3 | #' @description Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 2001. Sex: Female. Basis: Age Last Birthday. Smoker: yes. 4 | #' @name CSO2001FALBsmoker 5 | #' @docType data 6 | #' @usage data(CSO2001FALBsmoker) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=1519} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/CSO80FALBnonsmoker.R: -------------------------------------------------------------------------------- 1 | #' @title CSO80 Female Age Last Birthday non-smoker 2 | #' 3 | #' @description Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1980. Sex: Female. Basis: Age Last Birthday. Smoker: No. 4 | #' @name CSO80FALBnonsmoker 5 | #' @docType data 6 | #' @usage data(CSO80FALBnonsmoker) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=37} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/CSO80MALBnonsmoker.R: -------------------------------------------------------------------------------- 1 | #' @title CSO80 Male Age Last Birthday Non-smoker 2 | #' 3 | #' @description Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1980. Sex: Male. Basis: Age Last Birthday. Smoker: No. 4 | #' @name CSO80MALBnonsmoker 5 | #' @docType data 6 | #' @usage data(CSO80MALBnonsmoker) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=43} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /man/RV04M.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/RV04M.R 3 | \docType{data} 4 | \name{RV04M} 5 | \alias{RV04M} 6 | \title{RV04 Male} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(RV04M) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Renta Vitalicia. Nation: Chile. Year: 2004. Sex: Male. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=1499} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /R/CSO2001FANBsmoker.R: -------------------------------------------------------------------------------- 1 | #' @title CSO2001 Female Age Nearest Birthday Smoker 2 | #' 3 | #' @description Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 2001. Sex: Female. Basis: Age Nearest Birthday. Smoker: Yes. 4 | #' @name CSO2001FANBsmoker 5 | #' @docType data 6 | #' @usage data(CSO2001FANBsmoker) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=1141} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/CSO2001MANBsmoker.R: -------------------------------------------------------------------------------- 1 | #' @title CSO2001 Male Age Nearest Birthday Smoker 2 | #' 3 | #' @description Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 2001. Sex: Male. Basis: Age Nearest Birthday. Smoker: Yes. 4 | #' @name CSO2001MANBsmoker 5 | #' @docType data 6 | #' @usage data(CSO2001MANBsmoker) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=1138} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/CSO80MANBnonsmoker.R: -------------------------------------------------------------------------------- 1 | #' @title CSO80 Male Age Nearest Birthday Non-smoker 2 | #' 3 | #' @description Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1980. Sex: Male. Basis: Age Nearest Birthday. Smoker: No. 4 | #' @name CSO80MANBnonsmoker 5 | #' @docType data 6 | #' @usage data(CSO80MANBnonsmoker) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=44} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /man/RV04F.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/RV04F.R 3 | \docType{data} 4 | \name{RV04F} 5 | \alias{RV04F} 6 | \title{RV04 Female} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(RV04F) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Renta Vitalicia. Nation: Chile. Year: 2004. Sex: Female. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=1500} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /R/CSO2001MALBnonsmoker.R: -------------------------------------------------------------------------------- 1 | #' @title CSO2001 Male Age Last Birthday Non-smoker 2 | #' 3 | #' @description Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 2001. Sex: Male. Basis: Age Last Birthday. Smoker: No. 4 | #' @name CSO2001MALBnonsmoker 5 | #' @docType data 6 | #' @usage data(CSO2001MALBnonsmoker) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=1516} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/CSO80FANBnonsmoker.R: -------------------------------------------------------------------------------- 1 | #' @title CSO80 Female Age Nearest Birthday Non-smoker 2 | #' 3 | #' @description Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1980. Sex: Female. Basis: Age Nearest Birthday. Smoker: No. 4 | #' @name CSO80FANBnonsmoker 5 | #' @docType data 6 | #' @usage data(CSO80FANBnonsmoker) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=38} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/CSO2001FALBnonsmoker.R: -------------------------------------------------------------------------------- 1 | #' @title CSO2001 Female Age Last Birthday Non-smoker 2 | #' 3 | #' @description Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 2001. Sex: Female. Basis: Age Last Birthday. Smoker: No. 4 | #' @name CSO2001FALBnonsmoker 5 | #' @docType data 6 | #' @usage data(CSO2001FALBnonsmoker) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=1517} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/CSO2001MANBnonsmoker.R: -------------------------------------------------------------------------------- 1 | #' @title CSO2001 Male Age Nearest Birthday Non-smoker 2 | #' 3 | #' @description Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 2001. Sex: Male. Basis: Age Nearest Birthday. Smoker: No. 4 | #' @name CSO2001MANBnonsmoker 5 | #' @docType data 6 | #' @usage data(CSO2001MANBnonsmoker) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=1137} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/ArgentinaINDEC9092comb.R: -------------------------------------------------------------------------------- 1 | #' @title ArgentinaINDEC9092 Males and Females Combined 2 | #' 3 | #' @description Mortality table (ultimate): Argentina Instituto Nacional de Estadistica y Censos (INDEC). Nation: Argentina. Year: 1990-1992. Sex: Males and Females Combined. 4 | #' @name ArgentinaINDEC9092comb 5 | #' @docType data 6 | #' @usage data(ArgentinaINDEC9092comb) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=20003} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /R/CSO2001FANBnonsmoker.R: -------------------------------------------------------------------------------- 1 | #' @title CSO2001 Female Age Nearest Birthday Non-smoker 2 | #' 3 | #' @description Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 2001. Sex: Female. Basis: Age Nearest Birthday. Smoker: No. 4 | #' @name CSO2001FANBnonsmoker 5 | #' @docType data 6 | #' @usage data(CSO2001FANBnonsmoker) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=1140} 9 | #' @keywords datasets table 10 | NULL 11 | -------------------------------------------------------------------------------- /man/GAM83M.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/GAM83M.R 3 | \docType{data} 4 | \name{GAM83M} 5 | \alias{GAM83M} 6 | \title{GAM83 Male} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(GAM83M) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Group Annuity Mortality. Nation: United States of America. Year: 1983. Sex: Male. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=826} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/Mi85M.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Mi85M.R 3 | \docType{data} 4 | \name{Mi85M} 5 | \alias{Mi85M} 6 | \title{Mi85 Male} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(Mi85M) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Mortalidad Invalidez. Nation: Chile. Year: 1985. Sex: Male. 15 | } 16 | \references{ 17 | \url{http://servicios.infoleg.gob.ar/infolegInternet/anexos/80000-84999/81029/norma.htm} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/GAM83F.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/GAM83F.R 3 | \docType{data} 4 | \name{GAM83F} 5 | \alias{GAM83F} 6 | \title{GAM83 Female} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(GAM83F) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Group Annuity Mortality. Nation: United States of America. Year: 1983. Sex: Female. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=825} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/Mi85F.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Mi85F.R 3 | \docType{data} 4 | \name{Mi85F} 5 | \alias{Mi85F} 6 | \title{Mi85 Female} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(Mi85F) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Mortalidad Invalidez. Nation: Chile. Year: 1985. Sex: Female. 15 | } 16 | \references{ 17 | \url{http://servicios.infoleg.gob.ar/infolegInternet/anexos/80000-84999/81029/norma.htm} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/sf.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sf.R 3 | \name{sf} 4 | \alias{sf} 5 | \title{Future Value of an Annuity} 6 | \usage{ 7 | sf(l = 0, n, i) 8 | } 9 | \arguments{ 10 | \item{l}{0 for annuity due or 1 for annuity immediate.} 11 | 12 | \item{n}{A numeric value. The number of payments.} 13 | 14 | \item{i}{A numeric value. The interest rate.} 15 | } 16 | \description{ 17 | Calculates the future value of an annuity. 18 | } 19 | \examples{ 20 | sf(0,12,0.05) 21 | sf(1,23,0.04) 22 | 23 | } 24 | \keyword{Annuity} 25 | \keyword{Future} 26 | \keyword{Value} 27 | -------------------------------------------------------------------------------- /R/contmeses.R: -------------------------------------------------------------------------------- 1 | #' @title Contmeses 2 | #' 3 | #' @description Helpful function for identifying if a payment is required on that period. 4 | #' @param x A numeric type value. The moment. 5 | #' @param var A numeric type value. Number of payments per year. 6 | #' @keywords Contmeses 7 | #' @return Returns 1 if in that moment corresponds a payment or 0 if not. 8 | #' @noRd 9 | #' 10 | 11 | contmeses<-function(x,var){ 12 | j<-12/var 13 | if((x-1)/12==round((x-1)/12)){ 14 | div<-1 15 | } else if(round((x-1)/j)==(x-1)/j){ 16 | div<-1 17 | } else{ 18 | div<-0 19 | } 20 | return(div) 21 | } 22 | 23 | -------------------------------------------------------------------------------- /man/af.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/af.R 3 | \name{af} 4 | \alias{af} 5 | \title{Present Value of An Annuity} 6 | \usage{ 7 | af(l = 0, n, i) 8 | } 9 | \arguments{ 10 | \item{l}{0 for annuity due or 1 for annuity immediate.} 11 | 12 | \item{n}{A numeric value. The number of payments.} 13 | 14 | \item{i}{A numeric value. The interest rate.} 15 | } 16 | \description{ 17 | Calculates the present value of an annuity. 18 | } 19 | \examples{ 20 | af(0,10,0.03) 21 | af(1,15,0.05) 22 | 23 | } 24 | \keyword{Annuity} 25 | \keyword{Present} 26 | \keyword{Value} 27 | -------------------------------------------------------------------------------- /man/CSO58MALB.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CSO58MALB.R 3 | \docType{data} 4 | \name{CSO58MALB} 5 | \alias{CSO58MALB} 6 | \title{CSO58 Male Age Last Birthday} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(CSO58MALB) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1958. Sex: Male. Basis: Age Last Birthday. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=7} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/CSO80MALB.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CSO80MALB.R 3 | \docType{data} 4 | \name{CSO80MALB} 5 | \alias{CSO80MALB} 6 | \title{CSO80 Male Age Last Birthday} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(CSO80MALB) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1980. Sex: Male. Basis: Age Last Birthday. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=41} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/GAM94MANB.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/GAM94MANB.R 3 | \docType{data} 4 | \name{GAM94MANB} 5 | \alias{GAM94MANB} 6 | \title{GAM94 Male Age Nearest Birthday} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(GAM94MANB) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Group Annuity Mortality. Nation: United States of America. Year: 1994. Sex: Male. Basis: Age Nearest Birthday. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=835} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/MAyP0206activeM.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/MAyP0206activeM.R 3 | \docType{data} 4 | \name{MAyP0206activeM} 5 | \alias{MAyP0206activeM} 6 | \title{MAyP0206 Active Male} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(MAyP0206activeM) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Mortalidad Activos y Pasivos. Nation: Argentina. Year: 2002-2006. Sex: Male. Status: Active. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=20004} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/CSO58FALB.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CSO58FALB.R 3 | \docType{data} 4 | \name{CSO58FALB} 5 | \alias{CSO58FALB} 6 | \title{CSO58 Female Age Last Birthday} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(CSO58FALB) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Commissioner's Standard Ordinary. Year: 1958. Nation: United States of America. Sex: Female. Basis: Age Last Birthday. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=8} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/CSO58MANB.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CSO58MANB.R 3 | \docType{data} 4 | \name{CSO58MANB} 5 | \alias{CSO58MANB} 6 | \title{CSO58 Male Age Nearest Birthday} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(CSO58MANB) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1958. Sex: Male. Basis: Age Nearest Birthday. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=5} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/GAM94FANB.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/GAM94FANB.R 3 | \docType{data} 4 | \name{GAM94FANB} 5 | \alias{GAM94FANB} 6 | \title{GAM94 Female Age Nearest Birthday} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(GAM94FANB) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Group Annuity Mortality. Nation: United States of America. Year: 1994. Sex: Female. Basis: Age Nearest Birthday. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=834} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/MAyP0206activeF.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/MAyP0206activeF.R 3 | \docType{data} 4 | \name{MAyP0206activeF} 5 | \alias{MAyP0206activeF} 6 | \title{MAyP0206 Active Female} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(MAyP0206activeF) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Mortalidad Activos y Pasivos. Nation: Argentina. Year: 2002-2006. Sex: Female. Status: Active. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=20005} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/CSO58FANB.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CSO58FANB.R 3 | \docType{data} 4 | \name{CSO58FANB} 5 | \alias{CSO58FANB} 6 | \title{CSO58 Female Age Nearest Birthday} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(CSO58FANB) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1958. Sex: Female. Basis: Age Nearest Birthday. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=6} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/CSO80FALB.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CSO80FALB.R 3 | \docType{data} 4 | \name{CSO80FALB} 5 | \alias{CSO80FALB} 6 | \title{CSO80 Female Age Last Birthday} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(CSO80FALB) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1980. Sex: Female Age method: Age Last Birthday. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=35} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/CSO80FANB.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CSO80FANB.R 3 | \docType{data} 4 | \name{CSO80FANB} 5 | \alias{CSO80FANB} 6 | \title{CSO80 Female Age Nearest Birthday} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(CSO80FANB) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1980. Sex: Female. Basis: Age Nearest Birthday. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=36} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/CSO80MANB.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CSO80MANB.R 3 | \docType{data} 4 | \name{CSO80MANB} 5 | \alias{CSO80MANB} 6 | \title{CSO80 Male Age Nearest Birthday} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(CSO80MANB) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1980. Sex: Male. Age method: Age Nearest Birthday. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=42} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/MAyP0206retiredM.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/MAyP0206retiredM.R 3 | \docType{data} 4 | \name{MAyP0206retiredM} 5 | \alias{MAyP0206retiredM} 6 | \title{MAyP0206 Retired Male} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(MAyP0206retiredM) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Mortalidad Activos y Pasivos. Nation: Argentina. Year: 2002-2006. Sex: Male. Status: Retired. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=20006} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/MAyP0206retiredF.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/MAyP0206retiredF.R 3 | \docType{data} 4 | \name{MAyP0206retiredF} 5 | \alias{MAyP0206retiredF} 6 | \title{MAyP0206 Retired Female} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(MAyP0206retiredF) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Mortalidad Activos y Pasivos. Nation: Argentina. Year: 2002-2006. Sex: Female. Status: Retired. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=20007} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/GAM71M.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/GAM71M.R 3 | \docType{data} 4 | \name{GAM71M} 5 | \alias{GAM71M} 6 | \title{GAM71 Male} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(GAM71M) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Group Annuity Mortality. Nation: United States of America. Year: 1971. Sex: Male. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=818}, \url{http://servicios.infoleg.gob.ar/infolegInternet/anexos/80000-84999/81029/norma.htm} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/MAyP0206CAM.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/MAyP0206CAM.R 3 | \docType{data} 4 | \name{MAyP0206CAM} 5 | \alias{MAyP0206CAM} 6 | \title{MAyP0206 Combined Active and Retired Male} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(MAyP0206CAM) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Mortalidad Activos y Pasivos. Nation: Argentina. Year: 2002-2006. Sex: Male. Status: Combined Active and Retired. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=20008} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/GAM71F.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/GAM71F.R 3 | \docType{data} 4 | \name{GAM71F} 5 | \alias{GAM71F} 6 | \title{GAM71 Female} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(GAM71F) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Group Annuity Mortality. Nation: United States of America. Year: 1971. Sex: Female. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=817}, \url{http://servicios.infoleg.gob.ar/infolegInternet/anexos/80000-84999/81029/norma.htm} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/MAyP0206CAF.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/MAyP0206CAF.R 3 | \docType{data} 4 | \name{MAyP0206CAF} 5 | \alias{MAyP0206CAF} 6 | \title{MAyP0206 Combined Active and Retired Female} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(MAyP0206CAF) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Mortalidad Activos y Pasivos. Nation: Argentina. Year: 2002-2006. Sex: Female. Status: Combined Active and Retired. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=20009} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /R/Mi06M.R: -------------------------------------------------------------------------------- 1 | #' @title Mi06 Male 2 | #' 3 | #' @description Mortality table (ultimate): Mortalidad Invalidez. Nation: Chile. Year: 2006. Sex: Male. 4 | #' @name Mi06M 5 | #' @docType data 6 | #' @usage data(Mi06M) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=2712},\url{https://www.spensiones.cl/portal/compendio/596/w3-propertyvalue-3542.html} 9 | #' @keywords datasets table 10 | #' @note For more information on how to adjust the values of the table using an 'improvement rate' visit: \url{https://www.spensiones.cl/portal/compendio/596/w3-propertyvalue-3537.html} 11 | NULL 12 | 13 | -------------------------------------------------------------------------------- /man/ArgentinaINDEC9092M.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ArgentinaINDEC9092M.R 3 | \docType{data} 4 | \name{ArgentinaINDEC9092M} 5 | \alias{ArgentinaINDEC9092M} 6 | \title{ArgentinaINDEC9092 Male} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(ArgentinaINDEC9092M) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Argentina Instituto Nacional de Estadistica y Censos (INDEC). Nation: Argentina. Year: 1990-1992. Sex: Male. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=20001} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /R/Mi06F.R: -------------------------------------------------------------------------------- 1 | #' @title Mi06 Female 2 | #' 3 | #' @description Mortality table (ultimate): Mortalidad Invalidez. Nation: Chile. Year: 2006. Sex: Female. 4 | #' @name Mi06F 5 | #' @docType data 6 | #' @usage data(Mi06F) 7 | #' @format A data frame containing a column for age (x) and a column for death probability (q). 8 | #' @references \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=2713},\url{https://www.spensiones.cl/portal/compendio/596/w3-propertyvalue-3542.html} 9 | #' @keywords datasets table 10 | #' @note for more information on how to adjust the values of the table using an 'improvement rate' visit: \url{https://www.spensiones.cl/portal/compendio/596/w3-propertyvalue-3537.html} 11 | NULL 12 | 13 | -------------------------------------------------------------------------------- /man/ArgentinaINDEC9092F.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ArgentinaINDEC9092F.R 3 | \docType{data} 4 | \name{ArgentinaINDEC9092F} 5 | \alias{ArgentinaINDEC9092F} 6 | \title{ArgentinaINDEC9092 Female} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(ArgentinaINDEC9092F) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Argentina Instituto Nacional de Estadistica y Censos (INDEC). Nation: Argentina. Year: 1990-1992. Sex: Female. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=20002} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/CSO80MALBsmoker.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CSO80MALBsmoker.R 3 | \docType{data} 4 | \name{CSO80MALBsmoker} 5 | \alias{CSO80MALBsmoker} 6 | \title{CSO80 Male Age Last Birthday Smoker} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(CSO80MALBsmoker) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1980. Sex: Male. Basis: Age Last Birthday. Smoker: Yes. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=45} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/CSO80FALBsmoker.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CSO80FALBsmoker.R 3 | \docType{data} 4 | \name{CSO80FALBsmoker} 5 | \alias{CSO80FALBsmoker} 6 | \title{CSO80 Female Age Last Birthday smoker} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(CSO80FALBsmoker) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1980. Sex: Female. Basis: Age Last Birthday. Smoker: Yes. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=39} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/CSO80MANBsmoker.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CSO80MANBsmoker.R 3 | \docType{data} 4 | \name{CSO80MANBsmoker} 5 | \alias{CSO80MANBsmoker} 6 | \title{CSO80 Male Age Nearest Birthday Smoker} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(CSO80MANBsmoker) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1980. Sex: Male. Basis: Age Nearest Birthday. Smoker: Yes. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=46} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/CSO80FANBsmoker.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CSO80FANBsmoker.R 3 | \docType{data} 4 | \name{CSO80FANBsmoker} 5 | \alias{CSO80FANBsmoker} 6 | \title{CSO80 Female Age Nearest Birthday Smoker} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(CSO80FANBsmoker) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1980. Sex: Female. Basis: Age Nearest Birthday. Smoker: Yes. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=40} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/CSO2001MALBsmoker.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CSO2001MALBsmoker.R 3 | \docType{data} 4 | \name{CSO2001MALBsmoker} 5 | \alias{CSO2001MALBsmoker} 6 | \title{CSO2001 Male Age Last Birthday Smoker} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(CSO2001MALBsmoker) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 2001. Sex: Male. Basis: Age Last Birthday. Smoker: yes. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=1518} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/CSO2001FALBsmoker.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CSO2001FALBsmoker.R 3 | \docType{data} 4 | \name{CSO2001FALBsmoker} 5 | \alias{CSO2001FALBsmoker} 6 | \title{CSO2001 Female Age Last Birthday Smoker} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(CSO2001FALBsmoker) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 2001. Sex: Female. Basis: Age Last Birthday. Smoker: yes. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=1519} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/CSO2001MANBsmoker.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CSO2001MANBsmoker.R 3 | \docType{data} 4 | \name{CSO2001MANBsmoker} 5 | \alias{CSO2001MANBsmoker} 6 | \title{CSO2001 Male Age Nearest Birthday Smoker} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(CSO2001MANBsmoker) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 2001. Sex: Male. Basis: Age Nearest Birthday. Smoker: Yes. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=1138} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/CSO80MALBnonsmoker.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CSO80MALBnonsmoker.R 3 | \docType{data} 4 | \name{CSO80MALBnonsmoker} 5 | \alias{CSO80MALBnonsmoker} 6 | \title{CSO80 Male Age Last Birthday Non-smoker} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(CSO80MALBnonsmoker) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1980. Sex: Male. Basis: Age Last Birthday. Smoker: No. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=43} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/CSO2001FANBsmoker.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CSO2001FANBsmoker.R 3 | \docType{data} 4 | \name{CSO2001FANBsmoker} 5 | \alias{CSO2001FANBsmoker} 6 | \title{CSO2001 Female Age Nearest Birthday Smoker} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(CSO2001FANBsmoker) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 2001. Sex: Female. Basis: Age Nearest Birthday. Smoker: Yes. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=1141} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/CSO80FALBnonsmoker.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CSO80FALBnonsmoker.R 3 | \docType{data} 4 | \name{CSO80FALBnonsmoker} 5 | \alias{CSO80FALBnonsmoker} 6 | \title{CSO80 Female Age Last Birthday non-smoker} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(CSO80FALBnonsmoker) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1980. Sex: Female. Basis: Age Last Birthday. Smoker: No. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=37} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/CSO80MANBnonsmoker.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CSO80MANBnonsmoker.R 3 | \docType{data} 4 | \name{CSO80MANBnonsmoker} 5 | \alias{CSO80MANBnonsmoker} 6 | \title{CSO80 Male Age Nearest Birthday Non-smoker} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(CSO80MANBnonsmoker) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1980. Sex: Male. Basis: Age Nearest Birthday. Smoker: No. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=44} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/CSO80FANBnonsmoker.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CSO80FANBnonsmoker.R 3 | \docType{data} 4 | \name{CSO80FANBnonsmoker} 5 | \alias{CSO80FANBnonsmoker} 6 | \title{CSO80 Female Age Nearest Birthday Non-smoker} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(CSO80FANBnonsmoker) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 1980. Sex: Female. Basis: Age Nearest Birthday. Smoker: No. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=38} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/CSO2001FALBnonsmoker.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CSO2001FALBnonsmoker.R 3 | \docType{data} 4 | \name{CSO2001FALBnonsmoker} 5 | \alias{CSO2001FALBnonsmoker} 6 | \title{CSO2001 Female Age Last Birthday Non-smoker} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(CSO2001FALBnonsmoker) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 2001. Sex: Female. Basis: Age Last Birthday. Smoker: No. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=1517} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/CSO2001MALBnonsmoker.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CSO2001MALBnonsmoker.R 3 | \docType{data} 4 | \name{CSO2001MALBnonsmoker} 5 | \alias{CSO2001MALBnonsmoker} 6 | \title{CSO2001 Male Age Last Birthday Non-smoker} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(CSO2001MALBnonsmoker) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 2001. Sex: Male. Basis: Age Last Birthday. Smoker: No. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=1516} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/CSO2001MANBnonsmoker.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CSO2001MANBnonsmoker.R 3 | \docType{data} 4 | \name{CSO2001MANBnonsmoker} 5 | \alias{CSO2001MANBnonsmoker} 6 | \title{CSO2001 Male Age Nearest Birthday Non-smoker} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(CSO2001MANBnonsmoker) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 2001. Sex: Male. Basis: Age Nearest Birthday. Smoker: No. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=1137} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/CSO2001FANBnonsmoker.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CSO2001FANBnonsmoker.R 3 | \docType{data} 4 | \name{CSO2001FANBnonsmoker} 5 | \alias{CSO2001FANBnonsmoker} 6 | \title{CSO2001 Female Age Nearest Birthday Non-smoker} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(CSO2001FANBnonsmoker) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Commissioner's Standard Ordinary. Nation: United States of America. Year: 2001. Sex: Female. Basis: Age Nearest Birthday. Smoker: No. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=1140} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /man/ArgentinaINDEC9092comb.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ArgentinaINDEC9092comb.R 3 | \docType{data} 4 | \name{ArgentinaINDEC9092comb} 5 | \alias{ArgentinaINDEC9092comb} 6 | \title{ArgentinaINDEC9092 Males and Females Combined} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(ArgentinaINDEC9092comb) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Argentina Instituto Nacional de Estadistica y Censos (INDEC). Nation: Argentina. Year: 1990-1992. Sex: Males and Females Combined. 15 | } 16 | \references{ 17 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=20003} 18 | } 19 | \keyword{datasets} 20 | \keyword{table} 21 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(A.) 4 | export(ACont.) 5 | export(AD.) 6 | export(Am.) 7 | export(Av.) 8 | export(Avg.) 9 | export(E) 10 | export(Em) 11 | export(Fractional_table) 12 | export(JointSurvival) 13 | export(Loan_amortization) 14 | export(Payment_Protection) 15 | export(PremiumFrac) 16 | export(Rate_converter) 17 | export(Survival) 18 | export(Table_Dormoy) 19 | export(Table_Gompertz) 20 | export(Table_Makeham) 21 | export(Table_Moivre) 22 | export(V_A.) 23 | export(V_AD.) 24 | export(V_Av.) 25 | export(V_Avg.) 26 | export(V_E) 27 | export(V_Payment_Protection) 28 | export(V_a) 29 | export(V_aD) 30 | export(V_av) 31 | export(V_avg) 32 | export(a) 33 | export(aCont) 34 | export(aD) 35 | export(af) 36 | export(am) 37 | export(av) 38 | export(avg) 39 | export(qfrac) 40 | export(sf) 41 | -------------------------------------------------------------------------------- /man/Mi06F.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Mi06F.R 3 | \docType{data} 4 | \name{Mi06F} 5 | \alias{Mi06F} 6 | \title{Mi06 Female} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(Mi06F) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Mortalidad Invalidez. Nation: Chile. Year: 2006. Sex: Female. 15 | } 16 | \note{ 17 | for more information on how to adjust the values of the table using an 'improvement rate' visit: \url{https://www.spensiones.cl/portal/compendio/596/w3-propertyvalue-3537.html} 18 | } 19 | \references{ 20 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=2713},\url{https://www.spensiones.cl/portal/compendio/596/w3-propertyvalue-3542.html} 21 | } 22 | \keyword{datasets} 23 | \keyword{table} 24 | -------------------------------------------------------------------------------- /man/Mi06M.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Mi06M.R 3 | \docType{data} 4 | \name{Mi06M} 5 | \alias{Mi06M} 6 | \title{Mi06 Male} 7 | \format{ 8 | A data frame containing a column for age (x) and a column for death probability (q). 9 | } 10 | \usage{ 11 | data(Mi06M) 12 | } 13 | \description{ 14 | Mortality table (ultimate): Mortalidad Invalidez. Nation: Chile. Year: 2006. Sex: Male. 15 | } 16 | \note{ 17 | For more information on how to adjust the values of the table using an 'improvement rate' visit: \url{https://www.spensiones.cl/portal/compendio/596/w3-propertyvalue-3537.html} 18 | } 19 | \references{ 20 | \url{https://mort.soa.org/ViewTable.aspx?&TableIdentity=2712},\url{https://www.spensiones.cl/portal/compendio/596/w3-propertyvalue-3542.html} 21 | } 22 | \keyword{datasets} 23 | \keyword{table} 24 | -------------------------------------------------------------------------------- /man/Table_Moivre.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Table_Moivre.R 3 | \name{Table_Moivre} 4 | \alias{Table_Moivre} 5 | \title{de Moivre's Law of Mortality Table Creator} 6 | \usage{ 7 | Table_Moivre(x0, omega) 8 | } 9 | \arguments{ 10 | \item{x0}{A numeric type value. The initial age of the table.} 11 | 12 | \item{omega}{A numeric type value. The final age of the table.} 13 | } 14 | \value{ 15 | Returns a data.frame object containing age and death probabilities. 16 | } 17 | \description{ 18 | Creates a mortality table under de Moivre's law. 19 | } 20 | \examples{ 21 | Table_Moivre(0,100) 22 | 23 | } 24 | \references{ 25 | Chapter 3 (p 77-78) of Actuarial Mathematics (1997) by Bowers, Gerber, Hickman, Jones & Nesbitt. 26 | } 27 | \keyword{Moivre's} 28 | \keyword{de} 29 | \keyword{law} 30 | \keyword{table.} 31 | -------------------------------------------------------------------------------- /R/sf.R: -------------------------------------------------------------------------------- 1 | #' @title Future Value of an Annuity 2 | 3 | #' @description Calculates the future value of an annuity. 4 | #' @param l 0 for annuity due or 1 for annuity immediate. 5 | #' @param n A numeric value. The number of payments. 6 | #' @param i A numeric value. The interest rate. 7 | #' @export 8 | #' @keywords Annuity Future Value 9 | #' @return NULL 10 | #' @examples 11 | #' sf(0,12,0.05) 12 | #' sf(1,23,0.04) 13 | #' 14 | 15 | 16 | sf<-function(l=0,n,i){ 17 | dig<-getOption("digits") 18 | on.exit(options(digits = dig)) 19 | options(digits = 15) 20 | if(n>0 & i>0){ 21 | VF<-((1+i)^(n)-1)/i 22 | if(l==1){ 23 | return(VF) 24 | }else{ 25 | if(l==0){ 26 | VF<-VF*(1+i) 27 | return(VF) 28 | }else{ 29 | stop("Check timing") 30 | } 31 | } 32 | } else { 33 | stop("Check Values") 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /R/af.R: -------------------------------------------------------------------------------- 1 | #' @title Present Value of An Annuity 2 | 3 | #' @description Calculates the present value of an annuity. 4 | #' @param l 0 for annuity due or 1 for annuity immediate. 5 | #' @param n A numeric value. The number of payments. 6 | #' @param i A numeric value. The interest rate. 7 | #' @export 8 | #' @keywords Annuity Present Value 9 | #' @return NULL 10 | #' @examples 11 | #' af(0,10,0.03) 12 | #' af(1,15,0.05) 13 | #' 14 | 15 | 16 | af<-function(l=0,n,i){ 17 | dig<-getOption("digits") 18 | on.exit(options(digits = dig)) 19 | options(digits = 15) 20 | if(n>0 & i>=0){ 21 | v<-1/(1+i) 22 | VA<-(1-v^(n))/i 23 | if(l==1){ 24 | return(VA) 25 | }else{ 26 | if(l==0){ 27 | VA<-VA*(1+i) 28 | return(VA) 29 | }else{ 30 | stop("Check timing") 31 | } 32 | } 33 | } else{ 34 | stop("Check Values") 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /man/JointSurvival.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/JointSurvival.R 3 | \name{JointSurvival} 4 | \alias{JointSurvival} 5 | \title{Joint Survival Probability} 6 | \usage{ 7 | JointSurvival(x, n, data, prop = 1) 8 | } 9 | \arguments{ 10 | \item{x}{A vector representing the age of each individual.} 11 | 12 | \item{n}{An integer. The term.} 13 | 14 | \item{data}{A data.frame of the mortality table, with the first column being the age and the second one, the probability of death.} 15 | 16 | \item{prop}{A numeric value. The proportion of the mortality table used, between 0 and 1.} 17 | } 18 | \description{ 19 | Calculates the probability of survival given a mortality table for a group. 20 | } 21 | \examples{ 22 | ages<-c(34,45,52,65) 23 | JointSurvival(ages,10,CSO80FALB) 24 | 25 | } 26 | \keyword{Joint} 27 | \keyword{Probability} 28 | \keyword{Survival} 29 | -------------------------------------------------------------------------------- /man/Survival.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Survival.R 3 | \name{Survival} 4 | \alias{Survival} 5 | \title{Survival Probability} 6 | \usage{ 7 | Survival(x, n, data, prop = 1) 8 | } 9 | \arguments{ 10 | \item{x}{An integer or a vector including only integers representing the age of each individual.} 11 | 12 | \item{n}{An integer. The term.} 13 | 14 | \item{data}{A data.frame of the mortality table, with the first column being the age and the second one, the probability of death.} 15 | 16 | \item{prop}{A numeric value. The proportion of the mortality table used, between 0 and 1.} 17 | } 18 | \description{ 19 | Calculates the probability of survival given a mortality table for an individual or a group. 20 | } 21 | \examples{ 22 | Survival(20,2,CSO58MANB,1) 23 | Survival(31,33,CSO80MANB,0.8) 24 | 25 | } 26 | \keyword{Probability} 27 | \keyword{Survival} 28 | -------------------------------------------------------------------------------- /man/Table_Dormoy.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Table_Dormoy.R 3 | \name{Table_Dormoy} 4 | \alias{Table_Dormoy} 5 | \title{Dormoy's Law of Mortality Table Creator} 6 | \usage{ 7 | Table_Dormoy(x0, omega, a) 8 | } 9 | \arguments{ 10 | \item{x0}{A numeric type value. The initial age of the table.} 11 | 12 | \item{omega}{A numeric type value. The final age of the table.} 13 | 14 | \item{a}{A numeric type value. A parameter of the law.} 15 | } 16 | \value{ 17 | Returns a data.frame object containing age and death probabilities. 18 | } 19 | \description{ 20 | Creates a mortality table under Dormoy's law. 21 | } 22 | \examples{ 23 | Table_Dormoy(0,100,0.98) 24 | 25 | } 26 | \references{ 27 | Chapter 3 (p 77-78) of Actuarial Mathematics (1997) by Bowers, Gerber, Hickman, Jones & Nesbitt. 28 | } 29 | \keyword{Dormoy's} 30 | \keyword{law} 31 | \keyword{mortality} 32 | \keyword{table.} 33 | -------------------------------------------------------------------------------- /man/Table_Gompertz.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Table_Gompertz.R 3 | \name{Table_Gompertz} 4 | \alias{Table_Gompertz} 5 | \title{Gompertz's Law of Mortality Table Creator} 6 | \usage{ 7 | Table_Gompertz(x0, omega, B, C) 8 | } 9 | \arguments{ 10 | \item{x0}{A numeric type value. The initial age of the table.} 11 | 12 | \item{omega}{A numeric type value. The final age of the table.} 13 | 14 | \item{B}{A numeric type value. A parameter of the law.} 15 | 16 | \item{C}{A numeric type value. A parameter of the law.} 17 | } 18 | \value{ 19 | Returns a data.frame object containing age and death probabilities. 20 | } 21 | \description{ 22 | Creates a mortality table under Gompertz's law. 23 | } 24 | \examples{ 25 | Table_Gompertz(0,100,0.00008,1.07) 26 | 27 | } 28 | \references{ 29 | Chapter 3 (p 77-78) of Actuarial Mathematics (1997) by Bowers, Gerber, Hickman, Jones & Nesbitt. 30 | } 31 | \keyword{Gompertz's} 32 | \keyword{law} 33 | \keyword{table.} 34 | -------------------------------------------------------------------------------- /man/Table_Makeham.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Table_Makeham.R 3 | \name{Table_Makeham} 4 | \alias{Table_Makeham} 5 | \title{Makeham's Law of Mortality Table Creator} 6 | \usage{ 7 | Table_Makeham(x0, omega, A, B, C) 8 | } 9 | \arguments{ 10 | \item{x0}{A numeric type value. The initial age of the table.} 11 | 12 | \item{omega}{A numeric type value. The final age of the table.} 13 | 14 | \item{A}{A numeric type value. A parameter of the law.} 15 | 16 | \item{B}{A numeric type value. A parameter of the law.} 17 | 18 | \item{C}{A numeric type value. A parameter of the law.} 19 | } 20 | \value{ 21 | Returns a data.frame object containing age and death probabilities. 22 | } 23 | \description{ 24 | Creates a mortality table under Makeham's law. 25 | } 26 | \note{ 27 | The parameters are usually confined to the ranges shown below: 28 | 0.001 < A < 0.003, 10^(-6) < B < 10(-3), 1.08 < C < 1.12. 29 | } 30 | \examples{ 31 | Table_Makeham(0,100,0.002,3*10^(-4),1.124) 32 | 33 | } 34 | \references{ 35 | Chapter 3 (p 77-78) of Actuarial Mathematics (1997) by Bowers, Gerber, Hickman, Jones & Nesbitt. 36 | } 37 | \keyword{Makeham's} 38 | \keyword{law} 39 | \keyword{table.} 40 | -------------------------------------------------------------------------------- /R/Table_Moivre.R: -------------------------------------------------------------------------------- 1 | #' @title de Moivre's Law of Mortality Table Creator 2 | 3 | #' @description Creates a mortality table under de Moivre's law. 4 | #' @param x0 A numeric type value. The initial age of the table. 5 | #' @param omega A numeric type value. The final age of the table. 6 | #' @return Returns a data.frame object containing age and death probabilities. 7 | #' @export 8 | #' @keywords de Moivre's law table. 9 | #' @references Chapter 3 (p 77-78) of Actuarial Mathematics (1997) by Bowers, Gerber, Hickman, Jones & Nesbitt. 10 | #' @examples 11 | #' Table_Moivre(0,100) 12 | #' 13 | 14 | Table_Moivre<-function(x0,omega){ 15 | dig<-getOption("digits") 16 | on.exit(options(digits = dig)) 17 | options(digits = 15) 18 | if(x0>=0 && omega>=0 && is_integer(x0)==1 && is_integer(omega)==1){ 19 | if(x0>=omega){ 20 | stop("Check Omega") 21 | } else{ 22 | X<-seq(0,omega-1) 23 | Q<-rep(NA,omega) 24 | Tabla.Moivre<-cbind(X,Q) 25 | for(i in x0:(omega-1)){ 26 | q<-1/(omega-i) 27 | Tabla.Moivre[i+1,2]<-q 28 | } 29 | colnames(Tabla.Moivre)<-c("x","q") 30 | Tabla.Moivre<-as.data.frame(Tabla.Moivre) 31 | return(Tabla.Moivre) 32 | } 33 | } else { 34 | stop("Check values") 35 | } 36 | } 37 | 38 | 39 | -------------------------------------------------------------------------------- /man/Fractional_table.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Fractional_table.R 3 | \name{Fractional_table} 4 | \alias{Fractional_table} 5 | \title{Fractional table of mortality} 6 | \usage{ 7 | Fractional_table(data, frac, i = 0.04, assumption = "UDD") 8 | } 9 | \arguments{ 10 | \item{data}{A data.frame of the annual mortality table, with the first column being the age and the second one the probability of death.} 11 | 12 | \item{frac}{An integer. The number of fractions per year.} 13 | 14 | \item{i}{A numeric type value. The interest rate.} 15 | 16 | \item{assumption}{A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths and "constant" for constant force of mortality).} 17 | } 18 | \value{ 19 | Returns a data.frame object containing fractional age and death probability vectors. 20 | } 21 | \description{ 22 | Creates a fractional mortality table for a given mortality table. 23 | } 24 | \examples{ 25 | Fractional_table(CSO80MANB,2,0.04,"constant") 26 | Fractional_table(CSO80MANB,2,0.04,"UDD") 27 | 28 | } 29 | \references{ 30 | Chapter 3 of Actuarial Mathematics (1997) by Bowers, Gerber, Hickman, Jones & Nesbitt 31 | } 32 | \keyword{Fractional} 33 | \keyword{Mortality.} 34 | \keyword{Table} 35 | \keyword{of} 36 | -------------------------------------------------------------------------------- /man/Rate_converter.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Rate_converter.R 3 | \name{Rate_converter} 4 | \alias{Rate_converter} 5 | \title{Interest & Discount Rate Converter} 6 | \usage{ 7 | Rate_converter(num, rate1, m, rate2, k, type = "days") 8 | } 9 | \arguments{ 10 | \item{num}{A numeric type value. It is the interest/discount rate to be converted.} 11 | 12 | \item{rate1}{A string ("i", "d","f" or "j"). Type of interest/discount rate to be converted.} 13 | 14 | \item{m}{number of capitalizations.} 15 | 16 | \item{rate2}{A string ("i" for effective interest rate, "d" for effective discount rate,"f" for nominal discount rate, "j" for nominal interest rate).Type of interest/discount rate to obtain.} 17 | 18 | \item{k}{An integer. Number of capitalizations per year.} 19 | 20 | \item{type}{A string. Reference for "k", indicating whether it is expressed as a fraction or as days ("frac" or "days").} 21 | } 22 | \description{ 23 | Converts nominal and effective interest and discount rates. 24 | } 25 | \examples{ 26 | Rate_converter(0.04,"i",1,"i",6,"frac") 27 | Rate_converter(0.04,"f",1,"j",6,"frac") 28 | Rate_converter(0.04,"f",365,"d",60,"days") 29 | Rate_converter(0.04,"f",365,"f",60,"days") 30 | 31 | } 32 | \keyword{Discount} 33 | \keyword{Interest} 34 | \keyword{Rate} 35 | -------------------------------------------------------------------------------- /man/qfrac.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/qfrac.R 3 | \name{qfrac} 4 | \alias{qfrac} 5 | \title{Fractional Probability of Death} 6 | \usage{ 7 | qfrac(x, s, k, i, data, assumption, prop) 8 | } 9 | \arguments{ 10 | \item{x}{An integer. The age of the insuree.} 11 | 12 | \item{s}{An integer. Fraction of the year.} 13 | 14 | \item{k}{An integer. Number of fractions per year.} 15 | 16 | \item{i}{The interest rate. A numeric type value.} 17 | 18 | \item{data}{A data.frame containing the mortality table, with the first column being the age and the second one, the probability of death.} 19 | 20 | \item{assumption}{A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths and "constant" for constant force of mortality).} 21 | 22 | \item{prop}{A numeric value. It represents the proportion of the mortality table being used (between 0 and 1).} 23 | } 24 | \value{ 25 | The fractional probability of death. 26 | } 27 | \description{ 28 | Calculates the fractional probability for a person of x+s/k dies before age x+(s+1)/k. 29 | } 30 | \examples{ 31 | qfrac(27,1,4,0.04,CSO80MANB,"constant",1) 32 | qfrac(20,0,12,0.04,CSO80MANB,"UDD",0.8) 33 | } 34 | \keyword{Fractional} 35 | \keyword{death} 36 | \keyword{of} 37 | \keyword{probability} 38 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: DetLifeInsurance 2 | Type: Package 3 | Title: Life Insurance Premium and Reserves Valuation 4 | Version: 0.1.3 5 | Authors@R: c( 6 | person("Joaquin", "Auza", email = "auzajoaquin@gmail.com", role = c("aut", "cre")), 7 | person("Maria Sol", "Alvarez", email = "alvarezmmsol@gmail.com", role = "aut")) 8 | Maintainer: Joaquin Auza 9 | Description: Methods for valuation of life insurance premiums and reserves (including variable-benefit and fractional coverage) based on "Actuarial Mathematics" by Bowers, H.U. Gerber, J.C. Hickman, D.A. Jones and C.J. Nesbitt (1997, ISBN: 978-0938959465), "Actuarial Mathematics for Life Contingent Risks" by Dickson, David C. M., Hardy, Mary R. and Waters, Howard R (2009) and "Life Contingencies" by Jordan, C. W (1952) . It also contains functions for equivalent interest and discount rate calculation, present and future values of annuities, and loan amortization schedule. 10 | License: GPL-3 11 | Depends: R (>= 3.5.0) 12 | Imports: utils 13 | Encoding: UTF-8 14 | LazyData: true 15 | RoxygenNote: 7.1.0 16 | URL: https://github.com/JoaquinAuza/DetLifeInsurance 17 | BugReports: https://github.com/JoaquinAuza/DetLifeInsurance/issues 18 | VignetteBuilder: knitr 19 | Suggests: knitr, rmarkdown 20 | -------------------------------------------------------------------------------- /R/Survival.R: -------------------------------------------------------------------------------- 1 | #' @title Survival Probability 2 | 3 | #' @description Calculates the probability of survival given a mortality table for an individual or a group. 4 | #' @param x An integer or a vector including only integers representing the age of each individual. 5 | #' @param n An integer. The term. 6 | #' @param data A data.frame of the mortality table, with the first column being the age and the second one, the probability of death. 7 | #' @param prop A numeric value. The proportion of the mortality table used, between 0 and 1. 8 | #' @export 9 | #' @keywords Survival Probability 10 | #' @return NULL 11 | #' @examples 12 | #' Survival(20,2,CSO58MANB,1) 13 | #' Survival(31,33,CSO80MANB,0.8) 14 | #' 15 | 16 | 17 | Survival<-function(x,n,data,prop=1){ 18 | dig<-getOption("digits") 19 | on.exit(options(digits = dig)) 20 | options(digits = 15) 21 | if(x>=0 & is_integer(x)==1 & n>=0 & is_integer(n)==1 & prop>0){ 22 | Prob<-1 23 | if(n==0){ 24 | Prob<-1 25 | }else{ 26 | for(l in x:(x+n-1)){ 27 | if(l==(nrow(data)-1)){ 28 | prop<-1 29 | } 30 | Prob<-Prob*(1-data[l+1,2]*prop) 31 | if(is.na(Prob)==1){ 32 | Prob<-0 33 | } 34 | } 35 | Prob<-as.numeric(Prob) 36 | } 37 | return(Prob) 38 | } else{ 39 | stop("Check values") 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /man/E.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/E.R 3 | \name{E} 4 | \alias{E} 5 | \title{Pure Endowment} 6 | \usage{ 7 | E(x, n, i = 0.04, data, prop = 1, assumption = "none", cap = 1) 8 | } 9 | \arguments{ 10 | \item{x}{An integer. The age of the insuree.} 11 | 12 | \item{n}{The term of the endowment. An integer, for annual coverage, or a numeric for fractional coverage.} 13 | 14 | \item{i}{The interest rate. A numeric type value.} 15 | 16 | \item{data}{A data.frame containing the mortality table, with the first column being the age and the second one, the probability of death.} 17 | 18 | \item{prop}{A numeric value. It represents the proportion of the mortality table being used (between 0 and 1).} 19 | 20 | \item{assumption}{A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage).} 21 | 22 | \item{cap}{A numeric type value. The payment.} 23 | } 24 | \description{ 25 | Calculates the Pure endowments. 26 | } 27 | \examples{ 28 | E(45,10,0.04,CSO80MANB,1,"none",1000) 29 | E(24,1.6,0.04,CSO80MANB,1,"constant",17000) 30 | E(26,2.4,0.04,CSO58FALB,1,"UDD",3500) 31 | 32 | } 33 | \references{ 34 | Chapter 2 of Life Contingencies (1952) by Jordan. 35 | } 36 | \keyword{Endowment} 37 | \keyword{Pure} 38 | -------------------------------------------------------------------------------- /R/Table_Dormoy.R: -------------------------------------------------------------------------------- 1 | #' @title Dormoy's Law of Mortality Table Creator 2 | 3 | #' @description Creates a mortality table under Dormoy's law. 4 | #' @param x0 A numeric type value. The initial age of the table. 5 | #' @param omega A numeric type value. The final age of the table. 6 | #' @param a A numeric type value. A parameter of the law. 7 | #' @return Returns a data.frame object containing age and death probabilities. 8 | #' @export 9 | #' @keywords Dormoy's law mortality table. 10 | #' @references Chapter 3 (p 77-78) of Actuarial Mathematics (1997) by Bowers, Gerber, Hickman, Jones & Nesbitt. 11 | #' @examples 12 | #' Table_Dormoy(0,100,0.98) 13 | #' 14 | 15 | Table_Dormoy<-function(x0,omega,a){ 16 | dig<-getOption("digits") 17 | on.exit(options(digits = dig)) 18 | options(digits = 15) 19 | if(x0>=0 && omega>=0 && a>0 && a<1 && is_integer(x0)==1 && is_integer(omega)==1){ 20 | if(x0>=omega){ 21 | stop("Check Omega") 22 | } else{ 23 | X<-seq(0,omega-1) 24 | Q<-rep(NA,omega) 25 | Tabla.Dormoy<-cbind(X,Q) 26 | for(i in x0:(omega-2)){ 27 | q<-1-(a^1) 28 | Tabla.Dormoy[i+1,2]<-q 29 | } 30 | Tabla.Dormoy[omega,2]<-1 31 | colnames(Tabla.Dormoy)<-c("x","q") 32 | Tabla.Dormoy<-as.data.frame(Tabla.Dormoy) 33 | return(Tabla.Dormoy) 34 | } 35 | } else { 36 | stop("Check values") 37 | } 38 | } 39 | 40 | 41 | -------------------------------------------------------------------------------- /R/Table_Gompertz.R: -------------------------------------------------------------------------------- 1 | #' @title Gompertz's Law of Mortality Table Creator 2 | 3 | #' @description Creates a mortality table under Gompertz's law. 4 | #' @param x0 A numeric type value. The initial age of the table. 5 | #' @param omega A numeric type value. The final age of the table. 6 | #' @param B A numeric type value. A parameter of the law. 7 | #' @param C A numeric type value. A parameter of the law. 8 | #' @return Returns a data.frame object containing age and death probabilities. 9 | #' @export 10 | #' @keywords Gompertz's law table. 11 | #' @references Chapter 3 (p 77-78) of Actuarial Mathematics (1997) by Bowers, Gerber, Hickman, Jones & Nesbitt. 12 | #' @examples 13 | #' Table_Gompertz(0,100,0.00008,1.07) 14 | #' 15 | 16 | Table_Gompertz<-function(x0,omega,B,C){ 17 | dig<-getOption("digits") 18 | on.exit(options(digits = dig)) 19 | options(digits = 15) 20 | if(x0>=0 && omega>=0 && 01 && is_integer(x0)==1 && is_integer(omega)==1) { 21 | G<-exp(-B/(log(C))) 22 | if(x0>=omega){ 23 | stop("Check Omega") 24 | } else { 25 | X<-seq(0,omega-1) 26 | Q<-rep(NA,omega) 27 | Tabla.Gompertz<-cbind(X,Q) 28 | for(i in x0:(omega-1)){ 29 | q<-1-(G^(C^(i)*(C-1))) 30 | Tabla.Gompertz[i+1,2]<-q 31 | } 32 | } 33 | Tabla.Gompertz[omega,2]<-1 34 | colnames(Tabla.Gompertz)<-c("x","q") 35 | Tabla.Gompertz<-as.data.frame(Tabla.Gompertz) 36 | return(Tabla.Gompertz) 37 | } else{ 38 | stop("Check values") 39 | } 40 | } 41 | 42 | 43 | -------------------------------------------------------------------------------- /R/JointSurvival.R: -------------------------------------------------------------------------------- 1 | #' @title Joint Survival Probability 2 | 3 | #' @description Calculates the probability of survival given a mortality table for a group. 4 | #' @param x A vector representing the age of each individual. 5 | #' @param n An integer. The term. 6 | #' @param data A data.frame of the mortality table, with the first column being the age and the second one, the probability of death. 7 | #' @param prop A numeric value. The proportion of the mortality table used, between 0 and 1. 8 | #' @export 9 | #' @keywords Joint Survival Probability 10 | #' @return NULL 11 | #' @examples 12 | #' ages<-c(34,45,52,65) 13 | #' JointSurvival(ages,10,CSO80FALB) 14 | #' 15 | 16 | JointSurvival<-function(x,n,data,prop=1){ 17 | dig<-getOption("digits") 18 | on.exit(options(digits = dig)) 19 | options(digits = 15) 20 | aux_prop<-prop 21 | if(is_integer(x)==1 && is_integer(n)==1 && n>=0 && prop>0 ){ 22 | TotalProb<-1 23 | for(i in 1:length(x)){ 24 | Prob<-1 25 | if(n==0){ 26 | Prob<-1 27 | }else{ 28 | for(l in x[i]:(x[i]+n-1)){ 29 | if(l==nrow(data)-1){ 30 | prop<-1 31 | } else { 32 | prop<-aux_prop 33 | } 34 | Prob<-Prob*(1-data[l+1,2]*prop) 35 | if(is.na(Prob)==1){ 36 | prob<-0 37 | } 38 | } 39 | Prob<-as.numeric(Prob) 40 | } 41 | TotalProb<-TotalProb*Prob 42 | } 43 | return(TotalProb) 44 | } else{ 45 | stop("Check values") 46 | } 47 | } 48 | 49 | 50 | -------------------------------------------------------------------------------- /man/ACont..Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ACont..R 3 | \name{ACont.} 4 | \alias{ACont.} 5 | \title{Continuous Life Insurance} 6 | \usage{ 7 | ACont.(x, h, n, i = 0.04, data, prop = 1, assumption = "UDD", cap = 1) 8 | } 9 | \arguments{ 10 | \item{x}{An integer. The age of the insuree.} 11 | 12 | \item{h}{An integer. The deferral period.} 13 | 14 | \item{n}{An integer. Number of years of coverage.} 15 | 16 | \item{i}{The interest rate. A numeric type value.} 17 | 18 | \item{data}{A data.frame of the mortality table, with the first column being the age and the second one the probability of death.} 19 | 20 | \item{prop}{A numeric value. It represents the proportion of the mortality table being used (between 0 and 1).} 21 | 22 | \item{assumption}{A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths and "constant" for constant force of mortality).} 23 | 24 | \item{cap}{A numeric type value. The value of the payment.} 25 | } 26 | \value{ 27 | Returns a numeric (actuarial present value). 28 | } 29 | \description{ 30 | Calculates the present value of a continuous life insurance. 31 | } 32 | \examples{ 33 | ACont.(24,2,10,0.04,CSO80MANB,1,"UDD",1) 34 | ACont.(24,2,10,0.04,CSO80MANB,1,"constant",1) 35 | 36 | } 37 | \references{ 38 | Chapter 3 of Life Contingencies (1952) by Jordan, chapter 4 of Actuarial Mathematics (1997) by Bowers, Gerber, Hickman, Jones & Nesbitt. 39 | } 40 | \keyword{Continuous} 41 | \keyword{Insurance} 42 | \keyword{Life} 43 | -------------------------------------------------------------------------------- /man/aCont.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/aCont.R 3 | \name{aCont} 4 | \alias{aCont} 5 | \title{Continuous Life Annuities} 6 | \usage{ 7 | aCont(x, h, n, i = 0.04, data, prop = 1, assumption = "constant", cap = 1) 8 | } 9 | \arguments{ 10 | \item{x}{An integer. The age of the insuree.} 11 | 12 | \item{h}{An integer. The deferral period.} 13 | 14 | \item{n}{An integer. Number of years of coverage.} 15 | 16 | \item{i}{The interest rate. A numeric type value.} 17 | 18 | \item{data}{A data.frame of the mortality table, with the first column being the age and the second one the probability of death.} 19 | 20 | \item{prop}{A numeric value. It represents the proportion of the mortality table being used (between 0 and 1).} 21 | 22 | \item{assumption}{A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths and "constant" for constant force of mortality).} 23 | 24 | \item{cap}{A numeric type value. The value of the payment.} 25 | } 26 | \value{ 27 | Returns a numeric value (the actuarial present value). 28 | } 29 | \description{ 30 | Calculates the present value of a continuous life annuity. 31 | } 32 | \examples{ 33 | aCont(35,7,10,0.04,CSO80MANB,1,"constant",1) 34 | aCont(23,5,12,0.04,CSO80MANB,1,"UDD",1) 35 | 36 | } 37 | \references{ 38 | Chapter 2 of Life Contingencies (1952) by Jordan, chapter 5 of Actuarial Mathematics (1997) by Bowers, Gerber, Hickman, Jones & Nesbitt. 39 | } 40 | \keyword{Annuities} 41 | \keyword{Continuous} 42 | \keyword{Life} 43 | -------------------------------------------------------------------------------- /man/Loan_amortization.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Loan_amortization.R 3 | \name{Loan_amortization} 4 | \alias{Loan_amortization} 5 | \title{Loan Amortization} 6 | \usage{ 7 | Loan_amortization(V0, n, i, i2 = 0, alic = 0, ins = 0, method) 8 | } 9 | \arguments{ 10 | \item{V0}{A numeric type value. Loan value.} 11 | 12 | \item{n}{A numeric type value. The number of payments.} 13 | 14 | \item{i}{A numeric type value or a vector of them. The interest rate of the loan.} 15 | 16 | \item{i2}{A numeric type value. The interest rate of the saving account.} 17 | 18 | \item{alic}{A numeric type value. Interest tax rate.} 19 | 20 | \item{ins}{A numeric type value. The rate of V0 to be paid in each period.} 21 | 22 | \item{method}{A string. Amortization method used ("constant_installment","interest_only", "constant_principal", "interest_only_wsavings_account" or "constant_installment_varintrate" ).} 23 | } 24 | \value{ 25 | Returns a data.frame object containing Period, Payment, Pure Payment, Intrest, Amortization, Insurance, TAX and Outstanding debt. 26 | } 27 | \description{ 28 | Calculates the amortization schedule. 29 | } 30 | \examples{ 31 | Loan_amortization(1000,12,0.04,0,0.21,0.01,"constant_installment") 32 | Loan_amortization(12000,15,0.04,0,0.21,0.01,"interest_only") 33 | Loan_amortization(13000,10,0.04,0,0.21,0.01,"constant_principal") 34 | Loan_amortization(15000,20,0.04,0.05,0.21,0.01,"interest_only_wsavings_account") 35 | Loan_amortization(5000,5,0.04,0,0.21,0.01,"constant_installment_varintrate") 36 | 37 | 38 | } 39 | \keyword{Amortization} 40 | \keyword{Loan} 41 | -------------------------------------------------------------------------------- /man/A..Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/A..R 3 | \name{A.} 4 | \alias{A.} 5 | \title{Life Insurance} 6 | \usage{ 7 | A.(x, h, n, k = 1, i = 0.04, data, prop = 1, assumption = "none", cap = 1) 8 | } 9 | \arguments{ 10 | \item{x}{An integer. The age of the insuree.} 11 | 12 | \item{h}{An integer. The deferral period.} 13 | 14 | \item{n}{An integer. Number of years of coverage.} 15 | 16 | \item{k}{An integer. Number of fractions per year.} 17 | 18 | \item{i}{The interest rate. A numeric type value.} 19 | 20 | \item{data}{A data.frame of the mortality table, with the first column being the age and the second one the probability of death.} 21 | 22 | \item{prop}{A numeric value. It represents the proportion of the mortality table being used (between 0 and 1).} 23 | 24 | \item{assumption}{A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage).} 25 | 26 | \item{cap}{A numeric type value. The value of the payment.} 27 | } 28 | \value{ 29 | Returns a numeric value (actuarial present value). 30 | } 31 | \description{ 32 | Calculates the present value of the life insurance. 33 | } 34 | \examples{ 35 | A.(50,0,8,1,0.04,CSO80MANB,1,"none",1) 36 | A.(60,3,10,1,0.04,CSO80MANB,1,"none",1) 37 | A.(21,4,7,3,0.04,CSO80MANB,1,"constant",1) 38 | A.(23,4,6,12,0.04,CSO80MANB,1,"UDD",1) 39 | 40 | } 41 | \references{ 42 | Chapter 3 of Life Contingencies (1952) by Jordan, chapter 4 of Actuarial Mathematics (1997) by Bowers, Gerber, Hickman, Jones & Nesbitt. 43 | } 44 | \keyword{Insurance} 45 | \keyword{Life} 46 | -------------------------------------------------------------------------------- /man/a.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/a.R 3 | \name{a} 4 | \alias{a} 5 | \title{Life Annuities} 6 | \usage{ 7 | a(x, h, n, k = 1, i = 0.04, data, prop = 1, assumption = "none", cap = 1) 8 | } 9 | \arguments{ 10 | \item{x}{An integer. The age of the insuree.} 11 | 12 | \item{h}{An integer. The deferral period.} 13 | 14 | \item{n}{An integer. Number of years of coverage.} 15 | 16 | \item{k}{An integer. Number of payments per year.} 17 | 18 | \item{i}{The interest rate. A numeric type value.} 19 | 20 | \item{data}{A data.frame of the mortality table, with the first column being the age, and the second one the probability of death.} 21 | 22 | \item{prop}{A numeric value. It represents the proportion of the mortality table being used (between 0 and 1).} 23 | 24 | \item{assumption}{A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage).} 25 | 26 | \item{cap}{A numeric type value. The annualized value of the payment.} 27 | } 28 | \value{ 29 | Returns a numeric value (actuarial present value). 30 | } 31 | \description{ 32 | Calculates the present value of a life annuity. 33 | } 34 | \examples{ 35 | a(20,0,15,1,0.04,CSO58FALB,1,"none",1200) 36 | a(23,7,9,1,0.04,GAM71F,1,"none",5000) 37 | a(33,3,10,4,0.04,CSO80MANB,1,"constant",3000) 38 | a(20,5,10,4,0.04,CSO58MANB,1,"UDD",5000) 39 | 40 | } 41 | \references{ 42 | Chapter 2 of Life Contingencies (1952) by Jordan, chapter 5 of Actuarial Mathematics (1997) by Bowers, Gerber, Hickman, Jones & Nesbitt. 43 | } 44 | \keyword{Annuities} 45 | \keyword{Life} 46 | -------------------------------------------------------------------------------- /R/qfrac.R: -------------------------------------------------------------------------------- 1 | #' @title Fractional Probability of Death 2 | 3 | #' @description Calculates the fractional probability for a person of x+s/k dies before age x+(s+1)/k. 4 | #' @param x An integer. The age of the insuree. 5 | #' @param s An integer. Fraction of the year. 6 | #' @param k An integer. Number of fractions per year. 7 | #' @param i The interest rate. A numeric type value. 8 | #' @param data A data.frame containing the mortality table, with the first column being the age and the second one, the probability of death. 9 | #' @param prop A numeric value. It represents the proportion of the mortality table being used (between 0 and 1). 10 | #' @param assumption A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths and "constant" for constant force of mortality). 11 | #' @keywords Fractional probability of death 12 | #' @return The fractional probability of death. 13 | #' @export 14 | #' @examples 15 | #' qfrac(27,1,4,0.04,CSO80MANB,"constant",1) 16 | #' qfrac(20,0,12,0.04,CSO80MANB,"UDD",0.8) 17 | 18 | 19 | qfrac<-function(x,s,k,i,data,assumption,prop){ 20 | dig<-getOption("digits") 21 | on.exit(options(digits = dig)) 22 | options(digits = 15) 23 | if(assumption=="UDD"){ 24 | if(x==(nrow(data)-1)){ 25 | prop<-1 26 | } 27 | Q<-((1/k)*data[x+1,2]*prop)/(1-(s/k)*data[x+1,2]*prop) 28 | }else if(assumption=="constant"){ 29 | if(x==(nrow(data)-1)){ 30 | prop<-1 31 | } 32 | ik<-Rate_converter(i,"i",1,"i",k,"frac") 33 | p<-((1+i)^(s/k))*(1-(s/k)*(1-E(x,1,i,data,prop,"none",1))) 34 | q.<-((1+i)^(s/k))*((1/k)*(1-E(x,1,i,data,prop,"none",1))*((s+1)*ik+1)-ik) 35 | Q<-q./p 36 | } else{ 37 | stop("Check assumption") 38 | } 39 | return(as.numeric(Q)) 40 | } 41 | 42 | -------------------------------------------------------------------------------- /R/Table_Makeham.R: -------------------------------------------------------------------------------- 1 | #' @title Makeham's Law of Mortality Table Creator 2 | 3 | #' @description Creates a mortality table under Makeham's law. 4 | #' @param x0 A numeric type value. The initial age of the table. 5 | #' @param omega A numeric type value. The final age of the table. 6 | #' @param A A numeric type value. A parameter of the law. 7 | #' @param B A numeric type value. A parameter of the law. 8 | #' @param C A numeric type value. A parameter of the law. 9 | #' @return Returns a data.frame object containing age and death probabilities. 10 | #' @export 11 | #' @keywords Makeham's law table. 12 | #' @references Chapter 3 (p 77-78) of Actuarial Mathematics (1997) by Bowers, Gerber, Hickman, Jones & Nesbitt. 13 | #' @note The parameters are usually confined to the ranges shown below: 14 | #' 0.001 < A < 0.003, 10^(-6) < B < 10(-3), 1.08 < C < 1.12. 15 | #' @examples 16 | #' Table_Makeham(0,100,0.002,3*10^(-4),1.124) 17 | #' 18 | 19 | 20 | Table_Makeham<-function(x0,omega,A,B,C){ 21 | dig<-getOption("digits") 22 | on.exit(options(digits = dig)) 23 | options(digits = 15) 24 | if(x0>=0 && omega>=0 && A>(-B) && 01 && is_integer(x0)==1 && is_integer(omega)==1){ 25 | S<-exp(-A) 26 | G<-exp(-B/(log(C))) 27 | if(x0>=omega){ 28 | stop("Check Omega") 29 | } else{ 30 | X<-seq(0,omega-1) 31 | Q<-rep(NA,omega) 32 | Tabla.Makeham<-cbind(X,Q) 33 | for(i in x0:(omega-1)){ 34 | P<-S*G^(C^(i)*(C-1)) 35 | q<-1-P 36 | Tabla.Makeham[i+1,2]<-q 37 | } 38 | Tabla.Makeham[omega,2]<-1 39 | colnames(Tabla.Makeham)<-c("x","q") 40 | Tabla.Makeham<-as.data.frame(Tabla.Makeham) 41 | return(Tabla.Makeham) 42 | } 43 | } else { 44 | stop("Check values") 45 | } 46 | } 47 | 48 | -------------------------------------------------------------------------------- /man/Am..Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Am..R 3 | \name{Am.} 4 | \alias{Am.} 5 | \title{Life Insurance of a group} 6 | \usage{ 7 | Am.( 8 | x, 9 | h, 10 | n, 11 | k = 1, 12 | i = 0.04, 13 | data, 14 | prop = 1, 15 | ndeath = 1, 16 | assumption = "none", 17 | cap = 1 18 | ) 19 | } 20 | \arguments{ 21 | \item{x}{A vector of intergers representing the age of each individual of the group.} 22 | 23 | \item{h}{An integer. The deferral period.} 24 | 25 | \item{n}{An integer. Number of years of coverage.} 26 | 27 | \item{k}{An integer. Number of fractions per year.} 28 | 29 | \item{i}{The interest rate. A numeric type value.} 30 | 31 | \item{data}{A data.frame of the mortality table, with the first column being the age and the second one the probability of death.} 32 | 33 | \item{prop}{A numeric value. It represents the proportion of the mortality table being used (between 0 and 1).} 34 | 35 | \item{ndeath}{An integer. Number of deaths necessary for payment to occur.} 36 | 37 | \item{assumption}{A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage).} 38 | 39 | \item{cap}{A numeric type value. The value of the payment.} 40 | } 41 | \value{ 42 | Returns a numeric value (actuarial present value). 43 | } 44 | \description{ 45 | Calculates the present value of a life insurance coverage for a group. 46 | } 47 | \examples{ 48 | ages<-c(22,33,44,55,66) 49 | Am.(ages,5,15,1,0.04,CSO80MANB,1,2,"none",1) 50 | Am.(ages,0,20,4,0.04,CSO80MANB,1,2,"UDD",1) 51 | Am.(ages,10,25,2,0.04,CSO80MANB,1,2,"constant",1) 52 | 53 | } 54 | \keyword{Group} 55 | \keyword{Insurance} 56 | \keyword{Life} 57 | -------------------------------------------------------------------------------- /man/PremiumFrac.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/PremiumFrac.R 3 | \name{PremiumFrac} 4 | \alias{PremiumFrac} 5 | \title{Fractional Premium} 6 | \usage{ 7 | PremiumFrac(px1, x, m, k, i = 0.04, data, prop = 1, effect = "yes", assumption) 8 | } 9 | \arguments{ 10 | \item{px1}{A numeric type value. The value of the single net premium.} 11 | 12 | \item{x}{An integer. The age of the insuree.} 13 | 14 | \item{m}{An integer. Years of premium payment.} 15 | 16 | \item{k}{An integer. Number of premiums per year.} 17 | 18 | \item{i}{The interest rate. A numeric type value.} 19 | 20 | \item{data}{A data.frame of the mortality table, with the first column being the age and the second one the probability of death.} 21 | 22 | \item{prop}{A numeric value. It represents the proportion of the mortality table used (between 0 and 1).} 23 | 24 | \item{effect}{A character string. This parameter indicates if, in the event of death, the insuree is released from paying the remaining fractional premiums of that year ("yes" or "no")} 25 | 26 | \item{assumption}{A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths and "constant" for constant force of mortality).} 27 | } 28 | \value{ 29 | Returns the annualized value of the fractional premium. 30 | } 31 | \description{ 32 | Calculates the annualized value of the fractional premiums. 33 | } 34 | \note{ 35 | If k=1, regardless of the "effect", the returned value is the annual premium. 36 | } 37 | \examples{ 38 | PremiumFrac(1000,20,10,2,0.04,CSO80MANB,1,"yes","constant") 39 | PremiumFrac(1000,20,10,2,0.04,CSO80MANB,1,"no","UDD") 40 | 41 | } 42 | \references{ 43 | Chapter 4 of Actuarial Mathematics for Life Contingent Risks (2009) by Dickson, Hardy and Waters 44 | } 45 | \keyword{Fractional} 46 | \keyword{Premium} 47 | -------------------------------------------------------------------------------- /man/aD.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/aD.R 3 | \name{aD} 4 | \alias{aD} 5 | \title{Decreasing Life Annuities} 6 | \usage{ 7 | aD( 8 | x, 9 | h, 10 | n, 11 | k = 1, 12 | i = 0.04, 13 | data, 14 | prop = 1, 15 | assumption = "none", 16 | variation = "none", 17 | cap = 1 18 | ) 19 | } 20 | \arguments{ 21 | \item{x}{An integer. The age of the insuree.} 22 | 23 | \item{h}{An integer. The deferral period.} 24 | 25 | \item{n}{An integer. Number of years of coverage.} 26 | 27 | \item{k}{An integer. Number of payments per year.} 28 | 29 | \item{i}{The interest rate. A numeric type value.} 30 | 31 | \item{data}{A data.frame of the mortality table, with the first column being the age and the second one the probability of death.} 32 | 33 | \item{prop}{A numeric value. It represents the proportion of the mortality table being used (between 0 and 1).} 34 | 35 | \item{assumption}{A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage).} 36 | 37 | \item{variation}{A character string. "inter" if the variation it's interannual or "intra" if it's intra-annual.} 38 | 39 | \item{cap}{A numeric type value. The annualized value of the first payment.} 40 | } 41 | \value{ 42 | Returns a numeric value (actuarial present value). 43 | } 44 | \description{ 45 | Calculates the present value of a decreasing life annuity. 46 | } 47 | \examples{ 48 | aD(27,0,3,1,0.04,CSO80MANB,1,"none","none",1) 49 | aD(32,2,8,1,0.04,CSO80MANB,1,"none","none",1) 50 | aD(35,8,15,4,0.04,CSO80MANB,1,"constant","inter",1) 51 | aD(21,2,5,4,0.04,CSO80MANB,1,"UDD","inter",1) 52 | aD(54,4,16,2,0.04,CSO80MANB,1,"constant","intra",1) 53 | aD(20,10,15,3,0.04,CSO80MANB,1,"UDD","intra",1) 54 | 55 | } 56 | \references{ 57 | Chapter 2 of Life Contingencies (1952) by Jordan, chapter 5 of Actuarial Mathematics (1997) by Bowers, Gerber, Hickman, Jones & Nesbitt. 58 | } 59 | \keyword{Annuities} 60 | \keyword{Decreasing} 61 | \keyword{Life} 62 | -------------------------------------------------------------------------------- /R/ACont..R: -------------------------------------------------------------------------------- 1 | #' @title Continuous Life Insurance 2 | 3 | #' @description Calculates the present value of a continuous life insurance. 4 | #' @param x An integer. The age of the insuree. 5 | #' @param h An integer. The deferral period. 6 | #' @param n An integer. Number of years of coverage. 7 | #' @param i The interest rate. A numeric type value. 8 | #' @param data A data.frame of the mortality table, with the first column being the age and the second one the probability of death. 9 | #' @param prop A numeric value. It represents the proportion of the mortality table being used (between 0 and 1). 10 | #' @param assumption A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths and "constant" for constant force of mortality). 11 | #' @param cap A numeric type value. The value of the payment. 12 | #' @export 13 | #' @keywords Continuous Life Insurance 14 | #' @return Returns a numeric (actuarial present value). 15 | #' @references Chapter 3 of Life Contingencies (1952) by Jordan, chapter 4 of Actuarial Mathematics (1997) by Bowers, Gerber, Hickman, Jones & Nesbitt. 16 | #' @examples 17 | #' ACont.(24,2,10,0.04,CSO80MANB,1,"UDD",1) 18 | #' ACont.(24,2,10,0.04,CSO80MANB,1,"constant",1) 19 | #' 20 | ACont.<-function(x,h,n,i=0.04,data,prop=1,assumption="UDD",cap=1){ 21 | dig<-getOption("digits") 22 | on.exit(options(digits = dig)) 23 | options(digits = 15) 24 | if(x>=0 && is_integer(x)==1 && h>=0 && is_integer(h)==1 && n>=0 && is_integer(n)==1 && i>=0 && prop>0){ 25 | if(n==0){ 26 | Axhnc<-0 27 | return(Axhnc) 28 | }else{ 29 | delta<-log(1+i) 30 | if(assumption=="constant"){ 31 | Axhnc<-E(x,h,i,data,prop)-E(x,h+n,i,data,prop,"none",1)-delta*aCont(x,h,n,i,data,prop,"constant",1) 32 | }else if(assumption=="UDD"){ 33 | Axhnc<-(i/delta)*A.(x,h,n,1,i,data,prop,"none",1) 34 | }else{ 35 | stop("Check assumption") 36 | } 37 | } 38 | Axhnc<-as.numeric(Axhnc) 39 | px1<-Axhnc*cap 40 | return(px1) 41 | }else{ 42 | stop("Check Values") 43 | } 44 | } 45 | 46 | 47 | -------------------------------------------------------------------------------- /man/AD..Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/AD..R 3 | \name{AD.} 4 | \alias{AD.} 5 | \title{Decreasing Life Insurance} 6 | \usage{ 7 | AD.( 8 | x, 9 | h, 10 | n, 11 | k = 1, 12 | i = 0.04, 13 | data, 14 | prop = 1, 15 | assumption = "none", 16 | variation = "none", 17 | cap = 1 18 | ) 19 | } 20 | \arguments{ 21 | \item{x}{An integer. The age of the insuree.} 22 | 23 | \item{h}{An integer. The deferral period.} 24 | 25 | \item{n}{An integer. Number of years of coverage.} 26 | 27 | \item{k}{An integer. Fractions per year.} 28 | 29 | \item{i}{The interest rate. A numeric type value.} 30 | 31 | \item{data}{A data.frame of the mortality table, with the first column being the age and the second one the probability of death.} 32 | 33 | \item{prop}{A numeric value. It represents the proportion of the mortality table being used (between 0 and 1).} 34 | 35 | \item{assumption}{A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage).} 36 | 37 | \item{variation}{A character string. "inter" if the variation it's interannual or "intra" if it's intra-annual.} 38 | 39 | \item{cap}{A numeric type value. Amount insured for the first year/period.} 40 | } 41 | \value{ 42 | Returns a numeric value (actuarial present value). 43 | } 44 | \description{ 45 | Calculates the present value of a decreasing life insurance. 46 | } 47 | \examples{ 48 | AD.(56,0,8,1,0.04,CSO80MANB,1,"none","none",1) 49 | AD.(39,1,10,1,0.04,CSO80MANB,1,"none","none",1) 50 | AD.(37,6,11,4,0.04,CSO80MANB,1,"constant","inter",1) 51 | AD.(21,2,5,4,0.04,CSO80MANB,1,"UDD","inter",1) 52 | AD.(54,4,16,2,0.04,CSO80MANB,1,"constant","intra",1) 53 | AD.(20,10,15,3,0.04,CSO80MANB,1,"UDD","intra",1) 54 | 55 | } 56 | \references{ 57 | Chapter 3 of Life Contingencies (1952) by Jordan, chapter 4 of Actuarial Mathematics (1997) by Bowers, Gerber, Hickman, Jones & Nesbitt. 58 | } 59 | \keyword{Decreasing} 60 | \keyword{Insurance} 61 | \keyword{Life} 62 | -------------------------------------------------------------------------------- /R/Fractional_table.R: -------------------------------------------------------------------------------- 1 | #' @title Fractional table of mortality 2 | 3 | #' @description Creates a fractional mortality table for a given mortality table. 4 | #' @param data A data.frame of the annual mortality table, with the first column being the age and the second one the probability of death. 5 | #' @param frac An integer. The number of fractions per year. 6 | #' @param i A numeric type value. The interest rate. 7 | #' @param assumption A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths and "constant" for constant force of mortality). 8 | #' @return Returns a data.frame object containing fractional age and death probability vectors. 9 | #' @export 10 | #' @keywords Fractional Table of Mortality. 11 | #' @references Chapter 3 of Actuarial Mathematics (1997) by Bowers, Gerber, Hickman, Jones & Nesbitt 12 | #' @examples 13 | #' Fractional_table(CSO80MANB,2,0.04,"constant") 14 | #' Fractional_table(CSO80MANB,2,0.04,"UDD") 15 | #' 16 | Fractional_table <-function(data,frac,i=0.04,assumption="UDD"){ 17 | dig<-getOption("digits") 18 | on.exit(options(digits = dig)) 19 | options(digits = 15) 20 | X<-c() 21 | Q<-c() 22 | if(assumption=="UDD" & frac>0 & is_integer(frac)==1){ 23 | for(x in 1:nrow(data)){ 24 | for(k in 0:(frac-1)){ 25 | q<-((1/frac)*data[x,2])/(1-(k/frac)*data[x,2]) 26 | age<-x+(k/frac)-1 27 | X<-c(X,age) 28 | Q<-c(Q,q) 29 | } 30 | } 31 | } else if(assumption=="constant" & frac>0 & is_integer(frac)==1 & i>0){ 32 | for(x in 1:nrow(data)){ 33 | for(k in 0:(frac-1)){ 34 | ik<-Rate_converter(i,"i",1,"i",frac,"frac") 35 | p<-((1+i)^(k/frac))*(1-(k/frac)*(1-E(x-1,1,i,data,1,"none",1))) 36 | q<-((1+i)^(k/frac))*((1/frac)*(1-E(x-1,1,i,data,1,"none",1))*((k+1)*ik+1)-ik) 37 | q.<-q/p 38 | age<-x+(k/frac)-1 39 | X<-c(X,age) 40 | Q<-c(Q,q.) 41 | } 42 | } 43 | } else{ 44 | stop("Check assumption, frac and i") 45 | } 46 | rown<-seq(1,nrow(data)*frac) 47 | Table.Frac<-as.data.frame(cbind(X,Q)) 48 | rownames(Table.Frac)<-rown 49 | return(Table.Frac) 50 | } 51 | -------------------------------------------------------------------------------- /man/am.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/am.R 3 | \name{am} 4 | \alias{am} 5 | \title{Life Annuities for a group} 6 | \usage{ 7 | am( 8 | x, 9 | h, 10 | n, 11 | k = 1, 12 | i = 0.04, 13 | data, 14 | prop = 1, 15 | type = "joint", 16 | quant = 1, 17 | assumption = "none", 18 | cap = 1 19 | ) 20 | } 21 | \arguments{ 22 | \item{x}{A vector of intergers representing the age of each individual of the group.} 23 | 24 | \item{h}{An integer. The deferral period.} 25 | 26 | \item{n}{An integer. Number of years of coverage.} 27 | 28 | \item{k}{An integer. Number of payments per year.} 29 | 30 | \item{i}{The interest rate. A numeric type value.} 31 | 32 | \item{data}{A data.frame of the mortality table, with the first column being the age, and the second one the probability of death.} 33 | 34 | \item{prop}{A numeric value. It represents the proportion of the mortality table being used (between 0 and 1).} 35 | 36 | \item{type}{A character string. Conditions to be met in order to access the benefit of the annuity ("joint", "exactly" or "atleast").} 37 | 38 | \item{quant}{An integer. Required only if type is not "joint". If type is "exactly" it represents the exact amount of survivors required for the endowment to be payed. If type is "atleast", it represents the minimum number of survivors required.} 39 | 40 | \item{assumption}{A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage).} 41 | 42 | \item{cap}{A numeric type value. The annualized value of the payment.} 43 | } 44 | \value{ 45 | Returns a numeric value (actuarial present value). 46 | } 47 | \description{ 48 | Calculates the present value of a life annuity for a group. 49 | } 50 | \examples{ 51 | ages<-c(23,34,21) 52 | ages<-c(23,34,21) 53 | am(ages,5,10,2,0.05,CSO80MALB,1,"joint",assumption="UDD") 54 | am(ages,0,20,1,0.06,CSO80FALBsmoker,1,"atleast",1) 55 | am(ages,2,15,2,0.07,CSO80FANBsmoker,0.8,"exactly",2,"constant") 56 | 57 | } 58 | \keyword{Annuities} 59 | \keyword{Group} 60 | \keyword{Life} 61 | -------------------------------------------------------------------------------- /man/V_Payment_Protection.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/V_Payment_Protection.R 3 | \name{V_Payment_Protection} 4 | \alias{V_Payment_Protection} 5 | \title{Reserve valuation for Payment Protection} 6 | \usage{ 7 | V_Payment_Protection( 8 | px, 9 | x, 10 | n, 11 | k = 1, 12 | cantprem = 1, 13 | premperyear = 1, 14 | i = 0.04, 15 | ip = 0.04, 16 | data, 17 | prop = 1, 18 | type = "outstanding_debt", 19 | method = "interest_only", 20 | V0, 21 | t 22 | ) 23 | } 24 | \arguments{ 25 | \item{px}{A numeric value. The value of the premium paid in each period.} 26 | 27 | \item{x}{An integer. The age of the insuree.} 28 | 29 | \item{n}{An integer. Loan term (in years).} 30 | 31 | \item{k}{An integer. Number of payments per year.} 32 | 33 | \item{cantprem}{An integer. The total number of premiums.} 34 | 35 | \item{premperyear}{An integer. The number of premiums to be paid per year.} 36 | 37 | \item{i}{The interest rate. A numeric type value.} 38 | 39 | \item{ip}{The interest rate of the loan. A numeric type value.} 40 | 41 | \item{data}{A data.frame of the mortality table, with the first column being the age and the second one the probability of death.} 42 | 43 | \item{prop}{A numeric value. It represents the proportion of the mortality table used (between 0 and 1).} 44 | 45 | \item{type}{A character string. The type of loan protection/reimburstment ("outstanding_debt" or "payments").} 46 | 47 | \item{method}{A character string. Amortization scheme ("constant_instalment", "interest_only" or "constant_principal").} 48 | 49 | \item{V0}{A numeric type value. Loan value.} 50 | 51 | \item{t}{An integer. The moment of valuation (in months if it is a fractional coverage or in years if it is not).} 52 | } 53 | \value{ 54 | Returns the actuarial present value of the loan protection. 55 | } 56 | \description{ 57 | Calculates the reserve for the loan insurance up to the moment t. 58 | } 59 | \examples{ 60 | px1<-31.6216618772779 61 | c1<-10500 62 | V_Payment_Protection(px1,30,25,1,10,1,0.06,0.07,CSO80FANB,1,"payments","constant_instalment",c1,25) 63 | 64 | } 65 | \keyword{Payment} 66 | \keyword{Protection} 67 | -------------------------------------------------------------------------------- /R/aCont.R: -------------------------------------------------------------------------------- 1 | #' @title Continuous Life Annuities 2 | 3 | #' @description Calculates the present value of a continuous life annuity. 4 | #' @param x An integer. The age of the insuree. 5 | #' @param h An integer. The deferral period. 6 | #' @param n An integer. Number of years of coverage. 7 | #' @param i The interest rate. A numeric type value. 8 | #' @param data A data.frame of the mortality table, with the first column being the age and the second one the probability of death. 9 | #' @param prop A numeric value. It represents the proportion of the mortality table being used (between 0 and 1). 10 | #' @param assumption A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths and "constant" for constant force of mortality). 11 | #' @param cap A numeric type value. The value of the payment. 12 | #' @export 13 | #' @keywords Continuous Life Annuities 14 | #' @return Returns a numeric value (the actuarial present value). 15 | #' @references Chapter 2 of Life Contingencies (1952) by Jordan, chapter 5 of Actuarial Mathematics (1997) by Bowers, Gerber, Hickman, Jones & Nesbitt. 16 | #' @examples 17 | #' aCont(35,7,10,0.04,CSO80MANB,1,"constant",1) 18 | #' aCont(23,5,12,0.04,CSO80MANB,1,"UDD",1) 19 | #' 20 | 21 | 22 | aCont<-function(x,h,n,i=0.04,data,prop=1,assumption="constant",cap=1){ 23 | dig<-getOption("digits") 24 | on.exit(options(digits = dig)) 25 | options(digits = 15) 26 | if(x>=0 && is_integer(x)==1 && h>=0 && is_integer(h)==1 && n>=0 && is_integer(n)==1 && i>=0 && prop>0 && cap>0){ 27 | if(n==0){ 28 | axhnc<-0 29 | return(axhnc) 30 | }else{ 31 | if(assumption=="constant"){ 32 | axhnc<-(a(x,h,n,1,i,data,prop,"none",1)/2)+(a(x,h+1,n,1,i,data,prop,"none",1)/2) 33 | return(as.numeric(axhnc)) 34 | }else if(assumption=="UDD"){ 35 | delta<-log(1+i) 36 | axhnc<-(E(x,h,i,data,prop,"none",1)-E(x,h+n,i,data,prop,"none",1)-ACont.(x,h,n,i,data,prop,"UDD",1))/delta 37 | }else{ 38 | stop("Check assumption") 39 | } 40 | } 41 | axhnc<-as.numeric(axhnc) 42 | px1<-axhnc*cap 43 | return(px1) 44 | }else{ 45 | stop("Check Values") 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /man/V_E.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/V_E.R 3 | \name{V_E} 4 | \alias{V_E} 5 | \title{Reserve Valuation for Pure Endowments} 6 | \usage{ 7 | V_E( 8 | px, 9 | x, 10 | n, 11 | cantprem = 1, 12 | premperyear = 1, 13 | i = 0.04, 14 | data, 15 | prop = 1, 16 | assumption = "none", 17 | cap, 18 | t 19 | ) 20 | } 21 | \arguments{ 22 | \item{px}{A numeric value. The value of the premium paid in each period.} 23 | 24 | \item{x}{An integer. The age of the insuree.} 25 | 26 | \item{n}{The term of the endowment. An integer, for annual coverage, or a numeric for fractional coverage.} 27 | 28 | \item{cantprem}{An integer. The total number of premiums.} 29 | 30 | \item{premperyear}{An integer. The number of premiums to be paid per year.} 31 | 32 | \item{i}{The interest rate. A numeric type value.} 33 | 34 | \item{data}{A data.frame containing the mortality table, with the first column being the age and the second one, the probability of death.} 35 | 36 | \item{prop}{A numeric value. It represents the proportion of the mortality table used (between 0 and 1).} 37 | 38 | \item{assumption}{A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage).} 39 | 40 | \item{cap}{A numeric type value. The payment.} 41 | 42 | \item{t}{An integer. The moment of valuation (in months if it is a fractional coverage or in years if it is not).} 43 | } 44 | \value{ 45 | A data frame with Premium, Risk, 1/E and reserve values up to the moment t. 46 | } 47 | \description{ 48 | Calculates the reserve for the Pure endowments up to the moment t. 49 | } 50 | \examples{ 51 | V_E(663.501989747591,20,10,1,1,0.04,CSO80MANB,1,"none",1000,10) 52 | V_E(9383.64446819386/12,20,2,12,12,0.04,CSO80MANB,1,"constant",10000,24) 53 | V_E(9383.64446819386/12,20,2,12,12,0.04,CSO80MANB,1,"constant",10000,24) 54 | 55 | } 56 | \references{ 57 | Chapter 5 of Life Contingencies (1952) by Jordan, Chapter 11 of Actuarial Mathematics for Life Contingent Risks (2009) by Dickson, Hardy and Waters. 58 | } 59 | \keyword{Endowments} 60 | \keyword{Pure} 61 | \keyword{Reserve} 62 | -------------------------------------------------------------------------------- /man/avg.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/avg.R 3 | \name{avg} 4 | \alias{avg} 5 | \title{Varying Life Annuities: Geometric Progression} 6 | \usage{ 7 | avg( 8 | x, 9 | h, 10 | n, 11 | k = 1, 12 | r, 13 | i = 0.04, 14 | data, 15 | prop = 1, 16 | assumption = "none", 17 | variation = "none", 18 | cap = 1 19 | ) 20 | } 21 | \arguments{ 22 | \item{x}{An integer. The age of the insuree.} 23 | 24 | \item{h}{An integer. The deferral period.} 25 | 26 | \item{n}{An integer. Number of years of coverage.} 27 | 28 | \item{k}{An integer. Number of payments per year.} 29 | 30 | \item{r}{The variation rate. A numeric type value.} 31 | 32 | \item{i}{The interest rate. A numeric type value.} 33 | 34 | \item{data}{A data.frame of the mortality table, with the first column being the age and the second one the probability of death.} 35 | 36 | \item{prop}{A numeric value. It represents the proportion of the mortality table being used (between 0 and 1).} 37 | 38 | \item{assumption}{A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage).} 39 | 40 | \item{variation}{A character string. "inter" if the variation it's interannual or "intra" if it's intra-annual.} 41 | 42 | \item{cap}{A numeric type value. The annualized value of the first payment.} 43 | } 44 | \value{ 45 | Returns a numeric value (actuarial present value). 46 | } 47 | \description{ 48 | Calculates the present value of a varying life annuity according to a geometric progression. 49 | } 50 | \examples{ 51 | avg(33,0,5,1,0.8,0.04,CSO80MANB,1,"none","none",1) 52 | avg(26,2,4,1,0.4,0.04,CSO80MANB,1,"none","none",1) 53 | avg(20,2,2,2,0.15,0.04,CSO80MANB,1,"constant","inter",1) 54 | avg(40,5,5,3,0.07,0.04,CSO80MANB,1,"constant","intra",1) 55 | avg(27,0,15,4,0.06,0.04,CSO80MANB,1,"UDD","inter",1) 56 | avg(34,7,12,6,0.03,0.04,CSO80MANB,1,"UDD","intra",1) 57 | 58 | } 59 | \references{ 60 | Chapter 5 of Actuarial Mathematics for Life Contingent Risks (2009) by Dickson, Hardy and Waters. 61 | } 62 | \keyword{Annuities} 63 | \keyword{Geometric} 64 | \keyword{Life} 65 | \keyword{Progression} 66 | -------------------------------------------------------------------------------- /man/Avg..Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Avg..R 3 | \name{Avg.} 4 | \alias{Avg.} 5 | \title{Varying Life Insurance: Geometric Progression} 6 | \usage{ 7 | Avg.( 8 | x, 9 | h, 10 | n, 11 | k = 1, 12 | r, 13 | i = 0.04, 14 | data, 15 | prop = 1, 16 | assumption = "none", 17 | variation = "none", 18 | cap = 1 19 | ) 20 | } 21 | \arguments{ 22 | \item{x}{An integer. The age of the insuree.} 23 | 24 | \item{h}{An integer. The deferral period.} 25 | 26 | \item{n}{An integer. Number of years of coverage.} 27 | 28 | \item{k}{An integer. Fractions per year.} 29 | 30 | \item{r}{The variation rate. A numeric type value.} 31 | 32 | \item{i}{The interest rate. A numeric type value.} 33 | 34 | \item{data}{A data.frame of the mortality table, with the first column being the age and the second one the probability of death.} 35 | 36 | \item{prop}{A numeric value. It represents the proportion of the mortality table being used (between 0 and 1).} 37 | 38 | \item{assumption}{A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage).} 39 | 40 | \item{variation}{A character string. "inter" if the variation it's interannual or "intra" if it's intra-annual.} 41 | 42 | \item{cap}{A numeric type value. Amount insured for the first year/period.} 43 | } 44 | \value{ 45 | Returns a numeric value (actuarial present value). 46 | } 47 | \description{ 48 | Calculates the present value of a varying life insurance according to a geometric progression. 49 | } 50 | \examples{ 51 | Avg.(33,0,5,1,0.8,0.04,CSO80MANB,1,"none","none",1) 52 | Avg.(26,2,4,1,0.4,0.04,CSO80MANB,1,"none","none",1) 53 | Avg.(25,0,15,2,0.25,0.04,CSO80MANB,1,"constant","inter",1) 54 | Avg.(37,10,10,4,0.05,0.04,CSO80MANB,1,"constant","intra",1) 55 | Avg.(40,5,20,6,0.04,0.04,CSO80MANB,1,"UDD","inter",1) 56 | Avg.(20,0,80,12,0.01,0.04,CSO80MANB,1,"UDD","intra",1) 57 | 58 | } 59 | \references{ 60 | Chapter 4 of Actuarial Mathematics for Life Contingent Risks (2009) by Dickson, Hardy and Waters. 61 | } 62 | \keyword{Geometric} 63 | \keyword{Insurance} 64 | \keyword{Life} 65 | \keyword{Progression} 66 | -------------------------------------------------------------------------------- /man/av.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/av.R 3 | \name{av} 4 | \alias{av} 5 | \title{Varying Life Annuities: Arithmetic Progression} 6 | \usage{ 7 | av( 8 | x, 9 | h, 10 | n, 11 | k = 1, 12 | r = 1, 13 | i = 0.04, 14 | data, 15 | prop = 1, 16 | assumption = "none", 17 | variation = "none", 18 | cap = 1 19 | ) 20 | } 21 | \arguments{ 22 | \item{x}{An integer. The age on the insuree.} 23 | 24 | \item{h}{An integer. The deferral period.} 25 | 26 | \item{n}{An integer. Number of years of coverage.} 27 | 28 | \item{k}{An integer. Number of payments per year.} 29 | 30 | \item{r}{The variation rate. A numeric type value.} 31 | 32 | \item{i}{The interest rate. A numeric type value.} 33 | 34 | \item{data}{A data.frame of the mortality table, with the first column being the age and the second one the probability of death.} 35 | 36 | \item{prop}{A numeric value. It represents the proportion of the mortality table being used (between 0 and 1).} 37 | 38 | \item{assumption}{A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage).} 39 | 40 | \item{variation}{A character string. "inter" if the variation it's interannual or "intra" if it's intra-annual.} 41 | 42 | \item{cap}{A numeric type value. The annualized value of the first payment.} 43 | } 44 | \value{ 45 | Returns a numeric value (actuarial present value). 46 | } 47 | \description{ 48 | Calculates the present value of a varying life annuity according to a arithmetic progression. 49 | } 50 | \note{ 51 | For an increasing life annuity coverage, 'r' must be 1. 52 | } 53 | \examples{ 54 | av(33,0,5,1,0.8,0.04,CSO80MANB,1,"none","none",1) 55 | av(26,2,4,1,0.4,0.04,CSO80MANB,1,"none","none",1) 56 | av(26,1,5,4,0.5,0.04,CSO80MANB,1,"constant","inter",1) 57 | av(24,1,3,3,0.7,0.04,CSO80MANB,1,"constant","intra",1) 58 | av(35,4,6,6,0.4,0.04,CSO80MANB,1,"UDD","inter",1) 59 | av(40,3,7,2,0.7,0.04,CSO80MANB,1,"UDD","intra",1) 60 | 61 | } 62 | \references{ 63 | Chapter 5 of Actuarial Mathematics for Life Contingent Risks (2009) by Dickson, Hardy and Waters. 64 | } 65 | \keyword{Annuities} 66 | \keyword{Arithmetic} 67 | \keyword{Life} 68 | \keyword{Progression} 69 | -------------------------------------------------------------------------------- /man/Av..Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Av..R 3 | \name{Av.} 4 | \alias{Av.} 5 | \title{Varying Life Insurance: Arithmetic Progression} 6 | \usage{ 7 | Av.( 8 | x, 9 | h, 10 | n, 11 | k = 1, 12 | r = 1, 13 | i = 0.04, 14 | data, 15 | prop = 1, 16 | assumption = "none", 17 | variation = "none", 18 | cap = 1 19 | ) 20 | } 21 | \arguments{ 22 | \item{x}{An integer. The age of the insuree.} 23 | 24 | \item{h}{An integer. The deferral period.} 25 | 26 | \item{n}{An integer. Number of years of coverage.} 27 | 28 | \item{k}{An integer. Fractions per year.} 29 | 30 | \item{r}{The variation rate. A numeric type value.} 31 | 32 | \item{i}{The interest rate. A numeric type value.} 33 | 34 | \item{data}{A data.frame of the mortality table, with the first column being the age and the second one the probability of death.} 35 | 36 | \item{prop}{A numeric value. It represents the proportion of the mortality table being used (between 0 and 1).} 37 | 38 | \item{assumption}{A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage).} 39 | 40 | \item{variation}{A character string. "inter" if the variation it's interannual or "intra" if it's intra-annual.} 41 | 42 | \item{cap}{A numeric type value. Amount insured for the first year/period.} 43 | } 44 | \value{ 45 | Returns a numeric value (actuarial present value). 46 | } 47 | \description{ 48 | Calculates the present value of a varying life insurance according to a arithmetic progression. 49 | } 50 | \note{ 51 | For an increasing life insurance coverage, 'r' must be 1. 52 | } 53 | \examples{ 54 | Av.(43,0,4,1,0.7,0.04,CSO80MANB,1,"none","none",1) 55 | Av.(37,1,6,1,0.3,0.04,CSO80MANB,1,"none","none",1) 56 | Av.(25,2,3,2,0.6,0.04,CSO80MANB,1,"constant","inter",1) 57 | Av.(37,3,6,4,0.5,0.04,CSO80MANB,1,"constant","intra",1) 58 | Av.(40,3,5,2,0.4,0.04,CSO80MANB,1,"UDD","inter",1) 59 | Av.(50,2,4,4,0.6,0.04,CSO80MANB,1,"UDD","intra",1) 60 | 61 | } 62 | \references{ 63 | Chapter 4 of Actuarial Mathematics for Life Contingent Risks (2009) by Dickson, Hardy and Waters. 64 | } 65 | \keyword{Arithmetic} 66 | \keyword{Insurance} 67 | \keyword{Life} 68 | \keyword{Progression} 69 | -------------------------------------------------------------------------------- /man/Em.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Em.R 3 | \name{Em} 4 | \alias{Em} 5 | \title{Group Pure Endowment} 6 | \usage{ 7 | Em( 8 | x, 9 | n, 10 | i = 0.04, 11 | data, 12 | prop = 1, 13 | type = "joint", 14 | quant = 1, 15 | assumption = "none", 16 | cap = 1 17 | ) 18 | } 19 | \arguments{ 20 | \item{x}{A vector of integers. The age of the insurees.} 21 | 22 | \item{n}{The term of the endowment. An integer, for annual coverage, or a numeric for fractional coverage.} 23 | 24 | \item{i}{The interest rate. A numeric type value.} 25 | 26 | \item{data}{A data.frame containing the mortality table, with the first column being the age and the second one, the probability of death.} 27 | 28 | \item{prop}{A numeric value. It represents the proportion of the mortality table being used (between 0 and 1).} 29 | 30 | \item{type}{A character string. Conditions to be met in order to access the benefit of the endowment ("joint", "exactly" or "atleast").} 31 | 32 | \item{quant}{An integer. Required only if type is not "joint". If type is "exactly" it represents the exact amount of survivors required for the endowment to be payed. If type is "atleast", it represents the minimum number of survivors required.} 33 | 34 | \item{assumption}{A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage).} 35 | 36 | \item{cap}{A numeric type value. The payment.} 37 | } 38 | \description{ 39 | Calculates the Pure endowments for a group of insurees. 40 | } 41 | \examples{ 42 | ages<-c(23,33,33) 43 | Em(ages,15,0.04,CSO80MANB,1,"joint") 44 | Em(ages,20.5,0.04,CSO80MANB,1,"joint",assumption = "constant",cap= 1) 45 | Em(ages,10.5,0.04,CSO80MANB,1,"joint",assumption = "UDD", cap=1) 46 | ages<-c(20,23,24,25) 47 | Em(ages,15,0.04,CSO80MANB,1,"exactly",1,"none",1) 48 | Em(ages,24.2,0.04,CSO80MANB,1,"exactly",2,"constant",1) 49 | Em(ages,8.2,0.04,CSO80MANB,1,"exactly",3,"UDD",1) 50 | 51 | ages<-c(40,42,56,57,58,59) 52 | Em(ages,15,0.04,CSO80MANB,1,"atleast",1,"none",1) 53 | Em(ages,25.5,0.04,CSO80MANB,1,"atleast",4,"constant",1) 54 | Em(ages,15.3,0.04,CSO80MANB,1,"atleast",3,"UDD",1) 55 | 56 | 57 | } 58 | \keyword{Endowment} 59 | \keyword{Pure} 60 | -------------------------------------------------------------------------------- /man/V_A..Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/V_A..R 3 | \name{V_A.} 4 | \alias{V_A.} 5 | \title{Reserve for Life Insurance} 6 | \usage{ 7 | V_A.( 8 | px, 9 | x, 10 | h, 11 | n, 12 | k = 1, 13 | cantprem = 1, 14 | premperyear = 1, 15 | i = 0.04, 16 | data, 17 | prop = 1, 18 | assumption = "none", 19 | cap, 20 | t 21 | ) 22 | } 23 | \arguments{ 24 | \item{px}{A numeric value. The value of the premium paid in each period.} 25 | 26 | \item{x}{An integer. The age of the insuree.} 27 | 28 | \item{h}{An integer. The deferral period.} 29 | 30 | \item{n}{An integer. Number of years of coverage.} 31 | 32 | \item{k}{An integer. Number of fractions per year.} 33 | 34 | \item{cantprem}{An integer. The total number of premiums.} 35 | 36 | \item{premperyear}{An integer. The number of premiums to be paid per year.} 37 | 38 | \item{i}{The interest rate. A numeric type value.} 39 | 40 | \item{data}{A data.frame containing the mortality table, with the first column being the age and the second one, the probability of death.} 41 | 42 | \item{prop}{A numeric value. It represents the proportion of the mortality table used (between 0 and 1).} 43 | 44 | \item{assumption}{A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage)} 45 | 46 | \item{cap}{A numeric type value. The value of the payment.} 47 | 48 | \item{t}{An integer. The moment of valuation (in months if it is a fractional coverage or in years if it is not).} 49 | } 50 | \value{ 51 | A data frame with Premium, Risk, 1/E and reserve values up to the moment t. 52 | } 53 | \description{ 54 | Calculates the reserve for the life insurance up to the moment 't'. 55 | } 56 | \examples{ 57 | V_A.(26673.3602688847,25,2,3,1,2,1,0.04,CSO80MANB,1,"none",12000000,5) 58 | V_A.(27446.2077993839/12,25,2,3,2,24,12,0.04,CSO80MANB,1,"UDD",12000000,60) 59 | V_A.(27376.5521158244/12,25,2,3,2,24,12,0.04,CSO80MANB,1,"constant",12000000,60) 60 | 61 | } 62 | \references{ 63 | Chapter 5 of Life Contingencies (1952) by Jordan, Chapter 11 of Actuarial Mathematics for Life Contingent Risks (2009) by Dickson, Hardy and Waters. 64 | } 65 | \keyword{Insurance} 66 | \keyword{Life} 67 | \keyword{Reserve} 68 | -------------------------------------------------------------------------------- /man/V_a.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/V_a.R 3 | \name{V_a} 4 | \alias{V_a} 5 | \title{Reserve Valuation for Life Annuities} 6 | \usage{ 7 | V_a( 8 | px, 9 | x, 10 | h, 11 | n, 12 | k = 1, 13 | cantprem = 1, 14 | premperyear = 1, 15 | i = 0.04, 16 | data, 17 | prop = 1, 18 | assumption = "none", 19 | cap, 20 | t 21 | ) 22 | } 23 | \arguments{ 24 | \item{px}{A numeric value. The value of the premium paid in each period.} 25 | 26 | \item{x}{An integer. The age of the insuree.} 27 | 28 | \item{h}{An integer. The deferral period.} 29 | 30 | \item{n}{An integer. Number of years of coverage.} 31 | 32 | \item{k}{An integer. Number of payments per year.} 33 | 34 | \item{cantprem}{An integer. The total number of premiums.} 35 | 36 | \item{premperyear}{An integer. The number of premiums to be paid per year.} 37 | 38 | \item{i}{The interest rate. A numeric type value.} 39 | 40 | \item{data}{A data.frame containing the mortality table, with the first column being the age and the second one, the probability of death.} 41 | 42 | \item{prop}{A numeric value. It represents the proportion of the mortality table used (between 0 and 1).} 43 | 44 | \item{assumption}{A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage).} 45 | 46 | \item{cap}{A numeric type value. The annualized value of the payment.} 47 | 48 | \item{t}{An integer. The moment of valuation (in months if it is a fractional coverage or in years if it is not).} 49 | } 50 | \value{ 51 | A data frame with Premium, Risk, 1/E and reserve values up to the moment t. 52 | } 53 | \description{ 54 | Calculates the reserve for the life Annuity up to the moment 't'. 55 | } 56 | \examples{ 57 | V_a(147.814202915034,20,5,10,1,5,1,0.04,CSO80MANB,1,"none",100,15) 58 | V_a(148.324902023591/12,20,5,10,4,60,12,0.04,CSO80MANB,1,"constant",100,178) 59 | V_a(223633.861110949,25,0,25,12,10,1,0.04,CSO80MANB,1,"UDD",120000,300) 60 | 61 | } 62 | \references{ 63 | Chapter 5 of Life Contingencies (1952) by Jordan, Chapter 11 of Actuarial Mathematics for Life Contingent Risks (2009) by Dickson, Hardy and Waters. 64 | } 65 | \keyword{Annuities} 66 | \keyword{Life} 67 | \keyword{Reserve} 68 | -------------------------------------------------------------------------------- /R/PremiumFrac.R: -------------------------------------------------------------------------------- 1 | #' @title Fractional Premium 2 | #' 3 | #' @description Calculates the annualized value of the fractional premiums. 4 | #' @param px1 A numeric type value. The value of the single net premium. 5 | #' @param x An integer. The age of the insuree. 6 | #' @param m An integer. Years of premium payment. 7 | #' @param k An integer. Number of premiums per year. 8 | #' @param i The interest rate. A numeric type value. 9 | #' @param data A data.frame of the mortality table, with the first column being the age and the second one the probability of death. 10 | #' @param prop A numeric value. It represents the proportion of the mortality table used (between 0 and 1). 11 | #' @param effect A character string. This parameter indicates if, in the event of death, the insuree is released from paying the remaining fractional premiums of that year ("yes" or "no") 12 | #' @param assumption A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths and "constant" for constant force of mortality). 13 | #' @export 14 | #' @keywords Fractional Premium 15 | #' @return Returns the annualized value of the fractional premium. 16 | #' @references Chapter 4 of Actuarial Mathematics for Life Contingent Risks (2009) by Dickson, Hardy and Waters 17 | #' @note If k=1, regardless of the "effect", the returned value is the annual premium. 18 | #' @examples 19 | #' PremiumFrac(1000,20,10,2,0.04,CSO80MANB,1,"yes","constant") 20 | #' PremiumFrac(1000,20,10,2,0.04,CSO80MANB,1,"no","UDD") 21 | #' 22 | 23 | 24 | PremiumFrac<-function(px1,x,m,k,i=0.04,data,prop=1,effect="yes",assumption){ 25 | dig<-getOption("digits") 26 | on.exit(options(digits = dig)) 27 | options(digits = 15) 28 | if(k==1){ 29 | premium<-px1/a(x,0,m,k,i,data,prop,assumption,1) 30 | return(premium) 31 | }else{ 32 | if(effect=="yes"){ 33 | Annualpremium<-px1/a(x,0,m,k,i,data,prop,assumption,1) 34 | return(Annualpremium) 35 | }else{ 36 | if(effect=="no" && k>1 && k<=12){ 37 | Annualpremiumnofrac<-px1/a(x,0,m,1,i,data,prop,assumption,1) 38 | v<-1/(1+i) 39 | d<-Rate_converter(i,"i",1,"d",1,"frac") 40 | fk<-Rate_converter(i,"i",1,"f",k,"frac") 41 | Annualpremium<-Annualpremiumnofrac*(fk/d) 42 | return(Annualpremium) 43 | }else{ 44 | stop("Check effect or value of k") 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /R/E.R: -------------------------------------------------------------------------------- 1 | #' @title Pure Endowment 2 | 3 | #' @description Calculates the Pure endowments. 4 | #' @param x An integer. The age of the insuree. 5 | #' @param n The term of the endowment. An integer, for annual coverage, or a numeric for fractional coverage. 6 | #' @param i The interest rate. A numeric type value. 7 | #' @param data A data.frame containing the mortality table, with the first column being the age and the second one, the probability of death. 8 | #' @param prop A numeric value. It represents the proportion of the mortality table being used (between 0 and 1). 9 | #' @param assumption A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage). 10 | #' @param cap A numeric type value. The payment. 11 | #' @references Chapter 2 of Life Contingencies (1952) by Jordan. 12 | #' @export 13 | #' @keywords Pure Endowment 14 | #' @return NULL 15 | #' @examples 16 | #' E(45,10,0.04,CSO80MANB,1,"none",1000) 17 | #' E(24,1.6,0.04,CSO80MANB,1,"constant",17000) 18 | #' E(26,2.4,0.04,CSO58FALB,1,"UDD",3500) 19 | #' 20 | 21 | E<-function(x,n,i=0.04,data,prop=1,assumption="none",cap=1){ 22 | dig<-getOption("digits") 23 | on.exit(options(digits = dig)) 24 | options(digits = 15) 25 | if(x>=0 && is_integer(x)==1 && n>=0 && i>=0 && prop>0 && cap>0){ 26 | if(n==0){ 27 | Exn<-1 28 | } else if(is_integer(n)==1){ 29 | Exn<-(1/(1+i))^(n)*Survival(x,n,data,prop) 30 | if(is.na(Exn)==1){ 31 | Exn<-0 32 | } 33 | } else { 34 | if(assumption=="constant"){ 35 | t<-floor(n) 36 | sk<-n-t 37 | Exn<-E(x,t,i,data,prop,"none",1)-sk*(E(x,t,i,data,prop,"none",1)-E(x,t+1,i,data,prop,"none",1)) 38 | if(is.na(Exn)==1){ 39 | Exn<-0 40 | } 41 | }else{ 42 | if(assumption=="UDD"){ 43 | if((x+n)==(nrow(data)-1)){ 44 | prop<-1 45 | } 46 | t<-floor(n) 47 | sk<-n-t 48 | prob<-1-sk*data[x+n+1,2]*prop 49 | Exn<-(1/(1+i))^(n)*(Survival(x,t,data,prop)*prob) 50 | if(is.na(Exn)==1){ 51 | Exn<-0 52 | } 53 | }else{ 54 | stop("Check assumption") 55 | } 56 | } 57 | } 58 | Exn<-as.numeric(Exn) 59 | px1<-Exn*cap 60 | return(px1) 61 | } else{ 62 | stop("Check values") 63 | } 64 | } 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /R/a.R: -------------------------------------------------------------------------------- 1 | #' @title Life Annuities 2 | 3 | #' @description Calculates the present value of a life annuity. 4 | #' @param x An integer. The age of the insuree. 5 | #' @param h An integer. The deferral period. 6 | #' @param n An integer. Number of years of coverage. 7 | #' @param k An integer. Number of payments per year. 8 | #' @param i The interest rate. A numeric type value. 9 | #' @param data A data.frame of the mortality table, with the first column being the age, and the second one the probability of death. 10 | #' @param prop A numeric value. It represents the proportion of the mortality table being used (between 0 and 1). 11 | #' @param assumption A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage). 12 | #' @param cap A numeric type value. The annualized value of the payment. 13 | #' @export 14 | #' @keywords Life Annuities 15 | #' @return Returns a numeric value (actuarial present value). 16 | #' @references Chapter 2 of Life Contingencies (1952) by Jordan, chapter 5 of Actuarial Mathematics (1997) by Bowers, Gerber, Hickman, Jones & Nesbitt. 17 | #' @examples 18 | #' a(20,0,15,1,0.04,CSO58FALB,1,"none",1200) 19 | #' a(23,7,9,1,0.04,GAM71F,1,"none",5000) 20 | #' a(33,3,10,4,0.04,CSO80MANB,1,"constant",3000) 21 | #' a(20,5,10,4,0.04,CSO58MANB,1,"UDD",5000) 22 | #' 23 | 24 | 25 | a<-function(x,h,n,k=1,i=0.04,data,prop=1,assumption="none",cap=1){ 26 | dig<-getOption("digits") 27 | on.exit(options(digits = dig)) 28 | options(digits = 15) 29 | if(x>=0 && is_integer(x)==1 && h>=0 && is_integer(h)==1 && n>=0 && is_integer(n)==1 && k>=1 && is_integer(k)==1 && i>=0 && prop>0 && cap>0){ 30 | if(n==0){ 31 | axhn<-0 32 | } else if(k==1){ 33 | axhn<-0 34 | for(j in h:(h+n-1)){ 35 | axhn<-axhn+E(x,j,i,data,prop,"none",1) 36 | } 37 | } else { 38 | if(assumption=="constant"){ 39 | axhn<-a(x,h,n,1,i,data,prop,"none",1)-((k-1)/(2*k))*(E(x,h,i,data,prop,"none",1)-E(x,h+n,i,data,prop,"none",1)) 40 | } else if(assumption=="UDD"){ 41 | fk<-Rate_converter(i,"i",1,"f",k,"frac") 42 | axhn<-(E(x,h,i,data,prop,"none",1)-E(x,h+n,i,data,prop,"none",1)-A.(x,h,n,k,i,data,prop,"UDD",1))/fk 43 | } else { 44 | stop("Check assumption") 45 | } 46 | } 47 | axhn<-as.numeric(axhn) 48 | px1<-axhn*cap 49 | return(px1) 50 | } else { 51 | stop("Check values") 52 | } 53 | } 54 | 55 | 56 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DetLifeInsurance 2 | 3 | DetLifeInsurance is an R package designed to provide tools for: 4 | - Deterministic valuation of actuarial reserves and life insurance and annuities premiums (both constant and variable amounts supported). 5 | - Applying fractional age assumptions to life tables, and generating new ones based on mortality laws. 6 | - Calculation of equivalent interest-discount rates as well as future and present value of annuities. 7 | - Calculation of loan amortization schedule. 8 | 9 | In addition, 47 commonly used mortality tables are included as data. 10 | 11 | ## Installation 12 | 13 | To install from [CRAN](https://CRAN.R-project.org), use: 14 | 15 | ```r 16 | install.packages("DetLifeInsurance") 17 | ``` 18 | 19 | To install from GitHub, use: 20 | 21 | ```r 22 | #library(devtools) 23 | devtools::install_github("JoaquinAuza/DetLifeInsurance") 24 | ``` 25 | **Note:** package ```devtools``` must be installed. 26 | 27 | ## Example #1 28 | 29 | In this example, we obtain the annual net premium of a life insurance coverage of $100000 for a term of 5 years, issued 30 | to a male of age 30, using an interest rate of 3.5%. 31 | 32 | ```r 33 | #library(DetLifeInsurance) 34 | 35 | LI <- A.(x=30, h=0, n=5, i = 0.035, data=CSO80MANB, cap = 100000) #Actuarial PV of the LI 36 | Prem <- a(x=30, h=0, n=5, k=1, i=0.035, data=CSO80MANB , assumption="UDD") 37 | Net_Premium <- LI/Prem #Net premium to be paid at the begining of each year 38 | 39 | #The same result can be achieved by using PremiumFrac() 40 | 41 | Net_Premium <-PremiumFrac(px1=LI, x=30,m=5,i=0.035,k=1,data=CSO80MANB) 42 | ``` 43 | ## Example #2 44 | In this example, we obtain the value of the actuarial reserve for a life insurance coverage where the insuree pays monthly premiums during the first year. UDD assumption is used. 45 | 46 | ```r 47 | #library(DetLifeInsurance) 48 | 49 | LI <- A.(x=30, h=0, n=5, i = 0.035, data=CSO80MANB, cap = 100000) 50 | 51 | Net_Premium <- PremiumFrac(px1=LI,x=30,m=1,k=12,i=0.035,data= CSO80MANB,assumption = "UDD") 52 | Net_Premium_monthly <- Net_Premium/12 53 | 54 | V_A.(px=Net_Premium_monthly, x=30, h=0, n=5, k = 1, cantprem = 12, 55 | premperyear = 12, i = 0.035, data=CSO80MANB, assumption = "UDD", 56 | cap=100000, t=60) 57 | ``` 58 | 59 | ## Status 60 | Work in progress! 61 | 62 | - [x] Basic functionality. 63 | - [x] Enhanced documentation. 64 | - [x] Fix references, fix non-exporable functions. 65 | - [x] Upload to CRAN. 66 | - [x] New functions: group insurance, loan insurance reserves... 67 | - [ ] what else? 68 | 69 | 70 | -------------------------------------------------------------------------------- /man/Payment_Protection.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Payment_Protection.R 3 | \name{Payment_Protection} 4 | \alias{Payment_Protection} 5 | \title{Payment Protection} 6 | \usage{ 7 | Payment_Protection( 8 | x, 9 | n, 10 | k = 1, 11 | V0, 12 | i = 0.04, 13 | ip = 0.04, 14 | data, 15 | prop = 1, 16 | type = "outstanding_debt", 17 | method = "interest_only" 18 | ) 19 | } 20 | \arguments{ 21 | \item{x}{An integer. The age of the insuree.} 22 | 23 | \item{n}{An integer. Loan term (in years).} 24 | 25 | \item{k}{An integer. Number of payments per year.} 26 | 27 | \item{V0}{A numeric type value. Loan value.} 28 | 29 | \item{i}{The interest rate. A numeric type value.} 30 | 31 | \item{ip}{The interest rate of the loan. A numeric type value.} 32 | 33 | \item{data}{A data.frame of the mortality table, with the first column being the age and the second one the probability of death.} 34 | 35 | \item{prop}{A numeric value. It represents the proportion of the mortality table being used (between 0 and 1).} 36 | 37 | \item{type}{A character string. The type of loan protection/reimburstment ("outstanding_debt" or "payments").} 38 | 39 | \item{method}{A character string. Amortization scheme ("constant_instalment", "interest_only" or "constant_principal").} 40 | } 41 | \value{ 42 | Returns a numeric value (actuarial present value). 43 | } 44 | \description{ 45 | Calculates the present value of the loan insurance. 46 | } 47 | \examples{ 48 | Payment_Protection(35,2,1,1000000,0.04,0.06,CSO80MANB,1,"payments","constant_instalment") 49 | Payment_Protection(43,2,1,1000000,0.04,0.07,CSO80MANB,1,"outstanding_debt","constant_instalment") 50 | Payment_Protection(30,2,2,1000000,0.04,0.06,CSO80MANB,1,"payments","constant_instalment") 51 | Payment_Protection(20,2,2,1000000,0.04,0.07,CSO80MANB,1,"outstanding_debt","constant_instalment") 52 | Payment_Protection(33,2,1,1000000,0.04,0.05,CSO80MANB,1,"payments","interest_only") 53 | Payment_Protection(56,2,1,1000000,0.04,0.06,CSO80MANB,1,"outstanding_debt","interest_only") 54 | Payment_Protection(40,2,2,1000000,0.04,0.06,CSO80MANB,1,"payments","interest_only") 55 | Payment_Protection(25,2,2,1000000,0.04,0.05,CSO80MANB,1,"outstanding_debt","interest_only") 56 | Payment_Protection(23,2,1,1000000,0.04,0.07,CSO80MANB,1,"payments","constant_principal") 57 | Payment_Protection(35,2,1,1000000,0.04,0.06,CSO80MANB,1,"outstanding_debt","constant_principal") 58 | Payment_Protection(45,2,2,1000000,0.04,0.05,CSO80MANB,1,"payments","constant_principal") 59 | Payment_Protection(35,2,2,1000000,0.04,0.07,CSO80MANB,1,"outstanding_debt","constant_principal") 60 | 61 | 62 | } 63 | \keyword{Payment} 64 | \keyword{Protection} 65 | -------------------------------------------------------------------------------- /R/A..R: -------------------------------------------------------------------------------- 1 | #' @title Life Insurance 2 | 3 | #' @description Calculates the present value of the life insurance. 4 | #' @param x An integer. The age of the insuree. 5 | #' @param h An integer. The deferral period. 6 | #' @param n An integer. Number of years of coverage. 7 | #' @param k An integer. Number of fractions per year. 8 | #' @param i The interest rate. A numeric type value. 9 | #' @param data A data.frame of the mortality table, with the first column being the age and the second one the probability of death. 10 | #' @param prop A numeric value. It represents the proportion of the mortality table being used (between 0 and 1). 11 | #' @param assumption A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage). 12 | #' @param cap A numeric type value. The value of the payment. 13 | #' @export 14 | #' @keywords Life Insurance 15 | #' @return Returns a numeric value (actuarial present value). 16 | #' @references Chapter 3 of Life Contingencies (1952) by Jordan, chapter 4 of Actuarial Mathematics (1997) by Bowers, Gerber, Hickman, Jones & Nesbitt. 17 | #' @examples 18 | #' A.(50,0,8,1,0.04,CSO80MANB,1,"none",1) 19 | #' A.(60,3,10,1,0.04,CSO80MANB,1,"none",1) 20 | #' A.(21,4,7,3,0.04,CSO80MANB,1,"constant",1) 21 | #' A.(23,4,6,12,0.04,CSO80MANB,1,"UDD",1) 22 | #' 23 | 24 | 25 | A.<-function(x,h,n,k=1,i=0.04,data,prop=1,assumption="none",cap=1){ 26 | dig<-getOption("digits") 27 | on.exit(options(digits = dig)) 28 | options(digits = 15) 29 | if(x>=0 && is_integer(x)==1 && h>=0 && is_integer(h)==1 && n>=0 && is_integer(n)==1 && k>=1 && is_integer(k)==1 && i>=0 && prop>0 && cap>0){ 30 | if(n==0){ 31 | Axhn<-0 32 | } else if(k==1){ 33 | Axhn<-0 34 | p<-Survival(x,h,data,prop) 35 | for(s in h:(h+n-1)){ 36 | if(x+s==(nrow(data)-1)){ 37 | prop<-1 38 | } 39 | Axhn<-Axhn+(1/(1+i))^(s+1)*(as.numeric(data[x+s+1,2])*prop)*p 40 | p<-p*(1-data[x+s+1,2]*prop) 41 | if(x+s==(nrow(data)-1)){ 42 | break 43 | } 44 | } 45 | } else{ 46 | if(assumption=="constant"){ 47 | fk<-Rate_converter(i,"i",1,"f",k,"frac") 48 | Axhn<-E(x,h,i,data,prop,"none",1)-E(x,h+n,i,data,prop,"none",1)-fk*a(x,h,n,k,i,data,prop,"constant",1) 49 | } else if(assumption=="UDD"){ 50 | jk<-Rate_converter(i,"i",1,"j",k,"frac") 51 | Axhn<-(i/jk)*A.(x,h,n,1,i,data,prop,"none",1) 52 | } else{ 53 | stop("Check assumption") 54 | } 55 | } 56 | Axhn<-as.numeric(Axhn) 57 | px1<-Axhn*cap 58 | return(px1) 59 | } else { 60 | stop("Check values") 61 | } 62 | } 63 | 64 | 65 | -------------------------------------------------------------------------------- /R/Am..R: -------------------------------------------------------------------------------- 1 | #' @title Life Insurance of a group 2 | 3 | #' @description Calculates the present value of a life insurance coverage for a group. 4 | #' @param x A vector of intergers representing the age of each individual of the group. 5 | #' @param h An integer. The deferral period. 6 | #' @param n An integer. Number of years of coverage. 7 | #' @param k An integer. Number of fractions per year. 8 | #' @param i The interest rate. A numeric type value. 9 | #' @param data A data.frame of the mortality table, with the first column being the age and the second one the probability of death. 10 | #' @param prop A numeric value. It represents the proportion of the mortality table being used (between 0 and 1). 11 | #' @param ndeath An integer. Number of deaths necessary for payment to occur. 12 | #' @param assumption A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage). 13 | #' @param cap A numeric type value. The value of the payment. 14 | #' @export 15 | #' @keywords Group Life Insurance 16 | #' @return Returns a numeric value (actuarial present value). 17 | #' @examples 18 | #' ages<-c(22,33,44,55,66) 19 | #' Am.(ages,5,15,1,0.04,CSO80MANB,1,2,"none",1) 20 | #' Am.(ages,0,20,4,0.04,CSO80MANB,1,2,"UDD",1) 21 | #' Am.(ages,10,25,2,0.04,CSO80MANB,1,2,"constant",1) 22 | #' 23 | 24 | 25 | Am.<-function(x,h,n,k=1,i=0.04,data,prop=1,ndeath=1,assumption="none",cap=1){ 26 | dig<-getOption("digits") 27 | on.exit(options(digits = dig)) 28 | options(digits = 15) 29 | if(is_integer(x)==1 && h>=0 && is_integer(h)==1 && n>=0 && is_integer(n)==1 && is_integer(k)==1 && k>=1 && k<=12 &&i>=0 && prop>0 && is_integer(ndeath)==1 && ndeath<=length(x) && ndeath>0){ 30 | if(n==0){ 31 | Amxhn<-0 32 | }else if(k==1){ 33 | quantity<-length(x)-ndeath+1 34 | d<-Rate_converter(i,"i",1,"d",1,"frac") 35 | Amxhn<-Em(x,h,i,data,prop,type="atleast",quant=quantity,assumption="none",1)-Em(x,h+n,i,data,prop,type="atleast",quant=quantity,assumption="none",1)-d*am(x,h,n,k,i,data,prop,type="atleast",quant=quantity,assumption="none",1) 36 | }else if(assumption=="UDD" || assumption=="constant" && k>1){ 37 | quantity<-length(x)-ndeath+1 38 | v<-1/(1+i) 39 | fk<-d<-Rate_converter(i,"i",1,"f",k,"frac") 40 | Amxhn<-Em(x,h,i,data,prop,type="atleast",quant=quantity)-Em(x,h+n,i,data,prop,type="atleast",quant=quantity)-fk*am(x,h,n,k,i,data,prop,type="atleast",quant=quantity,assumption,1) 41 | }else{ 42 | stop("Check assumption") 43 | } 44 | Amxhn<-as.numeric(Amxhn) 45 | px1<-Amxhn*cap 46 | return(px1) 47 | }else{ 48 | stop("Check values") 49 | } 50 | } 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /man/V_aD.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/V_aD.R 3 | \name{V_aD} 4 | \alias{V_aD} 5 | \title{Reserve Valuation for Decreasing life annuities} 6 | \usage{ 7 | V_aD( 8 | px, 9 | x, 10 | h, 11 | n, 12 | k = 1, 13 | cantprem = 1, 14 | premperyear = 1, 15 | i = 0.04, 16 | data, 17 | prop = 1, 18 | assumption = "none", 19 | variation = "none", 20 | cap, 21 | t 22 | ) 23 | } 24 | \arguments{ 25 | \item{px}{A numeric value. The value of the premium paid in each period.} 26 | 27 | \item{x}{An integer. The age of the insuree.} 28 | 29 | \item{h}{An integer. The deferral period.} 30 | 31 | \item{n}{An integer. Number of years of coverage.} 32 | 33 | \item{k}{An integer. Number of payments per year.} 34 | 35 | \item{cantprem}{An integer. The total number of premiums.} 36 | 37 | \item{premperyear}{An integer. The number of premiums to be paid per year.} 38 | 39 | \item{i}{The interest rate. A numeric type value.} 40 | 41 | \item{data}{A data.frame containing the mortality table, with the first column being the age and the second one, the probability of death.} 42 | 43 | \item{prop}{A numeric value. It represents the proportion of the mortality table used (between 0 and 1).} 44 | 45 | \item{assumption}{A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage).} 46 | 47 | \item{variation}{A character string. "inter" if the variation it's interannual or "intra" if it's intra-annual.} 48 | 49 | \item{cap}{A numeric type value. The annualized value of the first payment.} 50 | 51 | \item{t}{An integer. The moment of valuation (in months if it is a fractional coverage or in years if it is not).} 52 | } 53 | \value{ 54 | A data frame with Premium, Risk, 1/E and reserve values up to the moment t. 55 | } 56 | \description{ 57 | Calculates the reserve for the decreasing life annuity up to the moment 't'. 58 | } 59 | \examples{ 60 | V_aD(139102.759700887,20,2,2,1,2,1,0.04,CSO80MANB,1,"none","none",100000,4) 61 | V_aD(140293.253997879/12,20,2,2,2,24,12,0.04,CSO80MANB,1,"constant","inter",100000,48) 62 | V_aD(23461.2532906378/12,20,2,2,2,24,12,0.04,CSO80MANB,1,"constant","intra",10000,48) 63 | V_aD(23462.5668144001/12,20,2,2,2,24,12,0.04,CSO80MANB,1,"UDD","intra",10000,48) 64 | V_aD(14029.8183844808/12,20,2,2,2,24,12,0.04,CSO80MANB,1,"UDD","inter",10000,48) 65 | 66 | } 67 | \references{ 68 | Chapter 5 of Life Contingencies (1952) by Jordan, Chapter 11 of Actuarial Mathematics for Life Contingent Risks (2009) by Dickson, Hardy and Waters. 69 | } 70 | \keyword{Annuities} 71 | \keyword{Decreasing} 72 | \keyword{Life} 73 | \keyword{Reserve} 74 | \keyword{Varying} 75 | -------------------------------------------------------------------------------- /man/V_AD..Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/V_AD..R 3 | \name{V_AD.} 4 | \alias{V_AD.} 5 | \title{Reserve Valuation for Decreasing Life Insurance} 6 | \usage{ 7 | V_AD.( 8 | px, 9 | x, 10 | h, 11 | n, 12 | k = 1, 13 | cantprem = 1, 14 | premperyear = 1, 15 | i = 0.04, 16 | data, 17 | prop = 1, 18 | assumption = "none", 19 | variation = "none", 20 | cap, 21 | t 22 | ) 23 | } 24 | \arguments{ 25 | \item{px}{A numeric value. The value of the premium paid in each period.} 26 | 27 | \item{x}{An integer. The age of the insuree.} 28 | 29 | \item{h}{An integer. The deferral period.} 30 | 31 | \item{n}{An integer. Number of years of coverage.} 32 | 33 | \item{k}{An integer. Number of fractions per year.} 34 | 35 | \item{cantprem}{An integer. The total number of premiums.} 36 | 37 | \item{premperyear}{An integer. The number of premiums to be paid per year.} 38 | 39 | \item{i}{The interest rate. A numeric type value.} 40 | 41 | \item{data}{A data.frame containing the mortality table, with the first column being the age and the second one, the probability of death.} 42 | 43 | \item{prop}{A numeric value. It represents the proportion of the mortality table used (between 0 and 1).} 44 | 45 | \item{assumption}{A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage).} 46 | 47 | \item{variation}{A character string. "inter" if the variation it's inter-annual or "intra" if it's intra-annual.} 48 | 49 | \item{cap}{A numeric type value. Amount insured for the first year/period.} 50 | 51 | \item{t}{An integer. The moment of valuation (in months if it is a fractional coverage or in years if it is not).} 52 | } 53 | \value{ 54 | A data frame with Premium, Risk, 1/E and reserve values up to the moment t. 55 | } 56 | \description{ 57 | Calculates the reserve for the decreasing life insurance up to the moment t. 58 | } 59 | \examples{ 60 | V_AD.(251.489227521537,20,2,2,1,2,1,0.04,CSO80MANB,1,"none","none",100000,4) 61 | V_AD.(432.974179723949/12,20,2,2,2,24,12,0.04,CSO80MANB,1,"UDD","intra",100000,48) 62 | V_AD.(258.794207318685/12,20,2,2,2,24,12,0.04,CSO80MANB,1,"UDD","inter",100000,48) 63 | V_AD.(412.784641829906/12,20,2,2,2,24,12,0.04,CSO80MANB,1,"constant","intra",100000,48) 64 | V_AD.(258.189935788232/12,20,2,2,2,24,12,0.04,CSO80MANB,1,"constant","inter",100000,48) 65 | } 66 | \references{ 67 | Chapter 5 of Life Contingencies (1952) by Jordan, Chapter 11 of Actuarial Mathematics for Life Contingent Risks (2009) by Dickson, Hardy and Waters. 68 | } 69 | \keyword{Annuities} 70 | \keyword{Decreasing} 71 | \keyword{Life} 72 | \keyword{Reserve} 73 | \keyword{Varying} 74 | -------------------------------------------------------------------------------- /man/V_avg.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/V_avg.R 3 | \name{V_avg} 4 | \alias{V_avg} 5 | \title{Reserve Valuation for Varying Life Annuities: Geometric Progression} 6 | \usage{ 7 | V_avg( 8 | px, 9 | x, 10 | h, 11 | n, 12 | k = 1, 13 | r, 14 | cantprem = 1, 15 | premperyear = 1, 16 | i = 0.04, 17 | data, 18 | prop = 1, 19 | assumption = "none", 20 | variation = "none", 21 | cap, 22 | t 23 | ) 24 | } 25 | \arguments{ 26 | \item{px}{A numeric value. The value of the premium paid in each period.} 27 | 28 | \item{x}{An integer. The age of the insuree.} 29 | 30 | \item{h}{An integer. The deferral period.} 31 | 32 | \item{n}{An integer. Number of years of coverage.} 33 | 34 | \item{k}{An integer. Number of payments per year.} 35 | 36 | \item{r}{The variation rate. A numeric type value.} 37 | 38 | \item{cantprem}{An integer. The total number of premiums.} 39 | 40 | \item{premperyear}{An integer. The number of premiums to be paid per year.} 41 | 42 | \item{i}{The interest rate. A numeric type value.} 43 | 44 | \item{data}{A data.frame containing the mortality table, with the first column being the age and the second one, the probability of death.} 45 | 46 | \item{prop}{A numeric value. It represents the proportion of the mortality table used (between 0 and 1).} 47 | 48 | \item{assumption}{A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage).} 49 | 50 | \item{variation}{A character string. "inter" if the variation it's interannual or "intra" if it's intra-annual.} 51 | 52 | \item{cap}{A numeric type value. The annualized value of the first payment.} 53 | 54 | \item{t}{An integer. The moment of valuation (in months if it is a fractional coverage or in years if it is not).} 55 | } 56 | \value{ 57 | A data frame with Premium, Risk, 1/E and reserve values up to the moment t. 58 | } 59 | \description{ 60 | Calculates the reserve for the Varying Life Annuity up to the moment t. 61 | } 62 | \examples{ 63 | V_avg(94359.4349607651,20,2,2,1,0.05,2,1,0.04,CSO80MANB,1,"none","none",100000,4) 64 | V_avg(95167.1217583443/12,20,2,2,2,0.05,24,12,0.04,CSO80MANB,1,"constant","inter",100000,48) 65 | V_avg(99969.5282890978/12,20,2,2,2,0.05,24,12,0.04,CSO80MANB,1,"constant","intra",100000,48) 66 | V_avg(95170.4683383614/12,20,2,2,2,0.05,24,12,0.04,CSO80MANB,1,"UDD","inter",100000,48) 67 | V_avg(99972.7870462341/12,20,2,2,2,0.05,24,12,0.04,CSO80MANB,1,"UDD","intra",100000,48) 68 | 69 | } 70 | \references{ 71 | Chapter 5 of Life Contingencies (1952) by Jordan, Chapter 11 of Actuarial Mathematics for Life Contingent Risks (2009) by Dickson, Hardy and Waters. 72 | } 73 | \keyword{Annuities} 74 | \keyword{Geometric} 75 | \keyword{Life} 76 | \keyword{Progression} 77 | \keyword{Reserve} 78 | \keyword{Varying} 79 | -------------------------------------------------------------------------------- /man/V_Av..Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/V_Av..R 3 | \name{V_Av.} 4 | \alias{V_Av.} 5 | \title{Reserve Valuation for Varying Life Insurance: Arithmetic Progression} 6 | \usage{ 7 | V_Av.( 8 | px, 9 | x, 10 | h, 11 | n, 12 | k = 1, 13 | r, 14 | cantprem = 1, 15 | premperyear = 1, 16 | i = 0.04, 17 | data, 18 | prop = 1, 19 | assumption = "none", 20 | variation = "none", 21 | cap, 22 | t 23 | ) 24 | } 25 | \arguments{ 26 | \item{px}{A numeric value. The value of the premium paid in each period.} 27 | 28 | \item{x}{An integer. The age of the insuree.} 29 | 30 | \item{h}{An integer. The deferral period.} 31 | 32 | \item{n}{An integer. Number of years of coverage.} 33 | 34 | \item{k}{An integer. Number of fractions per year.} 35 | 36 | \item{r}{The variation rate. A numeric type value.} 37 | 38 | \item{cantprem}{An integer. The total number of premiums.} 39 | 40 | \item{premperyear}{An integer. The number of premiums to be paid per year.} 41 | 42 | \item{i}{The interest rate. A numeric type value.} 43 | 44 | \item{data}{A data.frame containing the mortality table, with the first column being the age and the second one, the probability of death.} 45 | 46 | \item{prop}{A numeric value. It represents the proportion of the mortality table used (between 0 and 1).} 47 | 48 | \item{assumption}{A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage).} 49 | 50 | \item{variation}{A character string. "inter" if the variation it's interannual or "intra" if it's intra-annual.} 51 | 52 | \item{cap}{A numeric type value. Amount insured for the first year/period.} 53 | 54 | \item{t}{An integer. The moment of valuation (in months if it is a fractional coverage or in years if it is not).} 55 | } 56 | \value{ 57 | A data frame with Premium, Risk, 1/E and reserve values up to the moment t. 58 | } 59 | \description{ 60 | Calculates the reserve for the varying life insurance up to the moment t. 61 | } 62 | \examples{ 63 | V_Av.(333.373580168544,20,2,2,1,0.05,1,1,0.04,CSO80MANB,1,"none","none",100000,4) 64 | V_Av.(175.054867728107/12,20,2,2,2,0.05,24,12,0.04,CSO80MANB,1,"UDD","inter",100000,48) 65 | V_Av.(183.436285298212/12,20,2,2,2,0.05,24,12,0.04,CSO80MANB,1,"UDD","intra",100000,48) 66 | V_Av.(183.965812992762/12,20,2,2,2,0.05,24,12,0.04,CSO80MANB,1,"constant","intra",100000,48) 67 | V_Av.(174.645127871177/12,20,2,2,2,0.05,24,12,0.04,CSO80MANB,1,"constant","inter",100000,48) 68 | 69 | 70 | } 71 | \references{ 72 | Chapter 5 of Life Contingencies (1952) by Jordan, Chapter 11 of Actuarial Mathematics for Life Contingent Risks (2009) by Dickson, Hardy and Waters. 73 | } 74 | \keyword{Arithmetic} 75 | \keyword{Insurance} 76 | \keyword{Life} 77 | \keyword{Progression} 78 | \keyword{Reserve} 79 | \keyword{Varying} 80 | -------------------------------------------------------------------------------- /man/V_Avg..Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/V_Avg..R 3 | \name{V_Avg.} 4 | \alias{V_Avg.} 5 | \title{Reserve Valuation for Varying Life Insurance: Geometric Progression} 6 | \usage{ 7 | V_Avg.( 8 | px, 9 | x, 10 | h, 11 | n, 12 | k = 1, 13 | r, 14 | cantprem = 1, 15 | premperyear = 1, 16 | i = 0.04, 17 | data, 18 | prop = 1, 19 | assumption = "none", 20 | variation = "none", 21 | cap, 22 | t 23 | ) 24 | } 25 | \arguments{ 26 | \item{px}{A numeric value. The value of the premium paid in each period.} 27 | 28 | \item{x}{An integer. The age of the insuree.} 29 | 30 | \item{h}{An integer. The deferral period.} 31 | 32 | \item{n}{An integer. Number of years of coverage.} 33 | 34 | \item{k}{An integer. Number of fractions per year.} 35 | 36 | \item{r}{The variation rate. A numeric type value.} 37 | 38 | \item{cantprem}{An integer. The total number of premiums.} 39 | 40 | \item{premperyear}{An integer. The number of premiums to be paid per year.} 41 | 42 | \item{i}{The interest rate. A numeric type value.} 43 | 44 | \item{data}{A data.frame containing the mortality table, with the first column being the age and the second one, the probability of death.} 45 | 46 | \item{prop}{A numeric value. It represents the proportion of the mortality table used (between 0 and 1).} 47 | 48 | \item{assumption}{A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage).} 49 | 50 | \item{variation}{A character string. "inter" if the variation it's interannual or "intra" if it's intra-annual.} 51 | 52 | \item{cap}{A numeric type value. Amount insured for the first year/period.} 53 | 54 | \item{t}{An integer. The moment of valuation (in months if it is a fractional coverage or in years if it is not).} 55 | } 56 | \value{ 57 | A data frame with Premium, Risk, 1/E and reserve values up to the moment t. 58 | } 59 | \description{ 60 | Calculates the reserve for the varying life insurance up to the moment t. 61 | } 62 | \examples{ 63 | V_Avg.(170.113596880528,20,2,2,1,0.05,2,1,0.04,CSO80MANB,1,"none","none",100000,4) 64 | V_Avg.(183.854458536232/12,20,2,2,2,0.05,24,12,0.04,CSO80MANB,1,"UDD","intra",100000,48) 65 | V_Avg.( 175.054867728107/12,20,2,2,2,0.05,24,12,0.04,CSO80MANB,1,"UDD","inter",100000,48) 66 | V_Avg.(184.431102889578/12,20,2,2,2,0.05,24,12,0.04,CSO80MANB,1,"constant","intra",100000,48) 67 | V_Avg.(174.645127871158/12,20,2,2,2,0.05,24,12,0.04,CSO80MANB,1,"constant","inter",100000,48) 68 | 69 | } 70 | \references{ 71 | Chapter 5 of Life Contingencies (1952) by Jordan, Chapter 11 of Actuarial Mathematics for Life Contingent Risks (2009) by Dickson, Hardy and Waters. 72 | } 73 | \keyword{Geometric} 74 | \keyword{Insurance} 75 | \keyword{Life} 76 | \keyword{Progression} 77 | \keyword{Reserve} 78 | \keyword{Varying} 79 | -------------------------------------------------------------------------------- /man/V_av.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/V_av.R 3 | \name{V_av} 4 | \alias{V_av} 5 | \title{Reserve Valuation for Varying Life Annuities: Arithmetic Progression} 6 | \usage{ 7 | V_av( 8 | px, 9 | x, 10 | h, 11 | n, 12 | k = 1, 13 | r, 14 | cantprem = 1, 15 | premperyear = 1, 16 | i = 0.04, 17 | data, 18 | prop = 1, 19 | assumption = "none", 20 | variation = "none", 21 | cap, 22 | t 23 | ) 24 | } 25 | \arguments{ 26 | \item{px}{A numeric value. The value of the premium paid in each period.} 27 | 28 | \item{x}{An integer. The age of the insuree.} 29 | 30 | \item{h}{An integer. The deferral period.} 31 | 32 | \item{n}{An integer. Number of years of coverage.} 33 | 34 | \item{k}{An integer. Number of payments per year.} 35 | 36 | \item{r}{The variation rate. A numeric type value.} 37 | 38 | \item{cantprem}{An integer. The total number of premiums.} 39 | 40 | \item{premperyear}{An integer. The number of premiums to be paid per year.} 41 | 42 | \item{i}{The interest rate. A numeric type value.} 43 | 44 | \item{data}{A data.frame containing the mortality table, with the first column being the age and the second one, the probability of death.} 45 | 46 | \item{prop}{A numeric value. It represents the proportion of the mortality table used (between 0 and 1).} 47 | 48 | \item{assumption}{A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage).} 49 | 50 | \item{variation}{A character string. "inter" if the variation it's interannual or "intra" if it's intra-annual.} 51 | 52 | \item{cap}{A numeric type value. The annualized value of the first payment.} 53 | 54 | \item{t}{An integer. The moment of valuation (in months if it is a fractional coverage or in years if it is not).} 55 | } 56 | \value{ 57 | A data frame with Premium, Risk, 1/E and reserve values up to the moment t. 58 | } 59 | \description{ 60 | Calculates the reserve for the Varying Life Annuity up to the moment t. 61 | } 62 | \examples{ 63 | V_av(9435943.49607651,20,2,2,1,0.05,2,1,0.04,CSO80MANB,1,"none","none",10000000,4) 64 | V_av(9516712.17583443/12,20,2,2,2,0.05,24,12,0.04,CSO80MANB,1,"constant","inter",10000000,48) 65 | V_av(9517.04683383614/12,20,2,2,2,0.05,24,12,0.04,CSO80MANB,1,"UDD","inter",10000,48) 66 | V_av(997.404109454868/12,20,2,2,2,0.05,24,12,0.04,CSO80MANB,1,"constant","intra",1000,48) 67 | V_av(997436.738989113/12,20,2,2,2,0.05,24,12,0.04,CSO80MANB,1,"UDD","intra",1000000,48) 68 | V_av(28.4421691213902,40,3,7,2,0.7,1,1,0.04,CSO80MANB,1,"UDD","intra",1,120) 69 | 70 | } 71 | \references{ 72 | Chapter 5 of Life Contingencies (1952) by Jordan, Chapter 11 of Actuarial Mathematics for Life Contingent Risks (2009) by Dickson, Hardy and Waters. 73 | } 74 | \keyword{Annuities} 75 | \keyword{Arithmetic} 76 | \keyword{Life} 77 | \keyword{Progression} 78 | \keyword{Reserve} 79 | \keyword{Varying} 80 | -------------------------------------------------------------------------------- /R/aD.R: -------------------------------------------------------------------------------- 1 | #' @title Decreasing Life Annuities 2 | 3 | #' @description Calculates the present value of a decreasing life annuity. 4 | #' @param x An integer. The age of the insuree. 5 | #' @param h An integer. The deferral period. 6 | #' @param n An integer. Number of years of coverage. 7 | #' @param k An integer. Number of payments per year. 8 | #' @param i The interest rate. A numeric type value. 9 | #' @param data A data.frame of the mortality table, with the first column being the age and the second one the probability of death. 10 | #' @param prop A numeric value. It represents the proportion of the mortality table being used (between 0 and 1). 11 | #' @param assumption A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage). 12 | #' @param variation A character string. "inter" if the variation it's interannual or "intra" if it's intra-annual. 13 | #' @param cap A numeric type value. The annualized value of the first payment. 14 | #' @export 15 | #' @keywords Life Annuities Decreasing 16 | #' @return Returns a numeric value (actuarial present value). 17 | #' @references Chapter 2 of Life Contingencies (1952) by Jordan, chapter 5 of Actuarial Mathematics (1997) by Bowers, Gerber, Hickman, Jones & Nesbitt. 18 | #' @examples 19 | #' aD(27,0,3,1,0.04,CSO80MANB,1,"none","none",1) 20 | #' aD(32,2,8,1,0.04,CSO80MANB,1,"none","none",1) 21 | #' aD(35,8,15,4,0.04,CSO80MANB,1,"constant","inter",1) 22 | #' aD(21,2,5,4,0.04,CSO80MANB,1,"UDD","inter",1) 23 | #' aD(54,4,16,2,0.04,CSO80MANB,1,"constant","intra",1) 24 | #' aD(20,10,15,3,0.04,CSO80MANB,1,"UDD","intra",1) 25 | #' 26 | 27 | aD<-function(x,h,n,k=1,i=0.04,data,prop=1,assumption="none",variation="none",cap=1){ 28 | dig<-getOption("digits") 29 | on.exit(options(digits = dig)) 30 | options(digits = 15) 31 | if(x>=0 && is_integer(x)==1 && h>=0 && is_integer(h)==1 && n>=0 && is_integer(n)==1 && k>=1 && is_integer(k)==1 && i>=0 && prop>0 && cap>0){ 32 | if(n==0){ 33 | adxhn<-0 34 | } else if(k==1){ 35 | adxhn<-0 36 | for(j in h:(h+n-1)){ 37 | adxhn<-adxhn+E(x,j,i,data,prop,"none",1)*(n-j+h) 38 | } 39 | } else { 40 | if(assumption=="constant"){ 41 | if(variation=="inter"){ 42 | adxhn<-0 43 | for(t in h:(h+n-1)){ 44 | for(s in 0:(k-1)){ 45 | adxhn<-adxhn+(n-(t-h))*E(x,t,i,data,prop,"none",1)*(1/k)*E(x+t,s/k,i,data,prop,"constant",1) 46 | } 47 | } 48 | } else if(variation=="intra"){ 49 | adxhn<-0 50 | for(t in h:(h+n-1)){ 51 | for(s in 0:(k-1)){ 52 | adxhn<-adxhn+(n*k-(t-h)*k-s)*E(x,t,i,data,prop,"none",1)*(1/k)*E(x+t,s/k,i,data,prop,"constant",1) 53 | } 54 | } 55 | } else{ 56 | stop("Check variation") 57 | } 58 | } else if(assumption=="UDD"){ 59 | if(variation=="inter"){ 60 | adxhn<-0 61 | for(t in h:(h+n-1)){ 62 | for(s in 0:(k-1)){ 63 | adxhn<-adxhn+(n-(t-h))*E(x,t,i,data,prop,"none",1)*(1/k)*E(x+t,s/k,i,data,prop,"UDD",1) 64 | } 65 | } 66 | }else if(variation=="intra"){ 67 | adxhn<-0 68 | for(t in h:(h+n-1)){ 69 | for(s in 0:(k-1)){ 70 | adxhn<-adxhn+(n*k-(t-h)*k-s)*E(x,t,i,data,prop,"none",1)*(1/k)*E(x+t,s/k,i,data,prop,"UDD",1) 71 | } 72 | } 73 | } else{ 74 | stop("Check variation") 75 | } 76 | } else{ 77 | stop("Check assumption") 78 | } 79 | } 80 | adxhn<-as.numeric(adxhn) 81 | px1<-adxhn*cap 82 | return(px1) 83 | } else { 84 | stop("Check values") 85 | } 86 | } 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /R/av.R: -------------------------------------------------------------------------------- 1 | #' @title Varying Life Annuities: Arithmetic Progression 2 | 3 | #' @description Calculates the present value of a varying life annuity according to a arithmetic progression. 4 | #' @param x An integer. The age on the insuree. 5 | #' @param h An integer. The deferral period. 6 | #' @param n An integer. Number of years of coverage. 7 | #' @param k An integer. Number of payments per year. 8 | #' @param r The variation rate. A numeric type value. 9 | #' @param i The interest rate. A numeric type value. 10 | #' @param data A data.frame of the mortality table, with the first column being the age and the second one the probability of death. 11 | #' @param prop A numeric value. It represents the proportion of the mortality table being used (between 0 and 1). 12 | #' @param assumption A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage). 13 | #' @param variation A character string. "inter" if the variation it's interannual or "intra" if it's intra-annual. 14 | #' @param cap A numeric type value. The annualized value of the first payment. 15 | #' @export 16 | #' @keywords Life Annuities Arithmetic Progression 17 | #' @return Returns a numeric value (actuarial present value). 18 | #' @references Chapter 5 of Actuarial Mathematics for Life Contingent Risks (2009) by Dickson, Hardy and Waters. 19 | #' @note For an increasing life annuity coverage, 'r' must be 1. 20 | #' @examples 21 | #' av(33,0,5,1,0.8,0.04,CSO80MANB,1,"none","none",1) 22 | #' av(26,2,4,1,0.4,0.04,CSO80MANB,1,"none","none",1) 23 | #' av(26,1,5,4,0.5,0.04,CSO80MANB,1,"constant","inter",1) 24 | #' av(24,1,3,3,0.7,0.04,CSO80MANB,1,"constant","intra",1) 25 | #' av(35,4,6,6,0.4,0.04,CSO80MANB,1,"UDD","inter",1) 26 | #' av(40,3,7,2,0.7,0.04,CSO80MANB,1,"UDD","intra",1) 27 | #' 28 | 29 | av<-function(x,h,n,k=1,r=1,i=0.04,data,prop=1,assumption="none",variation="none",cap=1){ 30 | dig<-getOption("digits") 31 | on.exit(options(digits = dig)) 32 | options(digits = 15) 33 | if(x>=0 && is_integer(x)==1 && h>=0 && is_integer(h)==1 && n>=0 && is_integer(n)==1 && k>=1 && is_integer(k)==1 && i>=0 && prop>0 && cap>0){ 34 | if(n==0){ 35 | avxhn<-0 36 | } else if(k==1){ 37 | avxhn<-0 38 | for(j in h:(h+n-1)){ 39 | avxhn<-avxhn+E(x,j,i,data,prop,"none",1)*(1+r*(j-h)) 40 | } 41 | }else{ 42 | if(assumption=="constant"){ 43 | if(variation=="inter"){ 44 | avxhn<-(1-((k-1)/(2*k)))*av(x,h,n,1,r,i,data,prop,"none","none",1)+((k-1)/(2*k))*av(x,h+1,n,1,r,i,data,prop,"none","none",1) 45 | } else if(variation=="intra"){ 46 | avxhn<-0 47 | for(t in h:(n+h-1)){ 48 | for(s in 0:(k-1)){ 49 | avxhn<-avxhn+(1+(t-h)*k*r+s*r)*(1/k)*E(x,t,i,data,prop,"none",1)*E(x+t,s/k,i,data,prop,"constant",1) 50 | } 51 | } 52 | }else{ 53 | stop("Check variation") 54 | } 55 | } else if(assumption=="UDD"){ 56 | if(variation=="inter"){ 57 | fk<-Rate_converter(i,"i",1,"f",k,"frac") 58 | avxhn<-(E(x,h,i,data,prop,"none",1)+r*a(x,h+1,n-1,1,i,data,prop,"none",1)-(1+(n-1)*r)*E(x,h+n,i,data,prop,"none",1)-Av.(x,h,n,k,r,i,data,prop,"UDD","inter",1))/fk 59 | }else if(variation=="intra"){ 60 | avxhn<-0 61 | for(t in h:(n+h-1)){ 62 | for(s in 0:(k-1)){ 63 | avxhn<-avxhn+(1+(t-h)*k*r+s*r)*(1/k)*E(x,t,i,data,prop,"none",1)*E(x+t,s/k,i,data,prop,"UDD",1) 64 | } 65 | } 66 | }else { 67 | stop("Check variation") 68 | } 69 | } else{ 70 | stop("Check assumption") 71 | } 72 | } 73 | avxhn<-as.numeric(avxhn) 74 | px1<-avxhn*cap 75 | return(px1) 76 | } else{ 77 | stop("Check values") 78 | } 79 | } 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /R/avg.R: -------------------------------------------------------------------------------- 1 | #' @title Varying Life Annuities: Geometric Progression 2 | 3 | #' @description Calculates the present value of a varying life annuity according to a geometric progression. 4 | #' @param x An integer. The age of the insuree. 5 | #' @param h An integer. The deferral period. 6 | #' @param n An integer. Number of years of coverage. 7 | #' @param k An integer. Number of payments per year. 8 | #' @param r The variation rate. A numeric type value. 9 | #' @param i The interest rate. A numeric type value. 10 | #' @param data A data.frame of the mortality table, with the first column being the age and the second one the probability of death. 11 | #' @param prop A numeric value. It represents the proportion of the mortality table being used (between 0 and 1). 12 | #' @param assumption A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage). 13 | #' @param variation A character string. "inter" if the variation it's interannual or "intra" if it's intra-annual. 14 | #' @param cap A numeric type value. The annualized value of the first payment. 15 | #' @export 16 | #' @keywords Life Annuities Geometric Progression 17 | #' @return Returns a numeric value (actuarial present value). 18 | #' @references Chapter 5 of Actuarial Mathematics for Life Contingent Risks (2009) by Dickson, Hardy and Waters. 19 | #' @examples 20 | #' avg(33,0,5,1,0.8,0.04,CSO80MANB,1,"none","none",1) 21 | #' avg(26,2,4,1,0.4,0.04,CSO80MANB,1,"none","none",1) 22 | #' avg(20,2,2,2,0.15,0.04,CSO80MANB,1,"constant","inter",1) 23 | #' avg(40,5,5,3,0.07,0.04,CSO80MANB,1,"constant","intra",1) 24 | #' avg(27,0,15,4,0.06,0.04,CSO80MANB,1,"UDD","inter",1) 25 | #' avg(34,7,12,6,0.03,0.04,CSO80MANB,1,"UDD","intra",1) 26 | #' 27 | 28 | 29 | 30 | avg<-function(x,h,n,k=1,r,i=0.04,data,prop=1,assumption="none",variation="none",cap=1){ 31 | dig<-getOption("digits") 32 | on.exit(options(digits = dig)) 33 | options(digits = 15) 34 | if(x>=0 && is_integer(x)==1 && h>=0 && is_integer(h)==1 && n>=0 && is_integer(n)==1 && k>=1 && is_integer(k)==1 && i>=0 && prop>0 && cap>0){ 35 | if(n==0){ 36 | avgxhn<-0 37 | } else if(k==1){ 38 | avgxhn<-0 39 | for(j in h:(h+n-1)){ 40 | avgxhn<-avgxhn+E(x,j,i,data,prop,"none",1)*(1+r)^(j-h) 41 | } 42 | } else{ 43 | if(assumption=="constant"){ 44 | if(variation=="inter"){ 45 | avgxhn<-0 46 | for(t in h:(h+n-1)){ 47 | for(s in 0:(k-1)){ 48 | avgxhn<-avgxhn+(1+r)^(t-h)*E(x,t,i,data,prop,"none",1)*E(x+t,s/k,i,data,prop,"constant",1)*(1/k) 49 | } 50 | } 51 | }else if(variation=="intra"){ 52 | avgxhn<-0 53 | for(t in h:(h+n-1)){ 54 | for(s in 0:(k-1)){ 55 | avgxhn<-avgxhn+(1+r)^((t-h)*k+s)*E(x,t,i,data,prop,assumption,1)*E(x+t,s/k,i,data,prop,"constant",1)*(1/k) 56 | } 57 | } 58 | } else{ 59 | stop("Check variation") 60 | } 61 | } else if(assumption=="UDD"){ 62 | if(variation=="inter"){ 63 | avgxhn<-0 64 | for(t in h:(h+n-1)){ 65 | for(s in 0:(k-1)){ 66 | avgxhn<-avgxhn+(1+r)^(t-h)*E(x,t,i,data,prop,assumption,1)*E(x+t,s/k,i,data,prop,"UDD",1)*(1/k) 67 | } 68 | } 69 | } else if(variation=="intra"){ 70 | avgxhn<-0 71 | for(t in h:(h+n-1)){ 72 | for(s in 0:(k-1)){ 73 | avgxhn<-avgxhn+(1+r)^((t-h)*k+s)*E(x,t,i,data,prop,assumption,1)*E(x+t,s/k,i,data,prop,"UDD",1)*(1/k) 74 | } 75 | } 76 | }else{ 77 | stop("Check variation") 78 | } 79 | } 80 | } 81 | avgxhn<-as.numeric(avgxhn) 82 | px1<-avgxhn*cap 83 | return(px1) 84 | } else { 85 | stop("Check values") 86 | } 87 | } 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /R/V_E.R: -------------------------------------------------------------------------------- 1 | #' @title Reserve Valuation for Pure Endowments 2 | 3 | #' @description Calculates the reserve for the Pure endowments up to the moment t. 4 | #' @param px A numeric value. The value of the premium paid in each period. 5 | #' @param x An integer. The age of the insuree. 6 | #' @param n The term of the endowment. An integer, for annual coverage, or a numeric for fractional coverage. 7 | #' @param cantprem An integer. The total number of premiums. 8 | #' @param premperyear An integer. The number of premiums to be paid per year. 9 | #' @param i The interest rate. A numeric type value. 10 | #' @param data A data.frame containing the mortality table, with the first column being the age and the second one, the probability of death. 11 | #' @param prop A numeric value. It represents the proportion of the mortality table used (between 0 and 1). 12 | #' @param assumption A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage). 13 | #' @param cap A numeric type value. The payment. 14 | #' @param t An integer. The moment of valuation (in months if it is a fractional coverage or in years if it is not). 15 | #' @export 16 | #' @keywords Reserve Pure Endowments 17 | #' @references Chapter 5 of Life Contingencies (1952) by Jordan, Chapter 11 of Actuarial Mathematics for Life Contingent Risks (2009) by Dickson, Hardy and Waters. 18 | #' @return A data frame with Premium, Risk, 1/E and reserve values up to the moment t. 19 | #' @examples 20 | #' V_E(663.501989747591,20,10,1,1,0.04,CSO80MANB,1,"none",1000,10) 21 | #' V_E(9383.64446819386/12,20,2,12,12,0.04,CSO80MANB,1,"constant",10000,24) 22 | #' V_E(9383.64446819386/12,20,2,12,12,0.04,CSO80MANB,1,"constant",10000,24) 23 | #' 24 | 25 | 26 | V_E<-function(px,x,n,cantprem=1,premperyear=1,i=0.04,data,prop=1,assumption="none",cap,t){ 27 | dig<-getOption("digits") 28 | on.exit(options(digits = dig)) 29 | options(digits = 15) 30 | reserve<-c() 31 | res<-0 32 | rown<-c() 33 | if(px>0 && x>=0 && is_integer(x)==1 && n>0 & cantprem>=1 && is_integer(cantprem)==1 && premperyear>=1 && premperyear<=12 && is_integer(premperyear)==1 && i>=0 && prop>0 && cap>0){ 34 | if(is_integer(n)==1 & premperyear==1){ 35 | if(t<=n){ 36 | for(j in 1:(t+1)){ 37 | risk<-0 38 | prem<-px 39 | if(j==(n+1)){ 40 | risk<-cap 41 | } 42 | if(j>cantprem){ 43 | prem<-0 44 | } 45 | res<-(res+prem-risk)*(E(x+j-1,1,i,data,prop,"none",1))^(-1) 46 | e<-(E(x+j-1,1,i,data,prop,"none",1))^(-1) 47 | reserve<-rbind(reserve,c(prem,risk,e,round(res,4))) 48 | rown<-c(rown,paste("Year",j)) 49 | } 50 | rownames(reserve)<-rown 51 | colnames(reserve)<-c("Premium","Risk","1/E","Reserve") 52 | } else{ 53 | stop("Check Year") 54 | } 55 | } else if(premperyear>=1) { 56 | if(t<=n*12){ 57 | Premiums_Paid<-0 58 | frac<-1 59 | for(s in 1:(t+1)){ 60 | risk<-0 61 | prem<-0 62 | age<-trunc((s-1)/12) 63 | if(s==(n*12+1)){ 64 | risk<-cap 65 | } 66 | if(contmeses(s,premperyear)==1 & Premiums_Paid=0 && is_integer(n)==1 && n>=0 && is_integer(k)==1 && i>=0 && prop>0){ 31 | if(n==0){ 32 | amxhn<-0 33 | }else if(type=="joint"){ 34 | if(assumption=="none"){ 35 | amxhn<-0 36 | for(j in h:(h+n-1)){ 37 | amxhn<-amxhn+Em(x,j,i,data,prop,"joint",quant,"none",1) 38 | } 39 | if(is.na(amxhn)==1){ 40 | amxhn<-0 41 | } 42 | } else if(assumption=="constant"){ 43 | amxhn<-am(x,h,n,1,i,data,prop,"joint")-((k-1)/(2*k))*(Em(x,h,i,data,prop,"joint")-Em(x,h+n,i,data,prop,"joint")) 44 | if(is.na(amxhn)==1){ 45 | amxhn<-0 46 | } 47 | }else if(assumption=="UDD"){ 48 | amxhn<-0 49 | for(j in h:(h+n-1)){ 50 | for(s in 0:(k-1)){ 51 | amxhn<-amxhn+(1/k)*Em(x,j+s/k,i,data,prop,"joint",quant,assumption="UDD",1) 52 | } 53 | } 54 | }else{ 55 | stop("Check assumption") 56 | } 57 | }else if(type=="exactly" && is_integer(quant)==1 && quant>0 && quant<=length(x)){ 58 | amxhn<-0 59 | for(g1 in quant:length(x)){ 60 | amxhn_partial<-0 61 | coeff<-ncol(utils::combn(g1,(g1-quant)))*(-1)^(g1-quant) 62 | combinations<-utils::combn(x,g1) 63 | for(g2 in 1:ncol(combinations)){ 64 | amxhn_partial<-amxhn_partial+am(combinations[,g2],h,n,k,i,data,prop,type="joint",quant,assumption,1) 65 | } 66 | amxhn<-amxhn+amxhn_partial*coeff 67 | } 68 | if(is.na(amxhn)==1){ 69 | amxhn<-0 70 | } 71 | }else if(type=="atleast" && is_integer(quant)==1 && quant>0 && quant<=length(x)){ 72 | amxhn<-0 73 | for(g1 in quant:length(x)){ 74 | amxhn_partial<-0 75 | coeff<-ncol(utils::combn(g1-1,(g1-quant)))*(-1)^(g1-quant) 76 | combinations<-utils::combn(x,g1) 77 | for(g2 in 1:ncol(combinations)){ 78 | amxhn_partial<-amxhn_partial+am(combinations[,g2],h,n,k,i,data,prop,type="joint",quant,assumption,1) 79 | } 80 | amxhn<-amxhn+amxhn_partial*coeff 81 | } 82 | if(is.na(amxhn)==1){ 83 | amxhn<-0 84 | } 85 | } else{ 86 | stop("Check type") 87 | } 88 | amxhn<-as.numeric(amxhn) 89 | px1<-amxhn*cap 90 | return(px1) 91 | } else{ 92 | stop("Check values") 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /R/V_a.R: -------------------------------------------------------------------------------- 1 | #' @title Reserve Valuation for Life Annuities 2 | 3 | #' @description Calculates the reserve for the life Annuity up to the moment 't'. 4 | #' @param px A numeric value. The value of the premium paid in each period. 5 | #' @param x An integer. The age of the insuree. 6 | #' @param h An integer. The deferral period. 7 | #' @param n An integer. Number of years of coverage. 8 | #' @param k An integer. Number of payments per year. 9 | #' @param cantprem An integer. The total number of premiums. 10 | #' @param premperyear An integer. The number of premiums to be paid per year. 11 | #' @param i The interest rate. A numeric type value. 12 | #' @param data A data.frame containing the mortality table, with the first column being the age and the second one, the probability of death. 13 | #' @param prop A numeric value. It represents the proportion of the mortality table used (between 0 and 1). 14 | #' @param assumption A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage). 15 | #' @param cap A numeric type value. The annualized value of the payment. 16 | #' @param t An integer. The moment of valuation (in months if it is a fractional coverage or in years if it is not). 17 | #' @export 18 | #' @references Chapter 5 of Life Contingencies (1952) by Jordan, Chapter 11 of Actuarial Mathematics for Life Contingent Risks (2009) by Dickson, Hardy and Waters. 19 | #' @keywords Reserve Life Annuities 20 | #' @return A data frame with Premium, Risk, 1/E and reserve values up to the moment t. 21 | #' @examples 22 | #' V_a(147.814202915034,20,5,10,1,5,1,0.04,CSO80MANB,1,"none",100,15) 23 | #' V_a(148.324902023591/12,20,5,10,4,60,12,0.04,CSO80MANB,1,"constant",100,178) 24 | #' V_a(223633.861110949,25,0,25,12,10,1,0.04,CSO80MANB,1,"UDD",120000,300) 25 | #' 26 | 27 | V_a<-function(px,x,h,n,k=1,cantprem=1,premperyear=1,i=0.04,data,prop=1,assumption="none",cap,t){ 28 | dig<-getOption("digits") 29 | on.exit(options(digits = dig)) 30 | options(digits = 15) 31 | reserve<-c() 32 | res<-0 33 | rown<-c() 34 | if(px>0 && x>=0 && is_integer(x)==1 && h>=0 && is_integer(h)==1 && n>0 && is_integer(n)==1 && k>=1 && is_integer(k)==1 && cantprem>=1 && is_integer(cantprem)==1 && premperyear>=1 && premperyear<=12 && is_integer(premperyear)==1 && i>=0 && prop>0 && cap>0){ 35 | if(k==1 && premperyear==1){ 36 | if(t<=(h+n)){ 37 | reserve<-c() 38 | res<-0 39 | for(j in 1:t){ 40 | risk<-0 41 | prem<-px 42 | if(j>h){ 43 | risk<-cap 44 | } 45 | if(j>cantprem){ 46 | prem<-0 47 | } 48 | res<-(res+prem-risk)*(E(x+j-1,1,i,data,prop,"none",1))^(-1) 49 | e<-(E(x+j-1,1,i,data,prop,"none",1))^(-1) 50 | reserve<-rbind(reserve,c(prem,risk,e,round(res,3))) 51 | rown<-c(rown,paste("Year",j)) 52 | } 53 | colnames(reserve)<-c("Premium","Risk","1/E","Reserve") 54 | rownames(reserve)<-rown 55 | } else { 56 | stop("Check Year") 57 | } 58 | } else if(k<=12){ 59 | if(t<=(h+n)*12){ 60 | Premiums_Paid<-0 61 | frac<-1 62 | for(s in 1:t){ 63 | risk<-0 64 | prem<-0 65 | age<-trunc((s-1)/12) 66 | if(s>h*12 & contmeses(s,k)==1){ 67 | risk<-(cap/k) 68 | } 69 | if(contmeses(s,premperyear)==1 & Premiums_Paid=0 && is_integer(x)==1 && h>=0 && is_integer(h)==1 && n>=0 && is_integer(n)==1 && k>=1 && is_integer(k)==1 && i>=0 && prop>0 && cap>0){ 35 | if(n==0){ 36 | Avxhn<-0 37 | } else if(k==1){ 38 | Avxhn<-0 39 | p<-Survival(x,h,data,prop) 40 | for(s in h:(h+n-1)){ 41 | if(x+s==(nrow(data)-1)){ 42 | prop<-1 43 | } 44 | Avxhn<-Avxhn+(1/(1+i))^(s+1)*(as.numeric(data[x+s+1,2])*prop)*p*(1+r*(s-h)) 45 | p<-p*(1-data[x+s+1,2]*prop) 46 | if(x+s==nrow(data)-1){ 47 | break 48 | } 49 | } 50 | } else{ 51 | if(assumption=="constant"){ 52 | if(variation=="inter"){ 53 | fk<-Rate_converter(i,"i",1,"f",k,"frac") 54 | Avxhn<-E(x,h,i,data,prop,"none",1)+r*a(x,h+1,n-1,1,i,data,prop,"none",1)-(1+(n-1)*r)*E(x,h+n,i,data,prop,"none",1)-fk*av(x,h,n,k,r,i,data,prop,"constant","inter",1) 55 | } else if(variation=="intra"){ 56 | Avxhn<-0 57 | v<-(1/(1+i)) 58 | ik<-Rate_converter(i,"i",1,"i",k,"frac") 59 | for(t in h:(h+n-1)){ 60 | for(s in 0:(k-1)){ 61 | q<-((1+i)^(s/k))*((1/k)*(1-E(x+t,1,i,data,prop,"none",1))*((s+1)*ik+1)-ik) 62 | Avxhn<-Avxhn+(1+(t-h)*k*r+s*r)*E(x,t,i,data,prop,"none",1)*q*v^((s+1)/k) 63 | } 64 | if(x+t==nrow(data)-1){ 65 | break 66 | } 67 | } 68 | } else { 69 | stop("Check variation") 70 | } 71 | } else if(assumption=="UDD"){ 72 | if(variation=="inter"){ 73 | jk<-Rate_converter(i,"i",1,"j",k,"frac") 74 | Avxhn<-(i/jk)*Av.(x,h,n,1,r,i,data,prop,"none","none",1) 75 | } else if(variation=="intra"){ 76 | Avxhn<-0 77 | v<-(1/(1+i)) 78 | for(t in h:(h+n-1)){ 79 | for(s in 0:(k-1)){ 80 | if(x+t==(nrow(data)-1)){ 81 | prop<-1 82 | } 83 | q<-((1/k)*data[x+t+1,2])*prop 84 | Avxhn<-Avxhn+(1+(t-h)*k*r+s*r)*E(x,t,i,data,prop,"none",1)*q*v^((s+1)/k) 85 | } 86 | if(x+t==nrow(data)-1){ 87 | break 88 | } 89 | } 90 | } else { 91 | stop("Check variation") 92 | } 93 | } else{ 94 | stop("Check assumption") 95 | } 96 | } 97 | Avxhn<-as.numeric(Avxhn) 98 | px1<-Avxhn*cap 99 | return(px1) 100 | } else { 101 | stop("Chack values") 102 | } 103 | } 104 | 105 | 106 | -------------------------------------------------------------------------------- /R/V_A..R: -------------------------------------------------------------------------------- 1 | #' @title Reserve for Life Insurance 2 | 3 | #' @description Calculates the reserve for the life insurance up to the moment 't'. 4 | #' @param px A numeric value. The value of the premium paid in each period. 5 | #' @param x An integer. The age of the insuree. 6 | #' @param h An integer. The deferral period. 7 | #' @param n An integer. Number of years of coverage. 8 | #' @param k An integer. Number of fractions per year. 9 | #' @param cantprem An integer. The total number of premiums. 10 | #' @param premperyear An integer. The number of premiums to be paid per year. 11 | #' @param i The interest rate. A numeric type value. 12 | #' @param data A data.frame containing the mortality table, with the first column being the age and the second one, the probability of death. 13 | #' @param prop A numeric value. It represents the proportion of the mortality table used (between 0 and 1). 14 | #' @param assumption A character string. The assumption used for fractional ages ("UDD" for uniform distribution of deaths, "constant" for constant force of mortality and "none" if there is no fractional coverage) 15 | #' @param cap A numeric type value. The value of the payment. 16 | #' @param t An integer. The moment of valuation (in months if it is a fractional coverage or in years if it is not). 17 | #' @export 18 | #' @references Chapter 5 of Life Contingencies (1952) by Jordan, Chapter 11 of Actuarial Mathematics for Life Contingent Risks (2009) by Dickson, Hardy and Waters. 19 | #' @keywords Reserve Life Insurance 20 | #' @return A data frame with Premium, Risk, 1/E and reserve values up to the moment t. 21 | #' @examples 22 | #' V_A.(26673.3602688847,25,2,3,1,2,1,0.04,CSO80MANB,1,"none",12000000,5) 23 | #' V_A.(27446.2077993839/12,25,2,3,2,24,12,0.04,CSO80MANB,1,"UDD",12000000,60) 24 | #' V_A.(27376.5521158244/12,25,2,3,2,24,12,0.04,CSO80MANB,1,"constant",12000000,60) 25 | #' 26 | 27 | 28 | V_A.<-function(px,x,h,n,k=1,cantprem=1,premperyear=1,i=0.04,data,prop=1,assumption="none",cap,t){ 29 | dig<-getOption("digits") 30 | on.exit(options(digits = dig)) 31 | options(digits = 15) 32 | reserve<-c() 33 | res<-0 34 | rown<-c() 35 | if(px>0 && x>=0 && is_integer(x)==1 && h>=0 && is_integer(h)==1 && n>0 && is_integer(n)==1 && k>=1 && is_integer(k)==1 && cantprem>=1 && is_integer(cantprem)==1 && premperyear>=1 && premperyear<=12 && is_integer(premperyear)==1 && i>=0 && prop>0 && cap>0){ 36 | if(k==1 && premperyear==1){ 37 | if(t<=(n+h)){ 38 | for(j in 1:t){ 39 | risk<-0 40 | prem<-px 41 | if(j>h){ 42 | risk<-A.(x+j-1,0,1,1,i,data,prop,"none",1)*cap 43 | } 44 | if(j>cantprem){ 45 | prem<-0 46 | } 47 | res<-(res+prem-risk)*(E(x+j-1,1,i,data,prop,"none",1))^(-1) 48 | e<-(E(x+j-1,1,i,data,prop,"none",1))^(-1) 49 | reserve<-rbind(reserve,c(prem,risk,e,round(res,3))) 50 | rown<-c(rown,paste("Year",j)) 51 | } 52 | colnames(reserve)<-c("Premium","Risk","1/E","Reserve") 53 | rownames(reserve)<-rown 54 | } else{ 55 | stop("Check Year") 56 | } 57 | }else if(k<=12){ 58 | if(t<=(h+n)*12){ 59 | Premiums_Paid<-0 60 | row<-c() 61 | frac<-1 62 | v<-1/(1+i) 63 | Payment_Period<-12/k 64 | Elapsed_t_Payment<-0 65 | deferral<-0 66 | for(s in 1:t){ 67 | risk<-0 68 | prem<-0 69 | age<-trunc((s-1)/12) 70 | if(s>h*12 ){ 71 | risk<-(cap)*qfrac(x+age,deferral,12,i,data,assumption,prop)*v^((Payment_Period-Elapsed_t_Payment)/12) 72 | deferral<-deferral+1 73 | Elapsed_t_Payment<-Elapsed_t_Payment+1 74 | } 75 | if(contmeses(s,premperyear)==1 & Premiums_Paid