|Constructor and Description|
|Modifier and Type||Method and Description|
Computes the internal rate of return using an estimated irr of 10 percent.
Calculates IRR using the Newton-Raphson Method.
args- the evaluated function arguments. Empty values are represented with
srcRowIndex- row index of the cell containing the formula under evaluation
srcColumnIndex- column index of the cell containing the formula under evaluation
null. Note - Excel uses the error code #NUM! instead of IEEE NaN, so when numeric functions evaluate to
Double.NaNbe sure to translate the result to
public static double irr(double income)
income- the income values.
public static double irr(double values, double guess)
Starting with the guess, the method cycles through the calculation until the result
is accurate within 0.00001 percent. If IRR can't find a result that works
after 1000 tries, the
Double.NaN is returned.
The implementation is inspired by the NewtonSolver from the Apache Commons-Math library,
values- the income values.
guess- the initial guess of irr.
Double.NaNif the maximum iteration count is exceeded
Copyright 2022 The Apache Software Foundation or its licensors, as applicable.