<jupyter_start><jupyter_text>Gaussian, Laplacian and student-t distributionThe Gaussian (Normal) distribution is given by,$$\mathcal{N}(x;\mu,\sigma^2)\triangleq\frac{1}{\sqrt{2\pi\sigma^2}}exp\bigg(-\frac{1}{2}\frac{(x-\mu)^2}{\sigma^2}\bigg)$$The Laplacian distribution is given by,$$Lap(x;\mu,b)\triangleq \frac{1}{2b}exp\big(-\frac{|x-\mu|}{b}\big)$$The student distribution is given by,$$\mathcal{T}(x;\mu,\sigma^2,\nu) \varpropto \bigg[1+\frac{1}{\nu}\bigg(\frac{x-\mu}{\sigma}\bigg)^2\bigg]^{-\frac{\nu+1}{2}}$$  Distribution Gaussian<jupyter_code>def GaussDis(x,mu,var):
    y = np.exp(-(x-mu)**2/var)/np.sqrt(2*np.pi*var)
    return y
x = np.linspace(-4,4,10000)
mu = 0
var = 1
y = GaussDis(x,mu,var)
s = np.random.normal(mu, var, 10000)
count, bins, ignored = plt.hist(s, 30, density=True)
count, bins, ignored = plt.hist(s, 30, density=True)
plt.plot(x,y)<jupyter_output><empty_output><jupyter_text>Laplacian$$r = \mu-b\frac{u}{|u|}\log(1-2|u|)\ \text{where }u\sim \mathbb{U}[0,1]$$<jupyter_code>def LaplaceDist(x,mu,b):
    y = np.exp(-np.abs(x-mu)/b)/2/b
    return y 
b = 1/np.sqrt(2)
y = LaplaceDist(x,mu,b)
s = np.random.normal(mu, b, 10000)
count, bins, ignored = plt.hist(s, 30, density=True)
count, bins, ignored = plt.hist(s, 30, density=True)
plt.plot(x,y)<jupyter_output><empty_output><jupyter_text>Student-t<jupyter_code>sigma = 1
v = 1
def StudentDist(x,mu,sigma,v):
    y = (1+((x-mu)/sigma)**2/v)**(-(v+1)/2)
    return y 
y = StudentDist(x,mu,sigma,v)
plt.plot(x,y)
# might be wrong
s = np.random.standard_t(100, 10000)
count, bins, ignored = plt.hist(s, 30, density=True)<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup