Function PGAStddev

Function Documentation

double PGAStddev(PGAContext *ctx, double *a, int n, double mean)

Calculate the standard deviation of an array of elements.

Example

PGAContext *ctx;
double a [100], mean, sigma;

...
mean  = PGAMean (ctx, a, 100);
sigma = PGAStddev (ctx, a, 100, mean);

Parameters
  • ctx – context variable

  • a – array to take the standard deviation of

  • n – number of elements in array a

  • mean – the mean of the elements in array a

Returns

The standard deviation of the n elements in array a