Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 400 and 401]

(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