1
0
mirror of https://github.com/aportelli/LatAnalyze.git synced 2025-06-18 07:17:05 +01:00

Histogram: percentiles & confidence interval

This commit is contained in:
2015-11-24 16:27:47 +00:00
parent 3f28430e4a
commit 9be76b11d7
3 changed files with 132 additions and 26 deletions

View File

@ -51,6 +51,14 @@ int main(void)
}
h.setFromData(gauss, -5., 5., 40);
h.normalize();
cout << " median= " << h.median() << endl;
for (double s = 1.; s < 5.; ++s)
{
auto ci = h.confidenceInterval(s);
cout << static_cast<int>(s) << " sigma(s) interval= [";
cout << ci.first << ", " << ci.second << "]" << endl;
}
p << PlotHistogram(h);
p << PlotFunction(compile("return exp(-x_0^2/2)/sqrt(2*pi);", 1), -5., 5.);
p.display();