[Math] How to create a 2d Gaussian Distribution from a 1d Gaussian Distribution

probabilityprobability distributionsprobability theory

Currently I have a vector of values $x [v_1,\ldots,v_n]$. I can plot the 1d Gaussian by plotting each point $\exp(-(v_i – \mu)^2/(2\sigma^2))\sqrt{2\pi\sigma^2}\cdots$ This gives me a nice looking normal distribution.. However I am trying to graph two different classes and their respective Gaussian and want to show how their probabilities overlap an how difficult it may be to linearly separate them. I was thinking of using a 2d Gaussian to do this, but I am drawing a blank. The formulas I have been trying $\exp(-( (x_i – \mu_x)/(2\sigma_x^2) + (y_i – \mu_y)/(s\sigma_y^2) ))$ are not giving me the representation I wish.. Or maybe I am just plotting it incorrectly..

Any Ideas?

Thanks!

Best Answer

You seem to have drawn a density function. $\mu$ and $\sigma^2$ do not need to be the mean and variance of your values to do this.

So try to draw a second similar curve for the function with the same $v_i$ and slightly different values for $\mu$ and $\sigma^2$. If the two $\mu$s are close enough (depending on the $\sigma^2$s) then there should be a visible overlap. Any value $v$ appearing in the middle of this overlap could reasonbly come from either distribution.

enter image description here