Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Differences Between: [Versions 400 and 403]

(no description)

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

Defines 1 class

Mean:: (3 methods):
  geometric()
  harmonic()
  trim()


Class: Mean  - X-Ref

geometric(...$args)   X-Ref
GEOMEAN.

Returns the geometric mean of an array or range of positive data. For example, you
can use GEOMEAN to calculate average growth rate given compound interest with
variable rates.

Excel Function:
GEOMEAN(value1[,value2[, ...]])

param: mixed ...$args Data values
return: float|string

harmonic(...$args)   X-Ref
HARMEAN.

Returns the harmonic mean of a data set. The harmonic mean is the reciprocal of the
arithmetic mean of reciprocals.

Excel Function:
HARMEAN(value1[,value2[, ...]])

param: mixed ...$args Data values
return: float|string

trim(...$args)   X-Ref
TRIMMEAN.

Returns the mean of the interior of a data set. TRIMMEAN calculates the mean
taken by excluding a percentage of data points from the top and bottom tails
of a data set.

Excel Function:
TRIMEAN(value1[,value2[, ...]], $discard)

param: mixed $args Data values
return: float|string