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] [Versions 401 and 402] [Versions 401 and 403]

(no description)

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

Defines 1 class

Trends:: (14 methods):
  filterTrendValues()
  checkTrendArrays()
  validateTrendArrays()
  CORREL()
  COVAR()
  FORECAST()
  GROWTH()
  INTERCEPT()
  LINEST()
  LOGEST()
  RSQ()
  SLOPE()
  STEYX()
  TREND()


Class: Trends  - X-Ref

filterTrendValues(array &$array1, array &$array2)   X-Ref
No description

checkTrendArrays(&$array1, &$array2)   X-Ref
No description

validateTrendArrays(array $yValues, array $xValues)   X-Ref
No description

CORREL($yValues, $xValues = null)   X-Ref
CORREL.

Returns covariance, the average of the products of deviations for each data point pair.

param: mixed $yValues array of mixed Data Series Y
param: null|mixed $xValues array of mixed Data Series X
return: float|string

COVAR($yValues, $xValues)   X-Ref
COVAR.

Returns covariance, the average of the products of deviations for each data point pair.

param: mixed $yValues array of mixed Data Series Y
param: mixed $xValues array of mixed Data Series X
return: float|string

FORECAST($xValue, $yValues, $xValues)   X-Ref
FORECAST.

Calculates, or predicts, a future value by using existing values.
The predicted value is a y-value for a given x-value.

param: mixed $xValue Float value of X for which we want to find Y
param: mixed $yValues array of mixed Data Series Y
param: mixed $xValues of mixed Data Series X
return: array|bool|float|string

GROWTH($yValues, $xValues = [], $newValues = [], $const = true)   X-Ref
GROWTH.

Returns values along a predicted exponential Trend

param: mixed[] $yValues Data Series Y
param: mixed[] $xValues Data Series X
param: mixed[] $newValues Values of X for which we want to find Y
param: mixed $const A logical (boolean) value specifying whether to force the intersect to equal 0 or not
return: float[]

INTERCEPT($yValues, $xValues)   X-Ref
INTERCEPT.

Calculates the point at which a line will intersect the y-axis by using existing x-values and y-values.

param: mixed[] $yValues Data Series Y
param: mixed[] $xValues Data Series X
return: float|string

LINEST($yValues, $xValues = null, $const = true, $stats = false)   X-Ref
LINEST.

Calculates the statistics for a line by using the "least squares" method to calculate a straight line
that best fits your data, and then returns an array that describes the line.

param: mixed[] $yValues Data Series Y
param: null|mixed[] $xValues Data Series X
param: mixed $const A logical (boolean) value specifying whether to force the intersect to equal 0 or not
param: mixed $stats A logical (boolean) value specifying whether to return additional regression statistics
return: array|int|string The result, or a string containing an error

LOGEST($yValues, $xValues = null, $const = true, $stats = false)   X-Ref
LOGEST.

Calculates an exponential curve that best fits the X and Y data series,
and then returns an array that describes the line.

param: mixed[] $yValues Data Series Y
param: null|mixed[] $xValues Data Series X
param: mixed $const A logical (boolean) value specifying whether to force the intersect to equal 0 or not
param: mixed $stats A logical (boolean) value specifying whether to return additional regression statistics
return: array|int|string The result, or a string containing an error

RSQ($yValues, $xValues)   X-Ref
RSQ.

Returns the square of the Pearson product moment correlation coefficient through data points
in known_y's and known_x's.

param: mixed[] $yValues Data Series Y
param: mixed[] $xValues Data Series X
return: float|string The result, or a string containing an error

SLOPE($yValues, $xValues)   X-Ref
SLOPE.

Returns the slope of the linear regression line through data points in known_y's and known_x's.

param: mixed[] $yValues Data Series Y
param: mixed[] $xValues Data Series X
return: float|string The result, or a string containing an error

STEYX($yValues, $xValues)   X-Ref
STEYX.

Returns the standard error of the predicted y-value for each x in the regression.

param: mixed[] $yValues Data Series Y
param: mixed[] $xValues Data Series X
return: float|string

TREND($yValues, $xValues = [], $newValues = [], $const = true)   X-Ref
TREND.

Returns values along a linear Trend

param: mixed[] $yValues Data Series Y
param: mixed[] $xValues Data Series X
param: mixed[] $newValues Values of X for which we want to find Y
param: mixed $const A logical (boolean) value specifying whether to force the intersect to equal 0 or not
return: float[]