Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 400 and 401] [Versions 400 and 402] [Versions 400 and 403]

(no description)

File Size: 160 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Periodic:: (3 methods):
  rate()
  modifiedRate()
  presentValue()


Class: Periodic  - X-Ref

rate($values, $guess = 0.1)   X-Ref
IRR.

Returns the internal rate of return for a series of cash flows represented by the numbers in values.
These cash flows do not have to be even, as they would be for an annuity. However, the cash flows must occur
at regular intervals, such as monthly or annually. The internal rate of return is the interest rate received
for an investment consisting of payments (negative values) and income (positive values) that occur at regular
periods.

Excel Function:
IRR(values[,guess])

return: float|string
param: mixed $values An array or a reference to cells that contain numbers for which you want
param: mixed $guess A number that you guess is close to the result of IRR

modifiedRate($values, $financeRate, $reinvestmentRate)   X-Ref
MIRR.

Returns the modified internal rate of return for a series of periodic cash flows. MIRR considers both
the cost of the investment and the interest received on reinvestment of cash.

Excel Function:
MIRR(values,finance_rate, reinvestment_rate)

return: float|string Result, or a string containing an error
param: mixed $values An array or a reference to cells that contain a series of payments and
param: mixed $financeRate The interest rate you pay on the money used in the cash flows
param: mixed $reinvestmentRate The interest rate you receive on the cash flows as you reinvest them

presentValue($rate, ...$args)   X-Ref
NPV.

Returns the Net Present Value of a cash flow series given a discount rate.

return: float
param: mixed $rate