Home Libraries People FAQ More

##### 均勻分佈(Uniform Distribution)

`#include <boost/math/distributions/uniform.hpp>`

```namespace boost{ namespace math{
template <class RealType = double,
class Policy   = policies::policy<> >
class uniform_distribution;

typedef uniform_distribution<> uniform;

template <class RealType, class Policy>
class uniform_distribution
{
public:
typedef RealType value_type;

uniform_distribution(RealType lower = 0, RealType upper = 1); // 構造函數.
: m_lower(lower), m_upper(upper) // 缺省為標準均勻分佈(standard uniform distribution).
// 訪問函數(Accessor functions).
RealType lower()const;
RealType upper()const;
}; // 類 uniform_distribution

}} // namespaces
```

f(x) =

• 1 / (upper - lower) 對於 lower < x < upper
• zero 對於 x < lower 或者 x > upper

• 1 / (upper - lower) 對於 x = lower 或者 x = upper

lower 參數也稱作位置參數(location parameter)那就是 origin of a plot 的位置 ，且(upper - lower) 被稱作 尺度參數(scale parameter)

##### 成員函數
```uniform_distribution(RealType lower = 0, RealType upper = 1);
```

```RealType lower()const;
```

```RealType upper()const;
```

##### 實現

pdf

cdf

cdf 補集(complement)

x = -q * (b - a) + b

(a + b) / 2

(b - a) 2 / 12

0

-6/5 = -1.2 exactly. (kurtosis - 3)

9/5