A basic Go implementation LDA, used for calculating operational risk.
The code executes a Monte-Carlo simulation, where for each simulation:
- The frequency of losses for a given year is taken from the Poisson distribution.
- The severity (£) of each of those losses is taken from a given distribution (default: lognormal)
- The total loss for the year is added to an array of simulated losses.
Once the Monte-Carlo simulation is complete, the 99.9th percentile of losses (1 in 1000 year losses) is printed to the console.
With Go installed on your machine
go build main.go
After building the exe, you can run:
main --help
Which will show the optional parameters of the tool, an example execution would be:
main --lambda 1.2 --mu 10 --sigma 1 --simulations 2000000
This project does not handle the fitting of distributions to actual data, only the execution of the Monte-Carlo simulation.