lognormal#

対数正規分布の乱数を生成します。

説明#

lognormal クラス・オブジェクトは、generate 関数で使用され、対象の正規分布の分布の平均 (ma) と標準偏差 (s\(\sigma\))、変位 (displb)、スケール係数 (scale\(\beta\)) を持つ乱数を生成します。ここで、\(a, \sigma, b, \beta \in \mathbb{R}; \sigma > 0, \beta > 0\) です。

確率密度関数は次のように表されます。

\[\begin{split}f_{a, \sigma, b, \beta} (x) = \begin{cases} \frac{1}{\sigma (x - b) \sqrt {2\pi}} \exp \left( -\frac{\ln( \frac{x - b}{\beta}) - a)^2}{2\sigma^2} \right), & x > b \\ 0, & x \leq b \end{cases}\end{split}\]

累積分布関数は次のようになります。

\[\begin{split}F_{a, \sigma, b, \beta} (x) = \begin{cases} \Phi \left(\frac{\ln( \frac{x - b}{\beta}) - a}{\sigma}\right), & x > b \\ 0, & x \leq b \end{cases}\end{split}\]

API#

構文#

template<typename RealType, typename Method> 
class lognormal { public: 
    using method_type = Method; 
    using result_type = RealType; 

    lognormal() : lognormal((RealType)0.0, (RealType)1.0, (RealType) 0.0, (RealType)1.0){} 
    explicit lognormal(RealType m, RealType s, RealType displ = (RealType)0.0, RealType scale = (RealType)1.0); 
    explicit lognormal(const param_type& pt); 

    RealType m() const; 
    RealType s() const; 
    RealType displ() const; 
    RealType scale() const; 
    param_type param() const; 
    void param(const param_type& pt); 
};

インクルード・ファイル#

  • oneapi/mkl/rng/device.hpp

テンプレート・パラメーター#

typename Type

生成された値のタイプ。固有の値は次のとおりです:

  • float

  • double

typename Method

生成メソッド。固有の値は次のとおりです:

  • oneapi::mkl::rng::device::lognormal_method::by_default

  • oneapi::mkl::rng::device::lognormal_method::box_muller2

配布テンプレート・パラメーター・メソッドのメソッドの説明を参照してください。

: ベクトル数学関数に基づく oneapi::mkl::rng::device::lognormal_method::box_muller2 を有効にするには、MKL_RNG_USE_BINARY_CODE マクロを定義し、インテル® oneAPI マス・カーネル・ライブラリー・リンクラインのアドバイザー (英語) で生成された出力に従って oneMKL 静的ライブラリーをリンクします。一部のハードウェアではパフォーマンスが向上する可能性があります。

入力パラメーター#

名前

タイプ

説明

m

RealType (float, double)

対象の正規分布の平均 a

s

RealType (float, double)

対象の正規分布の標準偏差 \(\sigma\)

displ

RealType (float, double)

変位 displ

scale

RealType (float, double)

スケール係数 scale