我使用简单随机抽样和拉丁超立方抽样来找出这两种方法之间的差异,因为我们计算图像的 1 个像素的变量并查看均值和方差这两种方法的差异。迭代次数为 1000,样本数 (N) 为 [10 30 50 100]。有谁知道我怎样才能在相同的代码中为 2 个像素或更多像素做同样的事情?
我的代码示例是(其中“统一”用于 LH,“随机”用于 SR):
m = 0; % zero mean
s = 1; % unit standard deviation
Fx = (0.001:0.001:0.999)'; % discretize probability axis
N = 10 % sample size
seedNum = 34567; % random number generator
rng(seedNum); % set random number seed
nIter = 1000 % number of iterations or repetitions of sampling
xSR10 = lhsunivar('normal',N,'random',nIter,m,s);
disp(xSR10)
MeanxSR10 = mean(xSR10);
disp (MeanxSR10);
xLH10 = lhsunivar('normal',N,'uniform',nIter,m,s);
disp (xLH10);
MeanxLH10 = mean(xLH10);
disp (MeanxLH10);