/* -*- MaTX -*- * * 【名前】 * randn() - 正規乱数 * * 【形式】 * y = randn() * Real y; * * Y = randn(n) * Array Y; * Integer n; * * Y = randn(m,n) * Array Y; * Integer m,n; * * Y = randn(X) * Array Y; * (Matrix|Array) X; * * s = randn("seed"); * Integer s; * * p = randn("seed", s); * Integer p; * Integer s; * * 【機能説明】 * randn()は,平均 0,分散 1 の正規分布する乱数を生成する。整数 n に * ついて,randn(n)は n x n の正規乱数配列を返す。randn(m,n) は, * m x n の正規乱数配列を返す。X が行列のとき,randn(X) は,X と同じ * 大きさの正規乱数配列を返す。 * * 乱数列は乱数発生器の状態に依存して決定され,乱数発生器の状態は * 種によって変更できる。randn("seed") は正規乱数の種(Integer)を返し, * randn("seed", m) は正規乱数の種を整数 m に設定する。 * * 【例題】 * 1 x 4 の正規乱数配列を生成する。 * * >> Y = randn(1, 4) * === [Y] : ( 1, 4) === * ( 1) ( 2) ( 3) ( 4) * ( 1) -9.833774E-01 -8.557007E-01 2.142212E-01 -8.026744E-01 * * 【アルゴリズム】 * 文献 1, 2 参照。 * * 【関連項目】 * rand() * * 【参考文献】 * [1] William H. Press and Brian P. Flannery and Saul A. Teukolsky * and William T. Veterling, Numerical Recipes in C (The Art of * Scientific Computing), Cambridge University Press, 1988 * * [2] 丹慶 勝市, 奥村 晴彦, 佐藤 俊朗, 小林 誠, * ニューメリカルレシピ・イン・シー, 技術評論社, 1993 */