当前位置:网站首页>Laplace distribution
Laplace distribution
2022-07-24 07:23:00 【Wanderer001】
Reference resources Laplace (Laplace) Distribution - cloud + Community - Tencent cloud
Laplace The form of the probability density function of the distribution is :

commonly μ The values for 0, So the form is as follows :

It is composed of two exponential functions , So it is also called double exponential function distribution (double exponential distribution)
Mean and variance
Solution of mean , if X The probability density function of is f(X), that X The mean of
, After substitution, it can be found that the integral function inside is an odd function , therefore The mean for 0.
Variance basis
, Because the latter item is 0, So we mainly ask for the previous item
,
According to the integral formula ∫udv=uv−vdu To solve the , The variance is
.
Use pyplot Draw a probability distribution diagram
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()边栏推荐
- CSDN, it's time to say goodbye!
- win10声音图标有个没有声音
- Basic syntax of MySQL DDL and DML and DQL
- Filter filter
- [tips] a simple method to create a version control project
- 【FreeRTOS】11 软件定时器
- cloud的版本升级
- 【LeetCode-简单】20. 有效的括号 - 栈
- 【C语言入门】ZZULIOJ 1011-1015
- [leetcode] 11. Container with the most water - go language solution
猜你喜欢

Filter filter

项目上线就炸,这谁受得了
![[steering wheel] the super favorite idea efficiency artifact save actions is uninstalled](/img/b0/54a826287154be5b758b3850e7fa51.png)
[steering wheel] the super favorite idea efficiency artifact save actions is uninstalled

MongoDB应用场景及选型(海量数据存储选型)

编译与调试(gcc,g++,gdb)

Aggregated new ecological model - sharing purchase, membership and reward system

AMD64 (x86_64) architecture ABI document: upper

R language handwritten numeral recognition

RIoTBoard开发板系列笔记(九)—— buildroot 移植MatchBox

变量和数据类型(03)
随机推荐
Buddy: core function entry
Hackingtool of security tools
numpy.arange
Chapter007 FPGA learning IIC bus EEPROM reading
记账APP:小哈记账1——欢迎页的制作
C language from introduction to soil -- super detailed summary of operators
Oauth2==SSO三种协议。Oauth2四种模式
From the perspective of CIA, common network attacks (blasting, PE, traffic attacks)
MongoDB应用场景及选型(海量数据存储选型)
Bookkeeping app: xiaoha bookkeeping 2 - production of registration page
变量和数据类型(04)完结
JMeter notes 2 | JMeter principle and test plan elements
变量和数据类型(03)
UNI-APP_小程序或h5页面背景音乐的播放与暂停
我的创作纪念日
Learning strategies of 2D target detection overview (final chapter)
Opencascade notes: GP package
AMD64(x86_64)架构abi文档:上
Part II - C language improvement_ 1. Overview of C language
Take you step by step to learn C (one)