Financial calculations in Elixir — XIRR/IRR, NPV, time value of money, bonds, depreciation, and return metrics
https://hexdocs.pm/finance ↗// readme
Finance
An Elixir library for cash-flow analysis. It covers internal rate of return
(xirr/irr), net present value (xnpv/npv), and modified IRR (mirr),
along with the usual time-value-of-money and depreciation helpers. Options are
validated with nimble_options, and amounts may be Decimal values when you
have that optional dependency installed.
The functions are organised into domain modules:
Finance.CashFlow— net present value and internal rate of return (npv,xnpv,irr,xirr,mirr), plus batchedirr_many/xirr_many.Finance.TVM— time-value-of-money scalars (pv,fv,pmt,ipmt,ppmt,nper,rate) plusamortization_schedule.Finance.Rates— rate conversions (effective_annual_rate,nominal_rate,continuous_to_periodic).Finance.Bonds— fixed income (price,ytm,duration,modified_duration,convexity).Finance.Depreciation—sln,syd,ddb,db.Finance.Returns— performance and risk metrics (volatility,cagr,payback_period,discounted_payback_period,profitability_index,twr).Finance.Solver— the root-finding strategy behind the rate functions, swappable via the…