Skip to content

scripbox/ex-xirr

Repository files navigation

ExXirr

codecov Hex.pm Travis

A library to calculate xirr using the Newton Raphson method.

Usage

iex> d = [{1985, 1, 1}, {1990, 1, 1}, {1995, 1, 1}]
iex> v = [1000, -600, -200]
iex> ExXirr.xirr(d,v)
{:ok, -0.034592}

Installation

The package can be installed as:

  1. Add ex_xirr to your list of dependencies in mix.exs:

    def deps do
      [{:ex_xirr, "~> 1.0.0"}]
    end
  2. Ensure ex_xirr is started before your application:

    def application do
      [applications: [:ex_xirr]]
    end

Test

  • Run the test suite using the following
    MIX_ENV=test mix test
    

Benchmarks

  • We use benchee for the benchmark tests. Run it using the following
    mix run test/xirr_comparison_bench.exs
    
  • The reports are available here.

Credits

This application is built on the fantastic finance-elixir package. Many thanks to tubedude for his work.

About

An Elixir package for calculating XIRR.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages