UNPKG

@railpath/finance-toolkit

Version:

Production-ready finance library for portfolio construction, risk analytics, quantitative metrics, and ML-based regime detection

16 lines (15 loc) 912 B
import { IRRResult } from './calculateIRRWithNewtonRaphson'; /** * Calculate Internal Rate of Return (IRR) using improved Newton-Raphson with Bisection fallback * * This function attempts to use the fast Newton-Raphson method first, and automatically * falls back to the robust Bisection method if Newton-Raphson encounters problems * (e.g., small derivatives, divergence, or repeated worsening). * * @param cashFlows - Array of cash flows (positive for inflows, negative for outflows) * @param timePeriods - Array of time periods in years corresponding to each cash flow * @param maxIterations - Maximum number of iterations for convergence * @param tolerance - Convergence tolerance (default: 1e-6) * @returns IRR result with rate, iterations, and method used */ export declare function calculateIRR(cashFlows: number[], timePeriods: number[], maxIterations: number, tolerance: number): IRRResult;