Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
R - Mortality Tables
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
R
R - Mortality Tables
Commits
2b9f8dec
Commit
2b9f8dec
authored
8 years ago
by
Reinhold Kainhofer
Browse files
Options
Downloads
Patches
Plain Diff
Document the setLoading function
parent
b2f41367
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vignettes/using-the-valuationTables-package.Rmd
+10
-10
10 additions, 10 deletions
vignettes/using-the-valuationTables-package.Rmd
with
10 additions
and
10 deletions
vignettes/using-the-valuationTables-package.Rmd
+
10
−
10
View file @
2b9f8dec
...
...
@@ -243,16 +243,19 @@ b@modification = function(qx) pmax(qx, 0.01)
plot(AVOe2005R.female, b, YOB=2000)
```
### Adding a
modification
to the raw probabilities
### Adding a
security loading
to the raw probabilities
Some uses require post-processing of the death probabilities, like adding a lower
bound for the death probabilities. To achive this, all `valuationTable`-derived
classes have a slot `modification` that takes a function that is passed the vector
of death probabilities.
When calculating premiums for life insurance contracts, one often needs to add
a certain security loading on the raw death probabilities (e.g. 10% increased
death probabilities) to account for statistical fluctuations. This can be easily
done with the `setLoading` function that returns a copy of the given table and
adds the given security loading.
```{r}
lt.mod = valuationTable.period(name="Sample modified lifetable (lower bound of 3%)", ages=1:99, deathProbs=exp(-(99:1)/10), modification=function (qx) pmax(0.03, qx))
plot(lt, lt.mod, title="Original and modified table")
AVOe2005R.female.sec = setLoading(AVOe2005R.female, loading = 0.1);
# Make sure the modified table has a new name, otherwise plots might break
AVOe2005R.female.sec@name = "Table with 10% loading"
plot(AVOe2005R.female, AVOe2005R.female.sec, title="Original and modified table")
```
### Adding a modification to the raw probabilities
...
...
@@ -269,6 +272,3 @@ AVOe2005R.female.mod@name = "Modified table (lower bound of 3%)"
plot(AVOe2005R.female, AVOe2005R.female.mod, title="Original and modified table")
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment