在Matlab中将经验分布转换为均匀分布的功能? [英] Function to transform empirical distribution to a uniform distribution in Matlab?
本文介绍了在Matlab中将经验分布转换为均匀分布的功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道通过使用CDF将一种分布转换为另一种分布的过程.但是,我想知道Matlab中是否存在可以执行此任务的功能?
I know the procedure of transforming one distribution to another by the use of CDF. However, I would like to know if there is existing function in Matlab which can perform this task?
我的另一个相关问题是,我使用Matlab中的ecdf()
函数计算具有10,000
值的分布的经验CDF.但是,我从中获得的输出仅包含9967
值.如何获得CDF的总10,000
值?谢谢.
My another related question is that I computed CDF of my empirical using ecdf()
function in Matlab for a distribution with 10,000
values. However, the output that I get from it contains only 9967
values. How can I get total 10,000
values for my CDF? Thanks.
推荐答案
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
这篇关于在Matlab中将经验分布转换为均匀分布的功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文