Skip to main content
Module

x/financial/src/financial.ts>irr

A Zero-dependency TypeScript/JavaScript financial library (based on numpy-financial) for Node.js, Deno and the browser
Latest
function irr
import { irr } from "https://deno.land/x/financial@v0.1.3/src/financial.ts";

Return the Internal Rate of Return (IRR).

This is the "average" periodically compounded rate of return that gives a net present value of 0.0; for a more complete explanation, see Notes below.

Parameters

values: number[]
  • Input cash flows per time period. By convention, net "deposits" are negative and net "withdrawals" are positive. Thus, for example, at least the first element of values, which represents the initial investment, will typically be negative.
optional
guess = [UNSUPPORTED]
  • Starting guess for solving the Internal Rate of Return
optional
tol = [UNSUPPORTED]
  • Required tolerance for the solution
optional
maxIter = [UNSUPPORTED]
  • Maximum iterations in finding the solution

Returns

number

Internal Rate of Return for periodic input values