Dear bug-gsl
Hope you are all fine.
This is Mehdi Stegamatian. I am student of "Artificial Intelligence" in
Shiraz University. It is about 6 mounts that I am using GSL. I found
something which appeared to me as a bug. GSL calculates standard deviation
of single number equal to nan! Which sounds a bit vired to me. I am not a
statistician but according to my knowledge the value is zero.
I included the sample code? Could you tell me what is going on?
Best Wishes,
Mehdi
///////////////////////////////////////////////////////////////////////////////
#include <stdio.h>
#include <gsl/gsl_statistics.h>
#include <gsl/gsl_randist.h>
int main()
{
double darr[1][20];
for (int i = 0; i < 20; i++)
{
for (int j = 0; j < 1; j++)
{
darr[j][i] = i+j;
}
}
double mean = gsl_stats_mean((const double *)(darr) + 10, 20, 1);
double stddev = gsl_stats_sd_m((const double *)(darr) + 10, 20, 1,
mean);
printf("mean = %f\n", mean);
printf("stddevvv = %f\n", stddev);
return 0;
}
///////////////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------
This E-mail has been sent using CSE webmail [http://www.cse.shirazu.ac.ir]
If you are not intended recipient of this E-mail, please inform the sender
and Delete it from your box immediately.
_______________________________________________
Bug-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gsl