n
次の入力が与えられた場合に、ガウス分布を仮定して乱数を生成する MATLAB プログラムが必要です。
- 2 つの手段 (x 軸と y 軸)
- 標準偏差
- 分散 (共分散行列 = 標準偏差 x 単位行列)
ガウス分布の別名は、正規分布です。多次元は多変量とも呼ばれます。したがって、以下を参照してください: Matlab の多変量正規分布。
統計ツールボックスにアクセスできない場合は、次を(x,y)
使用して正規分布データのペアを作成できます。randn
%# create an array of 100 pairs of normally distributed
%# coordinates with mu=0 and sigma=1
xy = randn(100,2);
%# transform the data such that means equal mu
%# and standard deviations equal sigma (no cross-correlation)
mu = [3,25]; %# means for x, y
sigma = [9,1]; % standard deviations for x,y
xy = bsxfun(@times,xy,sigma); %# fix standard deviation
xy = bsxfun(@plus,xy,mu); %# fix means