diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 1b4986d..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/.nojekyll b/.nojekyll index 24b5959..c189377 100644 --- a/.nojekyll +++ b/.nojekyll @@ -1 +1 @@ -d30be338 \ No newline at end of file +c29156c2 \ No newline at end of file diff --git a/all-posts.html b/all-posts.html index fa0a99a..d86d3b4 100644 --- a/all-posts.html +++ b/all-posts.html @@ -243,7 +243,7 @@
Categories
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+

 
diff --git a/all-posts.xml b/all-posts.xml index 12b2e1c..eb262f2 100644 --- a/all-posts.xml +++ b/all-posts.xml @@ -2100,7 +2100,7 @@ using Pluto; Pluto.run() financemodels assets https://JuliaActuary.org/posts/cashflow-interactive/ - Mon, 17 Jun 2024 03:38:21 GMT + Tue, 18 Jun 2024 03:41:32 GMT Universal Life Policy Account Mechanics as a Differential Equation @@ -2588,7 +2588,7 @@ annotate!(viz[2], (0.055, 7000, Plots.text("Doesn't lapse \nbefore age 100", 8, actuaryutilities tutorial https://JuliaActuary.org/posts/policy-diffeq/ - Mon, 17 Jun 2024 03:38:21 GMT + Tue, 18 Jun 2024 03:41:32 GMT US Treasury Comparison Tool @@ -2626,7 +2626,7 @@ using Pluto; Pluto.run() financemodels tutorial https://JuliaActuary.org/posts/treasury-interactive/ - Mon, 17 Jun 2024 03:38:21 GMT + Tue, 18 Jun 2024 03:41:32 GMT Bayesian Markov-Chain-Monte-Carlo and Claims Data @@ -6973,7 +6973,7 @@ Quantiles statistics bayesian https://JuliaActuary.org/posts/bayesian-claims-demo/ - Mon, 17 Jun 2024 03:38:21 GMT + Tue, 18 Jun 2024 03:41:32 GMT Nested Projection Mechanics @@ -8187,7 +8187,7 @@ end actuaryutilities tutorial https://JuliaActuary.org/posts/nested-policy-projections/ - Mon, 17 Jun 2024 03:38:21 GMT + Tue, 18 Jun 2024 03:41:32 GMT Using MortaltiyTables.jl with DataFrames @@ -8820,7 +8820,7 @@ sample_data dataframes tutorial https://JuliaActuary.org/posts/mortalitytables-and-dataframes/ - Mon, 17 Jun 2024 03:38:21 GMT + Tue, 18 Jun 2024 03:41:32 GMT Poisson approximation to Binomial @@ -9032,7 +9032,7 @@ end statistics experience-analysis https://JuliaActuary.org/posts/poisson-approximation/ - Mon, 17 Jun 2024 03:38:21 GMT + Tue, 18 Jun 2024 03:41:32 GMT Bayesian vs Limited Fluctuation Experience Analysis @@ -10156,7 +10156,7 @@ end statistics experience-analysis https://JuliaActuary.org/posts/bayes-vs-limited-fluctuation/ - Mon, 17 Jun 2024 03:38:21 GMT + Tue, 18 Jun 2024 03:41:32 GMT Fitting Rate Data to Yield Curves @@ -10394,7 +10394,7 @@ gif(anim, "anim_fps2.gif", fps=2) financemodels tutorial https://JuliaActuary.org/posts/fitting-yield-curves/ - Mon, 17 Jun 2024 03:38:21 GMT + Tue, 18 Jun 2024 03:41:32 GMT Fitting survival data with MortaltityTables.jl @@ -10876,7 +10876,7 @@ plot!(plt2, km.events.time, model(km.events.time, mfit.param), labels="Theoretic survival tutorial https://JuliaActuary.org/posts/fitting-survival-data/ - Mon, 17 Jun 2024 03:38:21 GMT + Tue, 18 Jun 2024 03:41:32 GMT Interactive AAA Economic Scenario Generator @@ -10920,7 +10920,7 @@ using Pluto; Pluto.run() modeling scenario-generator https://JuliaActuary.org/posts/academy-generator-rates/ - Mon, 17 Jun 2024 03:38:21 GMT + Tue, 18 Jun 2024 03:41:32 GMT Stochastic claims projections demo @@ -11187,7 +11187,7 @@ hist(v, benchmark tutorial https://JuliaActuary.org/posts/stochastic-mortality/ - Mon, 17 Jun 2024 03:38:21 GMT + Tue, 18 Jun 2024 03:41:32 GMT Exposure Calculation with ExperienceAnalysis.jl @@ -11471,7 +11471,7 @@ df[:, [:exposure, :exposure_fraction]] dataframes tutorial https://JuliaActuary.org/posts/exposures-example/ - Mon, 17 Jun 2024 03:38:21 GMT + Tue, 18 Jun 2024 03:41:32 GMT diff --git a/assets/.DS_Store b/assets/.DS_Store deleted file mode 100644 index 9747988..0000000 Binary files a/assets/.DS_Store and /dev/null differ diff --git a/benchmarks.html b/benchmarks.html index a16d7c6..c589cc6 100644 --- a/benchmarks.html +++ b/benchmarks.html @@ -242,6 +242,9 @@

