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.
Login