-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
48 lines (35 loc) · 1.49 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
# ruin
[![Travis-CI Build Status](https://travis-ci.org/irudnyts/ruin.svg?branch=master)](https://travis-ci.org/irudnyts/ruin)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/irudnyts/ruin?branch=master&svg=true)](https://ci.appveyor.com/project/irudnyts/ruin)
## Overview
The intention of the package is to provide simulation methods of common risk processes in a framework of ruin theory. Each model is implemented as an S4 class, having a simulator of its path, and a plotting function. Further, a Monte-Carlo estimator of a ruin probability for a finite time is implemented, using a parallel computation. Currently, the package extends two classical risk models, namely, Cramer-Lundberg and Sparre Andersen models by including capital injections (positive jumps).
## Installation
The package is not yet submitted to CRAN. Instead, you can install `ruin` from
github with:
```{r, eval = FALSE}
# install.packages("devtools")
devtools::install_github("irudnyts/ruin")
```
## Example
```{r example}
library(ruin)
model <- CramerLundberg(
initial_capital = 10,
premium_rate = 1,
claim_poisson_arrival_rate = 1,
claim_size_generator = rexp,
claim_size_parameters = list(rate = 1)
)
ruin_probability(model = model, time_horizon = 10, return_paths = FALSE)
```