Benchmarks

After the original user submitted a proposal, others chimed in and submitted versions in their favorite languages. I have collected those versions, and run them on a consistent set of hardware.

Some submissions were excluded because from the benchmarks they involved an entirely different approach, such as memoizing the function calls[^1].

+
+
[ Info: Precompiling CSV [336ed68f-0bac-5ca0-87d4-7b16caf5d00b]
+
@@ -450,84 +453,84 @@

Benchmarks

- + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Figure 1 diff --git a/blog.html b/blog.html index 292e495..5f47833 100644 --- a/blog.html +++ b/blog.html @@ -243,7 +243,7 @@
Categories
-
+
-
+
-
+
-
+
-
+
-
+
-
+

 
diff --git a/examples.html b/examples.html index b8504a1..42059c7 100644 --- a/examples.html +++ b/examples.html @@ -262,7 +262,7 @@
Categories
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+

diff --git a/examples/.DS_Store b/examples/.DS_Store deleted file mode 100644 index a831363..0000000 Binary files a/examples/.DS_Store and /dev/null differ diff --git a/packages.html b/packages.html index 82d53f9..db0e548 100644 --- a/packages.html +++ b/packages.html @@ -181,7 +181,7 @@

On this page

  • ExperienceAnalysis.jl
  • EconomicScenarioGenerators.jl @@ -689,20 +689,131 @@

    ExperienceAnalysis.j

    Meeting your exposure calculation needs.

    -

    QuickStart

    -
    using ExperienceAnalysis
    -using Dates
    +

    Quickstart

    +
    df = DataFrame(
    +    policy_id = 1:3,
    +    issue_date = [Date(2020,5,10), Date(2020,4,5), Date(2019, 3, 10)],
    +    end_date = [Date(2022, 6, 10), Date(2022, 8, 10), Date(2022,12,31)],
    +    status = ["claim", "lapse", "inforce"]
    +)
    +
    +df.policy_year = exposure.(
    +    ExperienceAnalysis.Anniversary(Year(1)),
    +    df.issue_date,
    +    df.end_date,
    +    df.status .== "claim"; # continued exposure
    +    study_start = Date(2020, 1, 1),
    +    study_end = Date(2022, 12, 31)
    +)
    +
    +df = flatten(df, :policy_year)
     
    -issue = Date(2016, 7, 4)
    -termination = Date(2020, 1, 17)
    -basis = ExperienceAnalysis.Anniversary(Year(1))
    -exposure(basis, issue, termination)
    -

    This will return an array of tuples with a from and to date:

    -
    4-element Array{NamedTuple{(:from, :to),Tuple{Date,Date}},1}:
    - (from = Date("2016-07-04"), to = Date("2017-07-04"))
    - (from = Date("2017-07-04"), to = Date("2018-07-04"))
    - (from = Date("2018-07-04"), to = Date("2019-07-04"))
    - (from = Date("2019-07-04"), to = Date("2020-01-17"))
    +df.exposure_fraction = + map(e -> yearfrac(e.from, e.to + Day(1), DayCounts.Thirty360()), df.policy_year) +# + Day(1) above because DayCounts has Date(2020, 1, 1) to Date(2021, 1, 1) as an exposure of 1.0 +# here we end the interval at Date(2020, 12, 31), so we need to add a day to get the correct exposure fraction.
    + ++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    policy_id
    Int64
    issue_date
    Date
    end_date
    Date
    status
    String
    policy_year
    @NamedTuple{from::Date, to::Date, policy\_timestep::Int64}
    exposure_fraction
    Float64
    12020-05-102022-06-10claim(from = Date(“2020-05-10”), to = Date(“2021-05-09”), policy_timestep = 1)1.0
    12020-05-102022-06-10claim(from = Date(“2021-05-10”), to = Date(“2022-05-09”), policy_timestep = 2)1.0
    12020-05-102022-06-10claim(from = Date(“2022-05-10”), to = Date(“2023-05-09”), policy_timestep = 3)1.0
    22020-04-052022-08-10lapse(from = Date(“2020-04-05”), to = Date(“2021-04-04”), policy_timestep = 1)1.0
    22020-04-052022-08-10lapse(from = Date(“2021-04-05”), to = Date(“2022-04-04”), policy_timestep = 2)1.0
    22020-04-052022-08-10lapse(from = Date(“2022-04-05”), to = Date(“2022-08-10”), policy_timestep = 3)0.35
    32019-03-102022-12-31inforce(from = Date(“2020-01-01”), to = Date(“2020-03-09”), policy_timestep = 1)0.191667
    32019-03-102022-12-31inforce(from = Date(“2020-03-10”), to = Date(“2021-03-09”), policy_timestep = 2)1.0
    32019-03-102022-12-31inforce(from = Date(“2021-03-10”), to = Date(“2022-03-09”), policy_timestep = 3)1.0
    32019-03-102022-12-31inforce(from = Date(“2022-03-10”), to = Date(“2022-12-31”), policy_timestep = 4)0.808333

    Available Exposure Basis

    diff --git a/posts/.DS_Store b/posts/.DS_Store deleted file mode 100644 index 077930a..0000000 Binary files a/posts/.DS_Store and /dev/null differ diff --git a/posts/bayesian-claims-demo/index_files/.DS_Store b/posts/bayesian-claims-demo/index_files/.DS_Store deleted file mode 100644 index ee1b099..0000000 Binary files a/posts/bayesian-claims-demo/index_files/.DS_Store and /dev/null differ diff --git a/posts/policy-diffeq/index_files/.DS_Store b/posts/policy-diffeq/index_files/.DS_Store deleted file mode 100644 index 3df5906..0000000 Binary files a/posts/policy-diffeq/index_files/.DS_Store and /dev/null differ diff --git a/search.json b/search.json index 73a2d73..3f118ec 100644 --- a/search.json +++ b/search.json @@ -53,7 +53,7 @@ "href": "packages.html#experienceanalysis.jl", "title": "Packages", "section": "ExperienceAnalysis.jl", - "text": "ExperienceAnalysis.jl\n\nMeeting your exposure calculation needs.\n\n\nQuickStart\nusing ExperienceAnalysis\nusing Dates\n\nissue = Date(2016, 7, 4)\ntermination = Date(2020, 1, 17)\nbasis = ExperienceAnalysis.Anniversary(Year(1))\nexposure(basis, issue, termination)\nThis will return an array of tuples with a from and to date:\n4-element Array{NamedTuple{(:from, :to),Tuple{Date,Date}},1}:\n (from = Date(\"2016-07-04\"), to = Date(\"2017-07-04\"))\n (from = Date(\"2017-07-04\"), to = Date(\"2018-07-04\"))\n (from = Date(\"2018-07-04\"), to = Date(\"2019-07-04\"))\n (from = Date(\"2019-07-04\"), to = Date(\"2020-01-17\"))\n\n\nAvailable Exposure Basis\n\nExperienceAnalysis.Anniversary(period) will give exposures periods based on the first date\nExperienceAnalysis.Calendar(period) will follow calendar periods (e.g. month or year)\nExperienceAnalysis.AnniversaryCalendar(period,period) will split into the smaller of the calendar or policy period.\n\nWhere period is a Period Type from the Dates standard library.\nCalculate exposures with exposures(basis,from,to,continue_exposure).\n\ncontinue_exposures indicates whether the exposure should be extended through the full exposure period rather than terminate at the to date.\n\nExperienceAnalysis package on GitHub 🡭" + "text": "ExperienceAnalysis.jl\n\nMeeting your exposure calculation needs.\n\n\nQuickstart\ndf = DataFrame(\n policy_id = 1:3,\n issue_date = [Date(2020,5,10), Date(2020,4,5), Date(2019, 3, 10)],\n end_date = [Date(2022, 6, 10), Date(2022, 8, 10), Date(2022,12,31)],\n status = [\"claim\", \"lapse\", \"inforce\"]\n)\n\ndf.policy_year = exposure.(\n ExperienceAnalysis.Anniversary(Year(1)),\n df.issue_date,\n df.end_date,\n df.status .== \"claim\"; # continued exposure\n study_start = Date(2020, 1, 1),\n study_end = Date(2022, 12, 31)\n)\n\ndf = flatten(df, :policy_year)\n\ndf.exposure_fraction =\n map(e -> yearfrac(e.from, e.to + Day(1), DayCounts.Thirty360()), df.policy_year) \n# + Day(1) above because DayCounts has Date(2020, 1, 1) to Date(2021, 1, 1) as an exposure of 1.0\n# here we end the interval at Date(2020, 12, 31), so we need to add a day to get the correct exposure fraction.\n\n\n\n\n\n\n\n\n\n\n\npolicy_idInt64\nissue_dateDate\nend_dateDate\nstatusString\npolicy_year@NamedTuple{from::Date, to::Date, policy\\_timestep::Int64}\nexposure_fractionFloat64\n\n\n\n\n1\n2020-05-10\n2022-06-10\nclaim\n(from = Date(“2020-05-10”), to = Date(“2021-05-09”), policy_timestep = 1)\n1.0\n\n\n1\n2020-05-10\n2022-06-10\nclaim\n(from = Date(“2021-05-10”), to = Date(“2022-05-09”), policy_timestep = 2)\n1.0\n\n\n1\n2020-05-10\n2022-06-10\nclaim\n(from = Date(“2022-05-10”), to = Date(“2023-05-09”), policy_timestep = 3)\n1.0\n\n\n2\n2020-04-05\n2022-08-10\nlapse\n(from = Date(“2020-04-05”), to = Date(“2021-04-04”), policy_timestep = 1)\n1.0\n\n\n2\n2020-04-05\n2022-08-10\nlapse\n(from = Date(“2021-04-05”), to = Date(“2022-04-04”), policy_timestep = 2)\n1.0\n\n\n2\n2020-04-05\n2022-08-10\nlapse\n(from = Date(“2022-04-05”), to = Date(“2022-08-10”), policy_timestep = 3)\n0.35\n\n\n3\n2019-03-10\n2022-12-31\ninforce\n(from = Date(“2020-01-01”), to = Date(“2020-03-09”), policy_timestep = 1)\n0.191667\n\n\n3\n2019-03-10\n2022-12-31\ninforce\n(from = Date(“2020-03-10”), to = Date(“2021-03-09”), policy_timestep = 2)\n1.0\n\n\n3\n2019-03-10\n2022-12-31\ninforce\n(from = Date(“2021-03-10”), to = Date(“2022-03-09”), policy_timestep = 3)\n1.0\n\n\n3\n2019-03-10\n2022-12-31\ninforce\n(from = Date(“2022-03-10”), to = Date(“2022-12-31”), policy_timestep = 4)\n0.808333\n\n\n\n\n\nAvailable Exposure Basis\n\nExperienceAnalysis.Anniversary(period) will give exposures periods based on the first date\nExperienceAnalysis.Calendar(period) will follow calendar periods (e.g. month or year)\nExperienceAnalysis.AnniversaryCalendar(period,period) will split into the smaller of the calendar or policy period.\n\nWhere period is a Period Type from the Dates standard library.\nCalculate exposures with exposures(basis,from,to,continue_exposure).\n\ncontinue_exposures indicates whether the exposure should be extended through the full exposure period rather than terminate at the to date.\n\nExperienceAnalysis package on GitHub 🡭" }, { "objectID": "packages.html#economicscenariogenerators.jl", @@ -970,14 +970,14 @@ "href": "benchmarks.html", "title": "Benchmarks", "section": "", - "text": "Inspired by the discussion in the ActuarialOpenSource GitHub community discussion, folks started submitted solutions to what someone referred to as the “Life Modeling Problem”. This user submitted a short snippet for consideration of a representative problem.\n\n\nAfter the original user submitted a proposal, others chimed in and submitted versions in their favorite languages. I have collected those versions, and run them on a consistent set of hardware.\nSome submissions were excluded because from the benchmarks they involved an entirely different approach, such as memoizing the function calls[^1].\n\n\n\n\nTable 1: Benchmarks for the Life Modeling Problem in nanoseconds (lower times are better).\n\n\n\n18×6 DataFrame\n\n\n\nRow\nlang\nalgorithm\nfunction_name\nmedian\nmean\nrelative_mean\n\n\n\nString15\nString15\nString15\nFloat64?\nFloat64\nFloat64\n\n\n\n\n1\nJulia\nAccumulator\nnpv9\n6.388\n6.375\n1.0\n\n\n2\nRust\nAccumulator\nnpv3\n7.0\n7.0\n1.09804\n\n\n3\nJulia\nAccumulator\nnpv8\n7.372\n7.375\n1.15686\n\n\n4\nJulia\nAccumulator\nnpv7\n7.92\n7.917\n1.24188\n\n\n5\nJulia\nAccumulator\nnpv6\n9.037\n9.009\n1.41318\n\n\n6\nJulia\nAccumulator\nnpv4\n10.764\n10.761\n1.688\n\n\n7\nJulia\nAccumulator\nnpv5\n11.49\n11.469\n1.79906\n\n\n8\nRust\nAccumulator\nnpv2\n14.0\n14.0\n2.19608\n\n\n9\nJulia\nAccumulator\nnpv3\n14.507\n14.487\n2.27247\n\n\n10\nRust\nAccumulator\nnpv1\n22.0\n22.0\n3.45098\n\n\n11\nJulia\nVectorized\nnpv2\n235.758\n218.391\n34.2574\n\n\n12\nJulia\nVectorized\nnpv1\n235.322\n228.198\n35.7958\n\n\n13\nPython (Numba)\nAccumulator\nnpv_numba\nmissing\n626.0\n98.1961\n\n\n14\nPython\nAccumulator\nnpv_loop\nmissing\n2314.0\n362.98\n\n\n15\nPython (NumPy)\nVectorized\nnpv\nmissing\n14261.0\n2237.02\n\n\n16\nR\nVectorized\nnpv base\n4264.0\n46617.0\n7312.47\n\n\n17\nR\nAccumulator\nnpv_loop\n4346.0\n62275.7\n9768.74\n\n\n18\nR (data.table)\nVectorized\nnpv\n770554.0\n8.42767e5\n1.32199e5\n\n\n\n\n\n\n\n\n\nTo aid in visualizing results with such vast different orders of magnitude, this graph includes a physical length comparison to serve as a reference. The computation time is represented by the distance that light travels in the time for the computation to complete (comparing a nanosecond to one foot length goes at least back to Admiral Grace Hopper).\n\n\n\n\n\n\n\n \n \n \n\n\n\n \n \n \n\n\n\n \n \n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nFigure 1\n\n\n\n\n\n\n\nFor more a more in-depth discussion of these results, see this post.\nAll of the benchmarked code can be found in the JuliaActuary Learn repository. Please file an issue or submit a PR request there for issues/suggestions." + "text": "Inspired by the discussion in the ActuarialOpenSource GitHub community discussion, folks started submitted solutions to what someone referred to as the “Life Modeling Problem”. This user submitted a short snippet for consideration of a representative problem.\n\n\nAfter the original user submitted a proposal, others chimed in and submitted versions in their favorite languages. I have collected those versions, and run them on a consistent set of hardware.\nSome submissions were excluded because from the benchmarks they involved an entirely different approach, such as memoizing the function calls[^1].\n\n\n[ Info: Precompiling CSV [336ed68f-0bac-5ca0-87d4-7b16caf5d00b]\n\n\n\n\nTable 1: Benchmarks for the Life Modeling Problem in nanoseconds (lower times are better).\n\n\n\n18×6 DataFrame\n\n\n\nRow\nlang\nalgorithm\nfunction_name\nmedian\nmean\nrelative_mean\n\n\n\nString15\nString15\nString15\nFloat64?\nFloat64\nFloat64\n\n\n\n\n1\nJulia\nAccumulator\nnpv9\n6.388\n6.375\n1.0\n\n\n2\nRust\nAccumulator\nnpv3\n7.0\n7.0\n1.09804\n\n\n3\nJulia\nAccumulator\nnpv8\n7.372\n7.375\n1.15686\n\n\n4\nJulia\nAccumulator\nnpv7\n7.92\n7.917\n1.24188\n\n\n5\nJulia\nAccumulator\nnpv6\n9.037\n9.009\n1.41318\n\n\n6\nJulia\nAccumulator\nnpv4\n10.764\n10.761\n1.688\n\n\n7\nJulia\nAccumulator\nnpv5\n11.49\n11.469\n1.79906\n\n\n8\nRust\nAccumulator\nnpv2\n14.0\n14.0\n2.19608\n\n\n9\nJulia\nAccumulator\nnpv3\n14.507\n14.487\n2.27247\n\n\n10\nRust\nAccumulator\nnpv1\n22.0\n22.0\n3.45098\n\n\n11\nJulia\nVectorized\nnpv2\n235.758\n218.391\n34.2574\n\n\n12\nJulia\nVectorized\nnpv1\n235.322\n228.198\n35.7958\n\n\n13\nPython (Numba)\nAccumulator\nnpv_numba\nmissing\n626.0\n98.1961\n\n\n14\nPython\nAccumulator\nnpv_loop\nmissing\n2314.0\n362.98\n\n\n15\nPython (NumPy)\nVectorized\nnpv\nmissing\n14261.0\n2237.02\n\n\n16\nR\nVectorized\nnpv base\n4264.0\n46617.0\n7312.47\n\n\n17\nR\nAccumulator\nnpv_loop\n4346.0\n62275.7\n9768.74\n\n\n18\nR (data.table)\nVectorized\nnpv\n770554.0\n8.42767e5\n1.32199e5\n\n\n\n\n\n\n\n\n\nTo aid in visualizing results with such vast different orders of magnitude, this graph includes a physical length comparison to serve as a reference. The computation time is represented by the distance that light travels in the time for the computation to complete (comparing a nanosecond to one foot length goes at least back to Admiral Grace Hopper).\n\n\n\n\n\n\n\n \n \n \n\n\n\n \n \n \n\n\n\n \n \n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nFigure 1\n\n\n\n\n\n\n\nFor more a more in-depth discussion of these results, see this post.\nAll of the benchmarked code can be found in the JuliaActuary Learn repository. Please file an issue or submit a PR request there for issues/suggestions." }, { "objectID": "benchmarks.html#the-life-modeling-problem", "href": "benchmarks.html#the-life-modeling-problem", "title": "Benchmarks", "section": "", - "text": "Inspired by the discussion in the ActuarialOpenSource GitHub community discussion, folks started submitted solutions to what someone referred to as the “Life Modeling Problem”. This user submitted a short snippet for consideration of a representative problem.\n\n\nAfter the original user submitted a proposal, others chimed in and submitted versions in their favorite languages. I have collected those versions, and run them on a consistent set of hardware.\nSome submissions were excluded because from the benchmarks they involved an entirely different approach, such as memoizing the function calls[^1].\n\n\n\n\nTable 1: Benchmarks for the Life Modeling Problem in nanoseconds (lower times are better).\n\n\n\n18×6 DataFrame\n\n\n\nRow\nlang\nalgorithm\nfunction_name\nmedian\nmean\nrelative_mean\n\n\n\nString15\nString15\nString15\nFloat64?\nFloat64\nFloat64\n\n\n\n\n1\nJulia\nAccumulator\nnpv9\n6.388\n6.375\n1.0\n\n\n2\nRust\nAccumulator\nnpv3\n7.0\n7.0\n1.09804\n\n\n3\nJulia\nAccumulator\nnpv8\n7.372\n7.375\n1.15686\n\n\n4\nJulia\nAccumulator\nnpv7\n7.92\n7.917\n1.24188\n\n\n5\nJulia\nAccumulator\nnpv6\n9.037\n9.009\n1.41318\n\n\n6\nJulia\nAccumulator\nnpv4\n10.764\n10.761\n1.688\n\n\n7\nJulia\nAccumulator\nnpv5\n11.49\n11.469\n1.79906\n\n\n8\nRust\nAccumulator\nnpv2\n14.0\n14.0\n2.19608\n\n\n9\nJulia\nAccumulator\nnpv3\n14.507\n14.487\n2.27247\n\n\n10\nRust\nAccumulator\nnpv1\n22.0\n22.0\n3.45098\n\n\n11\nJulia\nVectorized\nnpv2\n235.758\n218.391\n34.2574\n\n\n12\nJulia\nVectorized\nnpv1\n235.322\n228.198\n35.7958\n\n\n13\nPython (Numba)\nAccumulator\nnpv_numba\nmissing\n626.0\n98.1961\n\n\n14\nPython\nAccumulator\nnpv_loop\nmissing\n2314.0\n362.98\n\n\n15\nPython (NumPy)\nVectorized\nnpv\nmissing\n14261.0\n2237.02\n\n\n16\nR\nVectorized\nnpv base\n4264.0\n46617.0\n7312.47\n\n\n17\nR\nAccumulator\nnpv_loop\n4346.0\n62275.7\n9768.74\n\n\n18\nR (data.table)\nVectorized\nnpv\n770554.0\n8.42767e5\n1.32199e5\n\n\n\n\n\n\n\n\n\nTo aid in visualizing results with such vast different orders of magnitude, this graph includes a physical length comparison to serve as a reference. The computation time is represented by the distance that light travels in the time for the computation to complete (comparing a nanosecond to one foot length goes at least back to Admiral Grace Hopper).\n\n\n\n\n\n\n\n \n \n \n\n\n\n \n \n \n\n\n\n \n \n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nFigure 1\n\n\n\n\n\n\n\nFor more a more in-depth discussion of these results, see this post.\nAll of the benchmarked code can be found in the JuliaActuary Learn repository. Please file an issue or submit a PR request there for issues/suggestions." + "text": "Inspired by the discussion in the ActuarialOpenSource GitHub community discussion, folks started submitted solutions to what someone referred to as the “Life Modeling Problem”. This user submitted a short snippet for consideration of a representative problem.\n\n\nAfter the original user submitted a proposal, others chimed in and submitted versions in their favorite languages. I have collected those versions, and run them on a consistent set of hardware.\nSome submissions were excluded because from the benchmarks they involved an entirely different approach, such as memoizing the function calls[^1].\n\n\n[ Info: Precompiling CSV [336ed68f-0bac-5ca0-87d4-7b16caf5d00b]\n\n\n\n\nTable 1: Benchmarks for the Life Modeling Problem in nanoseconds (lower times are better).\n\n\n\n18×6 DataFrame\n\n\n\nRow\nlang\nalgorithm\nfunction_name\nmedian\nmean\nrelative_mean\n\n\n\nString15\nString15\nString15\nFloat64?\nFloat64\nFloat64\n\n\n\n\n1\nJulia\nAccumulator\nnpv9\n6.388\n6.375\n1.0\n\n\n2\nRust\nAccumulator\nnpv3\n7.0\n7.0\n1.09804\n\n\n3\nJulia\nAccumulator\nnpv8\n7.372\n7.375\n1.15686\n\n\n4\nJulia\nAccumulator\nnpv7\n7.92\n7.917\n1.24188\n\n\n5\nJulia\nAccumulator\nnpv6\n9.037\n9.009\n1.41318\n\n\n6\nJulia\nAccumulator\nnpv4\n10.764\n10.761\n1.688\n\n\n7\nJulia\nAccumulator\nnpv5\n11.49\n11.469\n1.79906\n\n\n8\nRust\nAccumulator\nnpv2\n14.0\n14.0\n2.19608\n\n\n9\nJulia\nAccumulator\nnpv3\n14.507\n14.487\n2.27247\n\n\n10\nRust\nAccumulator\nnpv1\n22.0\n22.0\n3.45098\n\n\n11\nJulia\nVectorized\nnpv2\n235.758\n218.391\n34.2574\n\n\n12\nJulia\nVectorized\nnpv1\n235.322\n228.198\n35.7958\n\n\n13\nPython (Numba)\nAccumulator\nnpv_numba\nmissing\n626.0\n98.1961\n\n\n14\nPython\nAccumulator\nnpv_loop\nmissing\n2314.0\n362.98\n\n\n15\nPython (NumPy)\nVectorized\nnpv\nmissing\n14261.0\n2237.02\n\n\n16\nR\nVectorized\nnpv base\n4264.0\n46617.0\n7312.47\n\n\n17\nR\nAccumulator\nnpv_loop\n4346.0\n62275.7\n9768.74\n\n\n18\nR (data.table)\nVectorized\nnpv\n770554.0\n8.42767e5\n1.32199e5\n\n\n\n\n\n\n\n\n\nTo aid in visualizing results with such vast different orders of magnitude, this graph includes a physical length comparison to serve as a reference. The computation time is represented by the distance that light travels in the time for the computation to complete (comparing a nanosecond to one foot length goes at least back to Admiral Grace Hopper).\n\n\n\n\n\n\n\n \n \n \n\n\n\n \n \n \n\n\n\n \n \n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nFigure 1\n\n\n\n\n\n\n\nFor more a more in-depth discussion of these results, see this post.\nAll of the benchmarked code can be found in the JuliaActuary Learn repository. Please file an issue or submit a PR request there for issues/suggestions." }, { "objectID": "benchmarks.html#irrs", diff --git a/sitemap.xml b/sitemap.xml index e99eed3..34edc26 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -2,122 +2,122 @@ https://JuliaActuary.org/blog.html - 2024-06-17T03:29:44.486Z + 2024-06-18T03:39:01.368Z https://JuliaActuary.org/packages.html - 2024-06-17T02:46:38.178Z + 2024-06-18T03:39:01.368Z https://JuliaActuary.org/index.html - 2024-06-17T02:46:11.253Z + 2024-06-18T03:39:01.368Z https://JuliaActuary.org/posts/mortality-comparison/index.html - 2024-06-16T21:18:09.490Z + 2024-06-18T03:39:01.377Z https://JuliaActuary.org/posts/exposures-example/index.html - 2024-06-16T01:50:06.671Z + 2024-06-18T03:39:01.374Z https://JuliaActuary.org/posts/stochastic-mortality/index.html - 2024-06-15T16:35:16.344Z + 2024-06-18T03:39:01.378Z https://JuliaActuary.org/posts/academy-generator-rates/index.html - 2024-06-16T15:00:16.040Z + 2024-06-18T03:39:01.371Z https://JuliaActuary.org/posts/hacktoberfest/index.html - 2024-06-17T02:54:36.846Z + 2024-06-18T03:39:01.375Z https://JuliaActuary.org/posts/bayes-vs-limited-fluctuation/index.html - 2024-06-16T21:41:41.288Z + 2024-06-18T03:39:01.371Z https://JuliaActuary.org/posts/mortalitytables-and-dataframes/index.html - 2024-06-15T15:41:27.430Z + 2024-06-18T03:39:01.377Z https://JuliaActuary.org/posts/nested-policy-projections/index.html - 2024-06-16T03:16:59.653Z + 2024-06-18T03:39:01.377Z https://JuliaActuary.org/posts/bayesian-claims-demo/index.html - 2024-06-16T02:18:48.900Z + 2024-06-18T03:39:01.372Z https://JuliaActuary.org/posts/treasury-interactive/index.html - 2024-06-16T13:52:06.076Z + 2024-06-18T03:39:01.378Z https://JuliaActuary.org/posts/cashflow-interactive/index.html - 2024-06-16T15:00:44.501Z + 2024-06-18T03:39:01.373Z https://JuliaActuary.org/examples.html - 2024-06-17T02:57:30.830Z + 2024-06-18T03:39:01.368Z https://JuliaActuary.org/community.html - 2024-06-17T02:59:26.307Z + 2024-06-18T03:39:01.368Z https://JuliaActuary.org/posts/finance-models-announcement/index.html - 2024-06-17T02:54:26.033Z + 2024-06-18T03:39:01.374Z https://JuliaActuary.org/posts/policy-diffeq/index.html - 2024-06-17T01:50:58.498Z + 2024-06-18T03:39:01.378Z https://JuliaActuary.org/posts/life-modeling-problem/index.html - 2024-06-17T02:54:48.784Z + 2024-06-18T03:39:01.375Z https://JuliaActuary.org/posts/bayesian-intro/index.html - 2024-06-17T02:54:18.391Z + 2024-06-18T03:39:01.372Z https://JuliaActuary.org/posts/julia-for-actuaries/index.html - 2024-06-17T02:54:42.670Z + 2024-06-18T03:39:01.375Z https://JuliaActuary.org/posts/poisson-approximation/index.html - 2024-06-16T21:17:53.237Z + 2024-06-18T03:39:01.378Z https://JuliaActuary.org/posts/fitting-yield-curves/index.html - 2024-06-16T03:16:08.017Z + 2024-06-18T03:39:01.374Z https://JuliaActuary.org/posts/fitting-survival-data/index.html - 2024-06-15T16:08:37.185Z + 2024-06-18T03:39:01.374Z https://JuliaActuary.org/posts/getting-started-for-actuaries/index.html - 2024-06-17T02:54:32.086Z + 2024-06-18T03:39:01.375Z https://JuliaActuary.org/posts/coding-the-future/index.html - 2024-06-17T02:54:10.385Z + 2024-06-18T03:39:01.374Z https://JuliaActuary.org/posts/academy-generator/index.html - 2024-06-16T14:45:08.569Z + 2024-06-18T03:39:01.371Z https://JuliaActuary.org/benchmarks.html - 2024-06-15T13:32:36.848Z + 2024-06-18T03:39:01.368Z https://JuliaActuary.org/all-posts.html - 2024-06-17T03:35:46.509Z + 2024-06-18T03:39:01.322Z https://JuliaActuary.org/learn.html - 2024-06-17T02:48:31.135Z + 2024-06-18T03:39:01.368Z diff --git a/styles.css b/styles.css index c2e578f..74bb4b9 100644 --- a/styles.css +++ b/styles.css @@ -122,6 +122,12 @@ pre { font-weight: 400; } +@media (max-width: 800px) { + .hero-grid { + flex-direction: column; + } +} + .hero-child { flex: 1; }