The C++ interface for variance.
More...
| array | var (const array &input, bool isbiased=false, int dim=-1) |
| | Variance along a dimension. More...
|
| |
| array | var (const array &input, const array weights, int dim=-1) |
| | Weighted variance along a dimension. More...
|
| |
| template<typename ty > |
| ty | var (const array &input, bool isbiased=false) |
| | Variance of all elements in array. More...
|
| |
| template<typename ty > |
| ty | var (const array &input, const array weights) |
| | Weighted variance of all elements in array. More...
|
| |
The C++ interface for variance.
Returns the variance of a set of elements
| array af::var |
( |
const array & |
input, |
|
|
bool |
isbiased = false, |
|
|
int |
dim = -1 |
|
) |
| |
Variance along a dimension.
- Parameters
-
| [in] | input | |
| [in] | isbiased | if true then use sample variance (N); otherwise if false (default) use population variance (N - 1) where N=input.elements() |
| [in] | dim | dimension along which to operate (-1 indicates first non-singleton dimension) |
| array af::var |
( |
const array & |
input, |
|
|
const array |
weights, |
|
|
int |
dim = -1 |
|
) |
| |
Weighted variance along a dimension.
- Parameters
-
| [in] | input | |
| [in] | weights | placed on each element (same size as input) |
| [in] | dim | dimension along which to operate (-1 indicates first non-singleton dimension) |
- Returns
- variance using nonnegative
weights instead of unit weight
| ty af::var |
( |
const array & |
input, |
|
|
bool |
isbiased = false |
|
) |
| |
Variance of all elements in array.
array a = array(seq(5));
float m = var<float>(a);
printf("%f\n",m);
- Parameters
-
| [in] | input | |
| [in] | isbiased | if true then use sample variance (N); otherwise if false (default) use population variance (N - 1) where N=input.elements() |
| ty af::var |
( |
const array & |
input, |
|
|
const array |
weights |
|
) |
| |
Weighted variance of all elements in array.
- Parameters
-
| [in] | input | |
| [in] | weights | placed on each element (same size as input) |