当前位置:网站首页>拉普拉斯(Laplace)分布
拉普拉斯(Laplace)分布
2022-07-24 07:02:00 【Wanderer001】
参考 拉普拉斯(Laplace)分布 - 云+社区 - 腾讯云
Laplace分布的概率密度函数的形式是这样的:

一般μ的取值为0,所以形式如下:

它是由两个指数函数组成的,所以又叫做双指数函数分布(double exponential distribution)
均值和方差
均值的求解,若X的概率密度函数为f(X),那么X的均值为
,代入以后可以发现里面的积分函数为奇函数,所以均值为0。
方差根据
,因为后面一项为0,所以主要求前一项
,
根据积分公式∫udv=uv−vdu进行求解,得到方差为
。
使用pyplot画概率分布图
import matplotlib.pyplot as plt
import numpy as np
def laplace_function(x, lambda_):
return (1/(2*lambda_)) * np.e**(-1*(np.abs(x)/lambda_))
x = np.linspace(-5,5,10000)
y1 = [laplace_function(x_,1) for x_ in x]
y2 = [laplace_function(x_,2) for x_ in x]
y3 = [laplace_function(x_,0.5) for x_ in x]
plt.plot(x, y1, color='r', label="lambda:1")
plt.plot(x, y2, color='g', label="lambda:2")
plt.plot(x, y3, color='b', label="lambda:0.5")
plt.title("Laplace distribution")
plt.legend()
plt.show()边栏推荐
- Jay Chou's live broadcast was watched by more than 6.54 million people, with a total interaction volume of 450million, helping Kwai break the record again
- C language from entry to soil function
- 记账APP:小哈记账1——欢迎页的制作
- 聚合型新生态模式-分享购,会员及奖励制度
- 第二部分—C语言提高篇_3. 指针强化
- 【时序逻辑电路】——寄存器
- Hackingtool of security tools
- File "manage.py", line 14) from exc ^ syntaxerror: cause and solution of invalid syntax error
- Input the names of 10 people and output them in descending order
- 研究会2022.07.22--对比学习
猜你喜欢
随机推荐
从CIA看常见网络攻击(爆破,PE,流量攻击)
解压主播狂揽4000w+播放,快手美食赛道又添新风向?
【PTA】团体程序设计天梯赛-练习集 L3题目总结(不全)
Empty cup mentality, start again
17. What is the situation of using ArrayList or LinkedList?
The function of extern, static, register, volatile keywords in C language; Nanny level teaching!
我的创作纪念日
【Word】如何生成左侧的索引目录
MITRE ATT&CK超详细学习笔记-02(大量案例)
Variables and data types (03)
baddy:核心函数入口
Part II - C language improvement_ 2. Memory partition
[word] how to generate the index directory on the left
JS_实现多行文本根据换行分隔成数组
File upload and download demo
记账APP:小哈记账2——注册页面的制作
FPGA实现AXI4总线的读写
[steering wheel] the super favorite idea efficiency artifact save actions is uninstalled
Cmake notes
5. Template cache. Drawing a square can only move within the triangle




![[sequential logic circuit] - register](/img/a5/c92e0404c6a970a62595bc7a3b68cd.gif)



