NotePublic/Algorithm/Statistics/高斯分布.md

33 lines
522 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 高斯分布
## 一维高斯分布
$$G(x)=\frac{1}{\sigma\sqrt{2\pi}}e^{-\frac{(x-\mu)^2}{2\sigma^2}}$$
Matlab 图像绘制程序:
```m
sig=1;
mu=0;
x=-5:0.1:5;
gx=e.^(-(x-mu).^2/(2*sig^2))/(sig*sqrt(2*pi));
plot(x, gx)
```
## 二维高斯分布
$$G(x,y)=Ae^{(-\frac{(x-x_0)^2}{2\sigma_x^2}+\frac{(y-y_0)^2}{2\sigma_y^2})}$$
Matlab 图像绘制程序:
```m
% A=1
% σx=σy=1
% x0=y0=0
x1 = [0:0.1:10];
y1 = [0:0.1:10];
[x,y] = meshgrid(x1,y1);
gxy = exp(-((x-5).*(x-5)+(y-5).*(y-5))/2);
surf(x, y, gxy);
```