mirror of
https://github.com/aportelli/LatAnalyze.git
synced 2024-11-10 00:45:36 +00:00
Math: chi^2 p-value function from GSL
This commit is contained in:
parent
7561d419a3
commit
f251769a1c
@ -19,6 +19,7 @@
|
||||
|
||||
#include <LatAnalyze/Math.hpp>
|
||||
#include <LatAnalyze/includes.hpp>
|
||||
#include <gsl/gsl_cdf.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace Latan;
|
||||
@ -90,3 +91,11 @@ DEF_STD_FUNC_2ARG(fmin)
|
||||
|
||||
// Absolute value
|
||||
DEF_STD_FUNC_1ARG(fabs)
|
||||
|
||||
// p-value
|
||||
auto chi2PValueVecFunc = [](const double arg[2])
|
||||
{
|
||||
return gsl_cdf_chisq_Q(arg[0], arg[1]);
|
||||
};
|
||||
|
||||
DoubleFunction MATH_NAMESPACE::chi2PValue(chi2PValueVecFunc, 2);
|
||||
|
@ -141,6 +141,15 @@ DECL_STD_FUNC(fmin)
|
||||
// Absolute value
|
||||
DECL_STD_FUNC(fabs)
|
||||
|
||||
/******************************************************************************
|
||||
* Other functions *
|
||||
******************************************************************************/
|
||||
// p-value
|
||||
namespace MATH_NAMESPACE
|
||||
{
|
||||
extern DoubleFunction chi2PValue;
|
||||
}
|
||||
|
||||
END_LATAN_NAMESPACE
|
||||
|
||||
#endif // Latan_Math_hpp_
|
||||
|
Loading…
Reference in New Issue
Block a user