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

p-value now 2-sided and added chi^2 CCDF

This commit is contained in:
2019-12-12 18:04:33 +00:00
parent d30303bb54
commit 0ca4e0ef17
8 changed files with 53 additions and 4 deletions

View File

@ -107,8 +107,14 @@ DEF_STD_FUNC_1ARG(fabs)
// p-value
auto chi2PValueVecFunc = [](const double arg[2])
{
return 2.*min(gsl_cdf_chisq_P(arg[0], arg[1]), gsl_cdf_chisq_Q(arg[0], arg[1]));
};
auto chi2CcdfVecFunc = [](const double arg[2])
{
return gsl_cdf_chisq_Q(arg[0], arg[1]);
};
DoubleFunction MATH_NAMESPACE::chi2PValue(chi2PValueVecFunc, 2);
DoubleFunction MATH_NAMESPACE::chi2Ccdf(chi2CcdfVecFunc, 2);

View File

@ -152,6 +152,7 @@ DECL_STD_FUNC(fabs)
namespace MATH_NAMESPACE
{
extern DoubleFunction chi2PValue;
extern DoubleFunction chi2Ccdf;
}
END_LATAN_NAMESPACE