[Overview][Constants][Types][Classes][Procedures and functions] |
Return variance of values
Source position: line 0
function variance( |
const data: array [] of float |
):float; |
const data: PFloat; |
const N: Integer |
):float; |
Variance returns the variance of the values in the data array. It returns zero if there is only one value.
The second form of the function accepts a pointer to an array of N values.
None.
|
Return total varians of values |
|
|
Return standard deviation of data |
|
|
Return mean value of array |
Program Example50; { Program to demonstrate the Variance function. } Uses math; Type TExArray = Array[1..100] of Float; Var I : Integer; ExArray : TExArray; V : float; begin Randomize; for I:=1 to 100 do ExArray[i]:=(Random-Random)*100; V:=Variance(ExArray); Writeln('Variance : ',V:8:4); V:=Variance(@ExArray[1],100); Writeln('Variance (b) : ',V:8:4); end.