Skip to main content

Heavy Model Actuarial Modelling

Project description

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:

from heavymodel import Model
import pandas as pd

class 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for heavymodel-lewisfogden, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size heavymodel_lewisfogden-0.0.2-py3-none-any.whl (7.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size heavymodel-lewisfogden-0.0.2.tar.gz (5.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page