Laplace分布定义:
下面先给出Laplace分布实现代码:
import matplotlib.pyplot as plt
import numpy as np
def laplace_function(x,beta):
result = (1/(2*beta)) * np.e**(-1*(np.abs(x)/beta))
return result
#在-5到5之间等间隔的取10000个数
x = np.linspace(-5,5,10000)
y1 = [laplace_function(x_,0.5) for x_ in x]
y2 = [laplace_function(
2021-03-19 18:07:16
92KB
ace
c
ce
1