{"id":14066588,"url":"https://github.com/gabrielcrepeault/tvarPackage","last_synced_at":"2025-07-29T23:31:40.354Z","repository":{"id":186592922,"uuid":"122805318","full_name":"gabrielcrepeault/tvarPackage","owner":"gabrielcrepeault","description":"R functions to calculate different VaR and TVaR of principal probability distribution","archived":true,"fork":false,"pushed_at":"2020-04-18T03:49:08.000Z","size":191,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-13T07:11:27.437Z","etag":null,"topics":["formula","probability","probability-distribution","r","rpackage"],"latest_commit_sha":null,"homepage":"https://gabrielcrepeault.github.io/tvarPackage/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gabrielcrepeault.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-02-25T04:35:04.000Z","updated_at":"2023-03-09T23:12:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"6d2fc961-a875-4fda-89cf-a73ddaeb5fa4","html_url":"https://github.com/gabrielcrepeault/tvarPackage","commit_stats":null,"previous_names":["gabrielcrepeault/tvarpackage"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielcrepeault%2FtvarPackage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielcrepeault%2FtvarPackage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielcrepeault%2FtvarPackage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielcrepeault%2FtvarPackage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gabrielcrepeault","download_url":"https://codeload.github.com/gabrielcrepeault/tvarPackage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228060393,"owners_count":17863361,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["formula","probability","probability-distribution","r","rpackage"],"created_at":"2024-08-13T07:05:10.537Z","updated_at":"2024-12-04T06:31:14.400Z","avatar_url":"https://github.com/gabrielcrepeault.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"---\npermalink: docs/index.html\n---\n\n# tvarPackage\n\n\u003e This package is no longer maintained. Please refer to the [`Distributacalcul_Package`](https://github.com/alec42/Distributacalcul_Package). \n\n\n\nTo download this R package on your R session, copy-paste the next code line (the package [devtools](https://cran.r-project.org/web/packages/devtools/index.html) is necessary) :\n\n```\ndevtools::install_github(\"gabrielcrepeault/tvarPackage\")\n```\n\n# Introduction\nThis R package was created in the first place to calculate more quickly and easily a lot of formulas (mean, variance, VaR, TVaR, stop-loss function, etc.) related to popular probability distributions, such as :  \n\n- Uniform \n- Binomial\n- Poisson\n- Exponential\n- Gamma\n- Pareto\n- Beta\n- Lognormal\n- Pareto\n- Normal\n\nAnd also some Mortality laws, like\n\n- Gompertz\n\n\n\n# Formulas convention\nI've tried to make the package pretty simple to use, the syntax is based on quite the same as some popular R package, like the [`stats` ](https://stat.ethz.ch/R-manual/R-devel/library/stats/html/00Index.html) or [`actuar`](https://cran.r-project.org/web/packages/actuar/index.html) packages :\n\n|Formulas  | `code`|\n|:-----------:|-----------------|\n|Mean         |`E_\u003cdistribution\u003e` |\n|Variance     |`V_\u003cdistribution\u003e` |\n|stop loss     |`SL_\u003cdistribution\u003e` |\n|Limited expected value     |`Elim_\u003cdistribution\u003e` |\n|truncated mean     |`Etronq_\u003cdistribution\u003e` |\n|Value-at-Risk     |`VaR_\u003cdistribution\u003e` |\n|Tail Value-at-Risk     |`TVaR_\u003cdistribution\u003e` |\n|Mean Excess-loss    |`Mexcess_\u003cdistribution\u003e` |\n\n## Specifications for Life insurance\nFor probability laws used in life insurance, there is a special annotation (not much different from the one above) : \n\n* first, you need to specify if you want to have the probability related to $X$ or $T_x$ (`Tx = T` si setup by default)\n* The Mean, Variance, VaR and TVaR expressions are given as a result of the `integrate` function or with floor equivalent, because there are no *closed* (explicit) expressions. You can call them with a slightly different syntax, `Etx_\u003cdistribution\u003e`, `Vtx_\u003cdistribution\u003e` and `TVaRtx_\u003cdistribution\u003e`.\n* In life insurance , we work with survival functions most of the time. So I have also defined a survival function (it's gonna save coding time and space). As the section above, the syntax is based on what's already in the most popular packages.\n* There is less practical application for VaR and TVaR for life duration, so I didn't create VaR functions, since the quantilee fonction makes more sense.\n\n|Formulas  | `code`|\n|:-----------:|-----------------|\n|Mortality force     |`h\u003cdistribution\u003e` |\n|density function     |`d\u003cdistribution\u003e` |\n|cumulative density function (cdf)    |`p\u003cdistribution\u003e` |\n|survival function (cdf)    |`s\u003cdistribution\u003e` |\n\n\n\n\n# Updates\n|Date   | Modifications|\n|:-----------:|:---------:|\n|24/02/2018 | Intial commit of the package|\n|27/02/2018 | adding binomial, uniform and exponential laws|\n|04/03/2018 | adding beta distribution|\n|06/03/2018 | adding Lognormal distribution|\n|06/04/2018 | adding Pareto, Burr and Normal (E[X] \u0026 Var(X)) distribution|\n|16/04/2018 | adding Gompertz \u0026 TVaR function for binomial and poisson|\n|11/12/2018 | create website to vizualise tvarPackage help|\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielcrepeault%2FtvarPackage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgabrielcrepeault%2FtvarPackage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielcrepeault%2FtvarPackage/lists"}