Skip to content

Commit

Permalink
update package for Julia 1.0/0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
alecloudenback committed Sep 1, 2018
1 parent 773243c commit 572fd43
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ActuarialScience - v0.0.3
# ActuarialScience - v0.0.4
## A new actuarial modeling library

#### Code Review: [![Build Status](https://travis-ci.org/alecloudenback/ActuarialScience.jl.svg?branch=master)](https://travis-ci.org/alecloudenback/ActuarialScience.jl) [![Coverage Status](https://coveralls.io/repos/github/alecloudenback/ActuarialScience.jl/badge.svg?branch=master)](https://coveralls.io/github/alecloudenback/ActuarialScience.jl?branch=master) [![codecov.io](http://codecov.io/github/alecloudenback/ActuarialScience.jl/coverage.svg?branch=master)](http://codecov.io/github/alecloudenback/ActuarialScience.jl?branch=master)
Expand Down
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
julia 0.5
julia 0.7
Distributions
6 changes: 3 additions & 3 deletions src/ActuarialScience.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ include("mortality.jl")


# 'actuarial objects' that combine multiple forms of decrements (lapse, interest, death, etc)
abstract AbstractActuarial
abstract type AbstractActuarial end

type ActuarialHelper
mutable struct ActuarialHelper
mort::MortalityTable
int::InterestRate
end

type LifeInsurance <: AbstractActuarial
mutable struct LifeInsurance <: AbstractActuarial
ah::ActuarialHelper

function LifeInsurance(mt::MortalityTable,int::InterestRate)
Expand Down
2 changes: 1 addition & 1 deletion src/decrement.jl
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# type for mortality, lapse, etc
abstract Decrement
abstract type Decrement end
4 changes: 2 additions & 2 deletions src/interest.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
include("decrement.jl")

typealias ixVector Vector{Float64}
const ixVector = Vector{Float64}

type InterestRate <: Decrement
mutable struct InterestRate <: Decrement
ix::Vector{Float64}
ifx
# constructor with a predefined vector
Expand Down
6 changes: 3 additions & 3 deletions src/mortality.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
include("decrement.jl")

typealias qxVector Vector{Float64}
const qxVector = Vector{Float64}


maleMort = [0.00699,0.000447,0.000301,0.000233,0.000177,0.000161,0.00015,0.000139,0.000123,0.000105,0.000091,0.000096,0.000135,0.000217,0.000332,0.000456,0.000579,0.000709,0.000843,0.000977,0.001118,0.00125,0.001342,0.001382,0.001382,0.00137,0.001364,0.001362,0.001373,0.001393,0.001419,0.001445,0.001478,0.001519,0.001569,0.001631,0.001709,0.001807,0.001927,0.00207,0.002234,0.00242,0.002628,0.00286,0.003117,0.003396,0.003703,0.004051,0.004444,0.004878,0.005347,0.005838,0.006337,0.006837,0.007347,0.007905,0.008508,0.009116,0.009723,0.010354,0.011046,0.011835,0.012728,0.013743,0.014885,0.016182,0.017612,0.019138,0.020752,0.022497,0.024488,0.026747,0.029212,0.031885,0.034832,0.038217,0.042059,0.046261,0.050826,0.055865,0.06162,0.068153,0.075349,0.08323,0.091933,0.101625,0.112448,0.124502,0.137837,0.152458,0.168352,0.185486,0.203817,0.223298,0.243867,0.264277,0.284168,0.303164,0.320876,0.336919,0.353765,0.371454,0.390026,0.409528,0.430004,0.451504,0.474079,0.497783,0.522673,0.548806,0.576246,0.605059,0.635312,0.667077,0.700431,0.735453,0.772225,0.810837,0.851378,0.893947]

femaleMort = [0.005728,0.000373,0.000241,0.000186,0.00015,0.000133,0.000121,0.000112,0.000104,0.000098,0.000094,0.000098,0.000114,0.000143,0.000183,0.000229,0.000274,0.000314,0.000347,0.000374,0.000402,0.000431,0.000458,0.000482,0.000504,0.000527,0.000551,0.000575,0.000602,0.00063,0.000662,0.000699,0.000739,0.00078,0.000827,0.000879,0.000943,0.00102,0.001114,0.001224,0.001345,0.001477,0.001624,0.001789,0.001968,0.002161,0.002364,0.002578,0.0028,0.003032,0.003289,0.003559,0.003819,0.004059,0.004296,0.004556,0.004862,0.005222,0.005646,0.006136,0.006696,0.007315,0.007976,0.008676,0.009435,0.010298,0.011281,0.01237,0.013572,0.014908,0.01644,0.018162,0.020019,0.022003,0.024173,0.026706,0.029603,0.032718,0.036034,0.039683,0.043899,0.048807,0.054374,0.060661,0.067751,0.075729,0.084673,0.094645,0.105694,0.117853,0.131146,0.145585,0.161175,0.17791,0.195774,0.213849,0.231865,0.249525,0.266514,0.282504,0.299455,0.317422,0.336467,0.356655,0.378055,0.400738,0.424782,0.450269,0.477285,0.505922,0.536278,0.568454,0.602561,0.638715,0.677038,0.71766,0.76072,0.806363,0.851378,0.893947]

type MortalityTable <: Decrement
mutable struct MortalityTable <: Decrement
qx::Vector{Float64}
lx::Vector{Float64}

Expand Down Expand Up @@ -78,6 +78,6 @@ end
# the curtate life expectancy from age x
function ex(mt::MortalityTable,x)
try return sum(mt.lx[x+1:end])/mt.lx[x+1] + 0.5
catch return 0.0
catch; return 0.0
end
end
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using ActuarialScience
using Base.Test
using Test
using Distributions

# assumes embedded 'testMort' table
Expand Down

0 comments on commit 572fd43

Please sign in to comment.