Manipulate data to better match the Gaussian distribution

I have a question about the normal distribution (c mu = 0and sigma = 1).

Say I first call randn or normrnd this way

x = normrnd(0,1,[4096,1]); % x = randn(4096,1)

Now, to evaluate how good the x values ​​correspond to the normal distribution, I call

[a,b] = normfit(x);

and have graphical support

histfit(x)

Now let's get to the bottom of the question: if I'm not satisfied enough with how x corresponds to a given normal distribution, how can I optimize x to better match the expected normal distribution with 0 mean and 1 standard deviation? Sometimes, due to several presentation values ​​(i.e. 4096 in this case), x is very poorly suited to the expected Gauss, so I want to manipulate x ( linearly or not , it doesn't matter at this stage) to get a better physical shape.

I would like to note that I have access to a statistical set of tools.

EDIT

  • normrnd randn, . , .

  • ?

  • , , , : enter image description here

+5
2

, , value = 0 = 1. :

y=(x-mean(x))/std(x);
+3

, , , CDF. , . .

x = randn(1000, 1) + 4 * (rand(1000, 1) < 0.5); % some funky bimodal distribution
xr = linspace(-5, 9, 2000);
cdf = cumsum(ksdensity(x, xr, 'width', 0.5)); cdf = cdf / cdf(end); % you many want to use a better smoother
c = interp1(xr, cdf, x); % function composition step 1
y = norminv(c); % function composition step 2
% take a look at the result
figure;
subplot(2,1,1); hist(x, 100);
subplot(2,1,2); hist(y, 100);
+1

All Articles