[Math] Normalizing a Gaussian Distribution

MATLABnormal distributionprobabilityrandom

Assuming a Gaussian distribution with mean of zero and standard deviation of one, I would like to normalize this for an arbitrary mean and standard deviation.

I know you're supposed to add the mean and multiply by the standard deviation. It's the multiplying by the standard deviation that I'm not seeing.

I have a set of $2^{20}$ Gaussian-distributed random numbers generated with MatLab's randn() function. Let's call it matrix $A$. Suppose I have another matrix $B = 40 + 10A$. When I plot $A$ and $B$ in a histogram together, $B$ and $A$ have different widths as they should, but the same height, as shown in the images below.

Normally (no pun intended) I would expect to see something like this, with different heights:enter image description here

But instead, I'm seeing something like this:enter image description here

Best Answer

Histogram will show you the number of samples in each bucket. Since your sample size and number of buckets didn't change the values in histogram will stay the same. You can scale the number of bins to get closer to the graph you're expecting.

Note that it will still be discrete bars. To get a smooth curve you can use kernel density smoothing technique.

Related Question