I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
Index » Programming » C/C++ »

lucian\′s Photo
31 Oct 06, 3:33PM
Sorry, just forgot to include two essential parameters when making a call to the PDF function. This block of code, right after reading the user data

printf("\nfunction values:\n\n");
  for (int i = 0; i < N; i++)
    printf("x = %lf\tf(x)= %lf\n",
    x[i], Stats::Dists::Continuous::Normal::PDF(x[i]));
  printf("\n");

should obviously be changed into

printf("\nfunction values:\n\n");
  for (int i = 0; i < N; i++)
    printf("x = %lf\tf(x)= %lf\n",
    x[i], Stats::Dists::Continuous::Normal::PDF(x[i], mean, stdev));
  printf("\n");

You shouldn't have received any compiler errors since this function assigns mean = 0 and stdev = 1 implicitly, as for the standard normal PDF.

Currently you need to be logged in to leave a message.