Skip to content

Commit 5282dd8

Browse files
committed
file quantiles.cpp removed
1 parent 3c629e7 commit 5282dd8

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

src/greasepad.pro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ SOURCES += \
3838
gui/qformattool.cpp \
3939
main.cpp \
4040
matrix.cpp \
41-
quantiles.cpp \
4241
state.cpp \
4342
uncertain/quncertain.cpp \
4443
uncertain/upoint.cpp \

src/quantiles.h

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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
@@ -21,6 +21,7 @@
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

4046
private:
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

6071
private:
6172
double quantile_chi2_1dof_{};

0 commit comments

Comments
 (0)