PHPExcel_Calculation_Statistical
| category | PHPExcel |
|---|---|
| package | PHPExcel_Calculation |
| copyright | Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel) |
AVEDEV() : float
Returns the average of the absolute deviations of data points from their mean. AVEDEV is a measure of the variability in a data set.
Excel Function: AVEDEV(value1[,value2[, ...]])
| access | public |
|---|---|
| category | Statistical Functions |
floatAVERAGE() : float
Returns the average (arithmetic mean) of the arguments
Excel Function: AVERAGE(value1[,value2[, ...]])
| access | public |
|---|---|
| category | Statistical Functions |
floatAVERAGEA() : float
Returns the average of its arguments, including numbers, text, and logical values
Excel Function: AVERAGEA(value1[,value2[, ...]])
| access | public |
|---|---|
| category | Statistical Functions |
floatAVERAGEIF($aArgs, string $condition, mixed[] $averageArgs) : float
Returns the average value from a range of cells that contain numbers within the list of arguments
Excel Function: AVERAGEIF(value1[,value2[, ...]],condition)
| access | public |
|---|---|
| category | Mathematical and Trigonometric Functions |
stringThe criteria that defines which cells will be checked.
mixed[]Data values
floatBETADIST(float $value, float $alpha, float $beta, $rMin, $rMax) : float
Returns the beta distribution.
floatValue at which you want to evaluate the distribution
floatParameter to the distribution
floatParameter to the distribution
floatBETAINV(float $probability, float $alpha, float $beta, float $rMin, float $rMax) : float
Returns the inverse of the beta distribution.
floatProbability at which you want to evaluate the distribution
floatParameter to the distribution
floatParameter to the distribution
floatMinimum value
floatMaximum value
floatBINOMDIST(float $value, float $trials, float $probability, boolean $cumulative) : float
Returns the individual term binomial distribution probability. Use BINOMDIST in problems with a fixed number of tests or trials, when the outcomes of any trial are only success or failure, when trials are independent, and when the probability of success is constant throughout the experiment. For example, BINOMDIST can calculate the probability that two of the next three babies born are male.
| todo | Cumulative distribution function |
|---|
floatNumber of successes in trials
floatNumber of trials
floatProbability of success on each trial
boolean
floatCHIDIST(float $value, float $degrees) : float
Returns the one-tailed probability of the chi-squared distribution.
floatValue for the function
floatdegrees of freedom
floatCHIINV(float $probability, float $degrees) : float
Returns the one-tailed probability of the chi-squared distribution.
floatProbability for the function
floatdegrees of freedom
floatCONFIDENCE(float $alpha, float $stdDev, float $size) : float
Returns the confidence interval for a population mean
float
floatStandard Deviation
float
floatCORREL(array $yValues, array $xValues) : float
Returns covariance, the average of the products of deviations for each data point pair.
arrayof mixed Data Series Y
arrayof mixed Data Series X
floatCOUNT() : int
Counts the number of cells that contain numbers within the list of arguments
Excel Function: COUNT(value1[,value2[, ...]])
| access | public |
|---|---|
| category | Statistical Functions |
intCOUNTA() : int
Counts the number of cells that are not empty within the list of arguments
Excel Function: COUNTA(value1[,value2[, ...]])
| access | public |
|---|---|
| category | Statistical Functions |
intCOUNTBLANK() : int
Counts the number of empty cells within the list of arguments
Excel Function: COUNTBLANK(value1[,value2[, ...]])
| access | public |
|---|---|
| category | Statistical Functions |
intCOUNTIF($aArgs, string $condition) : int
Counts the number of cells that contain numbers within the list of arguments
Excel Function: COUNTIF(value1[,value2[, ...]],condition)
| access | public |
|---|---|
| category | Statistical Functions |
stringThe criteria that defines which cells will be counted.
intCOVAR(array $yValues, array $xValues) : float
Returns covariance, the average of the products of deviations for each data point pair.
arrayof mixed Data Series Y
arrayof mixed Data Series X
floatCRITBINOM(float $trials, float $probability, float $alpha) : int
Returns the smallest value for which the cumulative binomial distribution is greater than or equal to a criterion value
See http://support.microsoft.com/kb/828117/ for details of the algorithm used
| todo | Warning. This implementation differs from the algorithm detailed on the MS web site in that $CumPGuessMinus1 = $CumPGuess - 1 rather than $CumPGuess - $PGuess This eliminates a potential endless loop error, but may have an adverse affect on the accuracy of the function (although all my tests have so far returned correct results). |
|---|
floatnumber of Bernoulli trials
floatprobability of a success on each trial
floatcriterion value
intDEVSQ() : float
Returns the sum of squares of deviations of data points from their sample mean.
Excel Function: DEVSQ(value1[,value2[, ...]])
| access | public |
|---|---|
| category | Statistical Functions |
floatEXPONDIST(float $value, float $lambda, boolean $cumulative) : float
Returns the exponential distribution. Use EXPONDIST to model the time between events, such as how long an automated bank teller takes to deliver cash. For example, you can use EXPONDIST to determine the probability that the process takes at most 1 minute.
floatValue of the function
floatThe parameter value
boolean
floatFISHER(float $value) : float
Returns the Fisher transformation at x. This transformation produces a function that is normally distributed rather than skewed. Use this function to perform hypothesis testing on the correlation coefficient.
float
floatFISHERINV(float $value) : float
Returns the inverse of the Fisher transformation. Use this transformation when analyzing correlations between ranges or arrays of data. If y = FISHER(x), then FISHERINV(y) = x.
float
floatFORECAST(float $xValue, array $yValues, array $xValues) : float
Calculates, or predicts, a future value by using existing values. The predicted value is a y-value for a given x-value.
floatValue of X for which we want to find Y
arrayof mixed Data Series Y
arrayof mixed Data Series X
floatGAMMADIST(float $value, float $a, float $b, boolean $cumulative) : float
Returns the gamma distribution.
floatValue at which you want to evaluate the distribution
floatParameter to the distribution
floatParameter to the distribution
boolean
floatGAMMAINV(float $probability, float $alpha, float $beta) : float
Returns the inverse of the beta distribution.
floatProbability at which you want to evaluate the distribution
floatParameter to the distribution
floatParameter to the distribution
floatGAMMALN(float $value) : float
Returns the natural logarithm of the gamma function.
float
floatGEOMEAN() : float
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[, ...]])
| access | public |
|---|---|
| category | Statistical Functions |
floatGROWTH(array $yValues, array $xValues, array $newValues, boolean $const) : array
Returns values along a predicted emponential trend
arrayof mixed Data Series Y
arrayof mixed Data Series X
arrayof mixed Values of X for which we want to find Y
booleanA logical value specifying whether to force the intersect to equal 0.
arrayof floatHARMEAN() : float
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[, ...]])
| access | public |
|---|---|
| category | Statistical Functions |
floatHYPGEOMDIST(float $sampleSuccesses, float $sampleNumber, float $populationSuccesses, float $populationNumber) : float
Returns the hypergeometric distribution. HYPGEOMDIST returns the probability of a given number of sample successes, given the sample size, population successes, and population size.
floatNumber of successes in the sample
floatSize of the sample
floatNumber of successes in the population
floatPopulation size
floatINTERCEPT(array $yValues, array $xValues) : float
Calculates the point at which a line will intersect the y-axis by using existing x-values and y-values.
arrayof mixed Data Series Y
arrayof mixed Data Series X
floatKURT() : float
Returns the kurtosis of a data set. Kurtosis characterizes the relative peakedness or flatness of a distribution compared with the normal distribution. Positive kurtosis indicates a relatively peaked distribution. Negative kurtosis indicates a relatively flat distribution.
floatLARGE() : float
Returns the nth largest value in a data set. You can use this function to select a value based on its relative standing.
Excel Function: LARGE(value1[,value2[, ...]],entry)
| access | public |
|---|---|
| category | Statistical Functions |
floatLINEST(array $yValues, array $xValues, boolean $const, boolean $stats) : array
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.
arrayof mixed Data Series Y
arrayof mixed Data Series X
booleanA logical value specifying whether to force the intersect to equal 0.
booleanA logical value specifying whether to return additional regression statistics.
arrayLOGEST(array $yValues, array $xValues, boolean $const, boolean $stats) : array
Calculates an exponential curve that best fits the X and Y data series, and then returns an array that describes the line.
arrayof mixed Data Series Y
arrayof mixed Data Series X
booleanA logical value specifying whether to force the intersect to equal 0.
booleanA logical value specifying whether to return additional regression statistics.
arrayLOGINV(float $probability, float $mean, float $stdDev) : float
Returns the inverse of the normal cumulative distribution
| todo | Try implementing P J Acklam's refinement algorithm for greater accuracy if I can get my head round the mathematics (as described at) http://home.online.no/~pjacklam/notes/invnorm/ |
|---|
float
float
float
floatLOGNORMDIST(float $value, float $mean, float $stdDev) : float
Returns the cumulative lognormal distribution of x, where ln(x) is normally distributed with parameters mean and standard_dev.
float
float
float
floatMAX() : float
MAX returns the value of the element of the values passed that has the highest value, with negative numbers considered smaller than positive numbers.
Excel Function: MAX(value1[,value2[, ...]])
| access | public |
|---|---|
| category | Statistical Functions |
floatMAXA() : float
Returns the greatest value in a list of arguments, including numbers, text, and logical values
Excel Function: MAXA(value1[,value2[, ...]])
| access | public |
|---|---|
| category | Statistical Functions |
floatMAXIF($aArgs, string $condition, $sumArgs) : float
Counts the maximum value within a range of cells that contain numbers within the list of arguments
Excel Function: MAXIF(value1[,value2[, ...]],condition)
| access | public |
|---|---|
| category | Mathematical and Trigonometric Functions |
stringThe criteria that defines which cells will be checked.
floatMEDIAN() : float
Returns the median of the given numbers. The median is the number in the middle of a set of numbers.
Excel Function: MEDIAN(value1[,value2[, ...]])
| access | public |
|---|---|
| category | Statistical Functions |
floatMIN() : float
MIN returns the value of the element of the values passed that has the smallest value, with negative numbers considered smaller than positive numbers.
Excel Function: MIN(value1[,value2[, ...]])
| access | public |
|---|---|
| category | Statistical Functions |
floatMINA() : float
Returns the smallest value in a list of arguments, including numbers, text, and logical values
Excel Function: MINA(value1[,value2[, ...]])
| access | public |
|---|---|
| category | Statistical Functions |
floatMINIF($aArgs, string $condition, $sumArgs) : float
Returns the minimum value within a range of cells that contain numbers within the list of arguments
Excel Function: MINIF(value1[,value2[, ...]],condition)
| access | public |
|---|---|
| category | Mathematical and Trigonometric Functions |
stringThe criteria that defines which cells will be checked.
floatMODE() : float
Returns the most frequently occurring, or repetitive, value in an array or range of data
Excel Function: MODE(value1[,value2[, ...]])
| access | public |
|---|---|
| category | Statistical Functions |
floatNEGBINOMDIST(float $failures, float $successes, float $probability) : float
Returns the negative binomial distribution. NEGBINOMDIST returns the probability that there will be number_f failures before the number_s-th success, when the constant probability of a success is probability_s. This function is similar to the binomial distribution, except that the number of successes is fixed, and the number of trials is variable. Like the binomial, trials are assumed to be independent.
floatNumber of Failures
floatThreshold number of Successes
floatProbability of success on each trial
floatNORMDIST(float $value, float $mean, float $stdDev, boolean $cumulative) : float
Returns the normal distribution for the specified mean and standard deviation. This function has a very wide range of applications in statistics, including hypothesis testing.
float
floatMean Value
floatStandard Deviation
boolean
floatNORMINV($probability, float $mean, float $stdDev) : float
Returns the inverse of the normal cumulative distribution for the specified mean and standard deviation.
floatMean Value
floatStandard Deviation
floatNORMSDIST(float $value) : float
Returns the standard normal cumulative distribution function. The distribution has a mean of 0 (zero) and a standard deviation of one. Use this function in place of a table of standard normal curve areas.
float
floatNORMSINV(float $value) : float
Returns the inverse of the standard normal cumulative distribution
float
floatPERCENTILE() : float
Returns the nth percentile of values in a range..
Excel Function: PERCENTILE(value1[,value2[, ...]],entry)
| access | public |
|---|---|
| category | Statistical Functions |
floatPERCENTRANK(array $valueSet, \number $value, \number $significance) : float
Returns the rank of a value in a data set as a percentage of the data set.
arrayof number An array of, or a reference to, a list of numbers.
\numberThe number whose rank you want to find.
\numberThe number of significant digits for the returned percentage value.
floatPERMUT(int $numObjs, int $numInSet) : int
Returns the number of permutations for a given number of objects that can be selected from number objects. A permutation is any set or subset of objects or events where internal order is significant. Permutations are different from combinations, for which the internal order is not significant. Use this function for lottery-style probability calculations.
intNumber of different objects
intNumber of objects in each permutation
intNumber of permutationsPOISSON(float $value, float $mean, boolean $cumulative) : float
Returns the Poisson distribution. A common application of the Poisson distribution is predicting the number of events over a specific time, such as the number of cars arriving at a toll plaza in 1 minute.
float
floatMean Value
boolean
floatQUARTILE() : float
Returns the quartile of a data set.
Excel Function: QUARTILE(value1[,value2[, ...]],entry)
| access | public |
|---|---|
| category | Statistical Functions |
floatRANK(\number $value, array $valueSet, mixed $order) : float
Returns the rank of a number in a list of numbers.
\numberThe number whose rank you want to find.
arrayof number An array of, or a reference to, a list of numbers.
mixedOrder to sort the values in the value set
floatRSQ(array $yValues, array $xValues) : float
Returns the square of the Pearson product moment correlation coefficient through data points in known_y's and known_x's.
arrayof mixed Data Series Y
arrayof mixed Data Series X
floatSKEW() : float
Returns the skewness of a distribution. Skewness characterizes the degree of asymmetry of a distribution around its mean. Positive skewness indicates a distribution with an asymmetric tail extending toward more positive values. Negative skewness indicates a distribution with an asymmetric tail extending toward more negative values.
floatSLOPE(array $yValues, array $xValues) : float
Returns the slope of the linear regression line through data points in known_y's and known_x's.
arrayof mixed Data Series Y
arrayof mixed Data Series X
floatSMALL() : float
Returns the nth smallest value in a data set. You can use this function to select a value based on its relative standing.
Excel Function: SMALL(value1[,value2[, ...]],entry)
| access | public |
|---|---|
| category | Statistical Functions |
floatSTANDARDIZE(float $value, float $mean, float $stdDev) : float
Returns a normalized value from a distribution characterized by mean and standard_dev.
floatValue to normalize
floatMean Value
floatStandard Deviation
floatStandardized valueSTDEV() : float
Estimates standard deviation based on a sample. The standard deviation is a measure of how widely values are dispersed from the average value (the mean).
Excel Function: STDEV(value1[,value2[, ...]])
| access | public |
|---|---|
| category | Statistical Functions |
floatSTDEVA() : float
Estimates standard deviation based on a sample, including numbers, text, and logical values
Excel Function: STDEVA(value1[,value2[, ...]])
| access | public |
|---|---|
| category | Statistical Functions |
floatSTDEVP() : float
Calculates standard deviation based on the entire population
Excel Function: STDEVP(value1[,value2[, ...]])
| access | public |
|---|---|
| category | Statistical Functions |
floatSTDEVPA() : float
Calculates standard deviation based on the entire population, including numbers, text, and logical values
Excel Function: STDEVPA(value1[,value2[, ...]])
| access | public |
|---|---|
| category | Statistical Functions |
floatSTEYX(array $yValues, array $xValues) : float
Returns the standard error of the predicted y-value for each x in the regression.
arrayof mixed Data Series Y
arrayof mixed Data Series X
floatTDIST(float $value, float $degrees, float $tails) : float
Returns the probability of Student's T distribution.
floatValue for the function
floatdegrees of freedom
floatnumber of tails (1 or 2)
floatTINV(float $probability, float $degrees) : float
Returns the one-tailed probability of the chi-squared distribution.
floatProbability for the function
floatdegrees of freedom
floatTREND(array $yValues, array $xValues, array $newValues, boolean $const) : array
Returns values along a linear trend
arrayof mixed Data Series Y
arrayof mixed Data Series X
arrayof mixed Values of X for which we want to find Y
booleanA logical value specifying whether to force the intersect to equal 0.
arrayof floatTRIMMEAN() : float
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)
| access | public |
|---|---|
| category | Statistical Functions |
floatVARA() : float
Estimates variance based on a sample, including numbers, text, and logical values
Excel Function: VARA(value1[,value2[, ...]])
| access | public |
|---|---|
| category | Statistical Functions |
floatVARFunc() : float
Estimates variance based on a sample.
Excel Function: VAR(value1[,value2[, ...]])
| access | public |
|---|---|
| category | Statistical Functions |
floatVARP() : float
Calculates variance based on the entire population
Excel Function: VARP(value1[,value2[, ...]])
| access | public |
|---|---|
| category | Statistical Functions |
floatVARPA() : float
Calculates variance based on the entire population, including numbers, text, and logical values
Excel Function: VARPA(value1[,value2[, ...]])
| access | public |
|---|---|
| category | Statistical Functions |
floatWEIBULL(float $value, float $alpha, float $beta, boolean $cumulative) : float
Returns the Weibull distribution. Use this distribution in reliability analysis, such as calculating a device's mean time to failure.
float
floatAlpha Parameter
floatBeta Parameter
boolean
floatZTEST(float $dataSet, float $m0, float $sigma) : float
Returns the Weibull distribution. Use this distribution in reliability analysis, such as calculating a device's mean time to failure.
float
floatAlpha Parameter
floatBeta Parameter
float_beta(\p $p, \q $q) :
| author | Jaco van Kooten |
|---|
\prequire p>0
\qrequire q>0
_betaFraction($x, $p, $q)
Based on an idea from Numerical Recipes (W.H. Press et al, 1992).
| author | Jaco van Kooten |
|---|
_checkTrendArrays($array1, $array2)
_gamma($data)
_incompleteBeta(\x $x, \p $p, \q $q) :
| author | Jaco van Kooten |
|---|---|
| author | Paul Meagher The computation is based on formulas from Numerical Recipes, Chapter 6.4 (W.H. Press et al, 1992). |
\xrequire 0<=x<=1
\prequire p>0
\qrequire q>0
_incompleteGamma($a, $x)
_inverse_ncdf($p)
_inverse_ncdf2($prob)
_inverse_ncdf3($p)
_logBeta(\p $p, \q $q) :
| author | Jaco van Kooten |
|---|
\prequire p>0
\qrequire q>0
_logGamma($x)
_modeCalc($data)
$_logBetaCache_p
$_logBetaCache_q
$_logBetaCache_result
$_logGammaCache_result
$_logGammaCache_x