File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -166,5 +166,17 @@ auto chi2CcdfVecFunc = [](const double arg[2])
166166 return gsl_cdf_chisq_Q (arg[0 ], arg[1 ]);
167167};
168168
169+ auto hotellingT2PValueVecFunc = [](const double arg[3 ])
170+ {
171+ double T2 = arg[0 ];
172+ double n = arg[1 ];
173+ double p = arg[2 ];
174+ double F = (n - p) / (p * (n - 1 )) * T2;
175+ double p_value = 1.0 - gsl_cdf_fdist_P (F, p, n - p);
176+
177+ return p_value;
178+ };
179+
169180DoubleFunction MATH_NAMESPACE::chi2PValue (chi2PValueVecFunc, 2 );
170181DoubleFunction MATH_NAMESPACE::chi2Ccdf (chi2CcdfVecFunc, 2 );
182+ DoubleFunction MATH_NAMESPACE::hotellingT2PValue (hotellingT2PValueVecFunc, 3 );
Original file line number Diff line number Diff line change @@ -160,6 +160,7 @@ namespace MATH_NAMESPACE
160160{
161161 extern DoubleFunction chi2PValue;
162162 extern DoubleFunction chi2Ccdf;
163+ extern DoubleFunction hotellingT2PValue;
163164}
164165
165166END_LATAN_NAMESPACE
You can’t perform that action at this time.
0 commit comments