0

我知道使用 CDF 将一种分布转换为另一种分布的过程。但是,我想知道 Matlab 中是否存在可以执行此任务的函数?

我的另一个相关问题是,我ecdf()在 Matlab 中计算了我的经验使用函数的 CDF,用于具有10,000值的分布。但是,我从中获得的输出仅包含9967值。如何获得10,000CDF 的总值?谢谢。

4

3 回答 3

1

正如您所说,您所需要的只是 CDF。正态分布的CDF可以用erfMatlab 函数表示。

未经测试的例子:

C = @(x)(0.5 * (1 + erf(x/sqrt(2))));

x = randn(1,1000);  % Zero-mean, unit variance
y = C(x);           % Approximately uniform
于 2012-07-03T20:37:14.380 回答
1
for t=1:nT 
    [f_CDFTemp,x_CDFTemp]=ecdf(uncon_noise_columndata_all_nModels_diff_t(:,1,t)); % compute CDF of empirical distribution
    f_CDF(1:length(f_CDFTemp),t) = f_CDFTemp; % store the CDF of different distributions with unequal size in a new variable
    x_CDF(1:length(x_CDFTemp),t) = x_CDFTemp;
    b_unifdist=4*t;
    [Noise.N, Noise.X]=hist((a_unifdist+(b_unifdist-a_unifdist).*f_CDF(:,t)),100); % generate the uniform distribution by using the CDF of empirical distribution as the CDF of the uniform distribution
    generatedNoise(:,:,t)=emprand(Noise.X,nRows,nCol); % sample some random numbers from the uniform distribution generated above by using 'emrand' function
end
于 2012-07-07T22:57:14.260 回答
0

这并不完全是您正在寻找的东西,但它显示了如何做相反的事情。逆转它应该没有那么糟糕。

于 2012-07-03T19:33:21.833 回答