Home Libraries People FAQ More

學生t分佈(Students t Distribution)

#include <boost/math/distributions/students_t.hpp>

namespace boost{ namespace math{

template <class RealType = double,
class Policy   = policies::policy<> >
class students_t_distribution;

typedef students_t_distribution<> students_t;

template <class RealType, class Policy>
class students_t_distribution
{
typedef RealType value_type;
typedef Policy   policy_type;

// 構造:
students_t_distribution(const RealType& v);

// 訪問函數(Accessor):
RealType degrees_of_freedom()const;

// 自由度估算(degrees of freedom estimation):
static RealType find_degrees_of_freedom(
RealType difference_from_mean,
RealType alpha,
RealType beta,
RealType sd,
RealType hint = 100);
};

}} // namespaces

成員函數
students_t_distribution(const RealType& v);

RealType degrees_of_freedom()const;

static RealType find_degrees_of_freedom(
RealType difference_from_mean,
RealType alpha,
RealType beta,
RealType sd,
RealType hint = 100);

difference_from_mean

alpha

beta

sd

hint

注意 記住：對於一個雙面測試( two-sided test)，在調用這個函數之前，你必須用2除以alpha。

實現

pdf

cdf

p = 1 - z 如果 t > 0

p = z 否則

ibeta(v / 2, 0.5, v / (v + t2)) / 2 如果 v < 2t2

ibetac(0.5, v / 2, t2 / (v + t2) / 2 否則

cdf 補集(complement)

x = ibeta_inv(v / 2, 0.5, 2 * min(p, q))

y = 1 - x

0

v / (v - 2)

0

0

3 * (v - 2) / (v - 4)

6 / (df - 4)