NonPeriodic
in package
Table of Contents
Constants
- DEFAULT_GUESS = 0.1
- FINANCIAL_MAX_ITERATIONS = 128
- FINANCIAL_PRECISION = 1.0E-8
Methods
- presentValue() : float|string
- XNPV.
- rate() : float|string
- XIRR.
Constants
DEFAULT_GUESS
public
mixed
DEFAULT_GUESS
= 0.1
FINANCIAL_MAX_ITERATIONS
public
mixed
FINANCIAL_MAX_ITERATIONS
= 128
FINANCIAL_PRECISION
public
mixed
FINANCIAL_PRECISION
= 1.0E-8
Methods
presentValue()
XNPV.
public
static presentValue(mixed $rate, array<int, float|int|numeric-string> $values, mixed $dates) : float|string
Returns the net present value for a schedule of cash flows that is not necessarily periodic. To calculate the net present value for a series of cash flows that is periodic, use the NPV function.
Excel Function: =XNPV(rate,values,dates)
Parameters
- $rate : mixed
-
the discount rate to apply to the cash flows, expect array|float
- $values : array<int, float|int|numeric-string>
-
A series of cash flows that corresponds to a schedule of payments in dates, expecting float[]. The first payment is optional and corresponds to a cost or payment that occurs at the beginning of the investment. If the first value is a cost or payment, it must be a negative value. All succeeding payments are discounted based on a 365-day year. The series of values must contain at least one positive value and one negative value.
- $dates : mixed
-
A schedule of payment dates that corresponds to the cash flow payments, expecting mixed[]. The first payment date indicates the beginning of the schedule of payments. All other dates must be later than this date, but they may occur in any order.
Return values
float|stringrate()
XIRR.
public
static rate(array<int, float|int|numeric-string> $values, array<int, float|int|numeric-string> $dates[, mixed $guess = self::DEFAULT_GUESS ]) : float|string
Returns the internal rate of return for a schedule of cash flows that is not necessarily periodic.
Excel Function: =XIRR(values,dates,guess)
Parameters
- $values : array<int, float|int|numeric-string>
-
A series of cash flow payments, expecting float[] The series of values must contain at least one positive value & one negative value
- $dates : array<int, float|int|numeric-string>
-
A series of payment dates The first payment date indicates the beginning of the schedule of payments All other dates must be later than this date, but they may occur in any order
- $guess : mixed = self::DEFAULT_GUESS
-
An optional guess at the expected answer