20 #include <mlpack/core.hpp> 21 #include <boost/math/distributions.hpp> 33 using namespace boost::math;
35 students_t dist(n - 1);
36 double T =
quantile(complement(dist, alpha/2));
37 return T*stddev / sqrt(
double(n));
49 using namespace boost::math;
51 chi_squared dist(n - 1);
52 double lower_limit = sqrt((n - 1) * stddev*stddev /
quantile(complement(dist, alpha/2)));
53 double upper_limit = sqrt((n -1 ) * stddev*stddev /
quantile(dist, alpha/2));
54 return pair<double, double>(lower_limit, upper_limit);
VESPUCCI_EXPORT double TInterval(double alpha, double stddev, unsigned int n)
Vespucci::Math::Stats::TInterval.
VESPUCCI_EXPORT std::pair< double, double > ChiSquaredInterval(double alpha, double stddev, unsigned int n)
Vespucci::Math::Stats::ChiSquaredInterval.
VESPUCCI_EXPORT double quantile(arma::vec &data, double probs)