11/*
22 * This file is part of the GreasePad distribution (https://github.com/FraunhoferIOSB/GreasePad).
3- * Copyright (c) 2022-2023 Jochen Meidow, Fraunhofer IOSB
3+ * Copyright (c) 2022-2026 Jochen Meidow, Fraunhofer IOSB
44 *
55 * This program is free software: you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
2121
2222#include " statistics/chisquared.h"
2323#include " statistics/exponential.h"
24+ #include " statistics/normal.h"
2425#include " statistics/prob.h"
2526
2627// ! Quantiles for recognition and snapping
@@ -35,7 +36,12 @@ struct Snapping
3536
3637 // ! Get quantile of chi-square distribution with two degree of freedom
3738 [[nodiscard]] double quantile_chi2_1dof () const { return quantile_chi2_1_; }
38- void setAlpha ( Stats::Prob alpha ); // !< Set significance level alpha
39+
40+ // ! Set significance level alpha
41+ void setAlpha ( Stats::Prob alpha ) {
42+ quantile_snd_ = Stats::StandardNormal::icdf ( alpha.complement () );
43+ quantile_chi2_1_ = distr_chi2_1_.icdf ( alpha.complement () );
44+ }
3945
4046private:
4147 double quantile_snd_{}; // Quantile of standard normal distribution N(0,1)
@@ -55,7 +61,12 @@ struct Recognition
5561
5662 // ! Get quantile of chi-square distribution with two degree of freedom
5763 [[nodiscard]] double quantile_chi2_2dof () const { return quantile_chi2_2dof_; }
58- void setAlpha ( Stats::Prob alpha ); // !< Set significance level alpha
64+
65+ // ! Set significance level alpha
66+ void setAlpha ( Stats::Prob alpha ) {
67+ quantile_chi2_1dof_ = distr_chi2_1_.icdf ( alpha.complement () );
68+ quantile_chi2_2dof_ = distr_Exp_0p5_.icdf ( alpha.complement () );
69+ }
5970
6071private:
6172 double quantile_chi2_1dof_{};
0 commit comments