https://github.com/lewisfogden/heavymodel
Actuarial Heavy Modelling
https://github.com/lewisfogden/heavymodel
Last synced: 5 months ago
JSON representation
Actuarial Heavy Modelling
- Host: GitHub
- URL: https://github.com/lewisfogden/heavymodel
- Owner: lewisfogden
- License: mit
- Created: 2020-03-14T21:50:18.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-06-28T18:25:48.000Z (almost 3 years ago)
- Last Synced: 2024-11-12T09:51:08.544Z (5 months ago)
- Language: Jupyter Notebook
- Homepage: https://digitalactuary.co.uk
- Size: 1010 KB
- Stars: 8
- Watchers: 2
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - lewisfogden/heavymodel - Actuarial Heavy Modelling (Jupyter Notebook)
README
# Heavymodel
heavymodel is a class-based library which enables Actuaries (and other modelling professionals) to build actuarial models in Python, using a function-based syntax similar to other actuarial modelling software, combined with the simplicity of writing code in python.
## Installation
Install via pip:
`pip install heavymodel-lewisfogden`
## Simple Model Creation
Import heavymodel, and then subclass your own model from `Model`:
```python
from heavymodel import Model
import pandas as pdclass DemographicModel(Model):
def num_policies(self, t):
if t == 0:
return 1
else:
return self.num_policies(t-1) - self.num_lapses(t-1)def num_lapses(self, t):
return 0.1 * self.num_policies(t)demo = DemographicModel()
demo._run(20)
df = pd.DataFrame({"num_lapses":demo.num_lapses.values, "num_policies":demo.num_policies.values})
print(df)
```See https://www.digitalactuary.co.uk/ for further documentation.