Pinsker’s inequality 与 Kullback-Leibler (KL) divergence / KL散度

2024-01-12 01:44

本文主要是介绍Pinsker’s inequality 与 Kullback-Leibler (KL) divergence / KL散度,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

文章目录

  • Pinsker’s inequality
  • Kullback-Leibler (KL) divergence
    • KL散度在matlab中的计算
  • KL散度在隐蔽通信概率推导中的应用

Pinsker’s inequality

Pinsker’s Inequality是信息论中的一个不等式,通常用于量化两个概率分布之间的差异。这个不等式是由苏联数学家Mark Pinsker于1964年提出的。

考虑两个概率分布 (P) 和 (Q) 在同一样本空间上的概率密度函数,Pinsker’s Inequality可以表示为:

[ D KL ( P ∥ Q ) ≥ 1 2 ( ∫ ( p ( x ) − q ( x ) ) 2 d x ) 2 D_{\text{KL}}(P \parallel Q) \geq \frac{1}{2} \left(\int \left(\sqrt{p(x)} - \sqrt{q(x)}\right)^2 \, dx\right)^2 DKL(PQ)21((p(x) q(x) )2dx)2 ]

其中:

  • ( D KL ( P ∥ Q ) D_{\text{KL}}(P \parallel Q) DKL(PQ)) 是P和Q之间的 K u l l b a c k − L e i b l e r Kullback-Leibler KullbackLeibler散度,表示两个概率分布之间的差异。
  • ( p ( x ) p(x) p(x)) 和 ( q ( x ) q(x) q(x)) 分别是P和Q在样本点 ( x x x) 处的概率密度函数。

Pinsker’s Inequality表明,KL散度的平方根下界是两个概率分布在L2范数(平方积分的平方根)上的差异。这个不等式在信息论和统计学中有广泛的应用,用于量化概率分布之间的距离。

Kullback-Leibler (KL) divergence

KL散度(Kullback-Leibler散度),也称为相对熵,是一种用于衡量两个概率分布之间差异的指标。给定两个概率分布 ( P P P) 和 ( Q Q Q),KL散度的定义如下:

[ D KL ( P ∥ Q ) = ∫ P ( x ) log ⁡ ( P ( x ) Q ( x ) ) d x D_{\text{KL}}(P \parallel Q) = \int P(x) \log\left(\frac{P(x)}{Q(x)}\right) \,dx DKL(PQ)=P(x)log(Q(x)P(x))dx ]

这个积分表示在样本空间上对 (P) 的每个事件的概率进行加权,权重是 ( P P P) 对应事件的概率,然后乘以 ( P P P) 和 ( Q Q Q) 概率比的自然对数。

KL散度有一些重要的性质:

  1. 非负性:( D KL ( P ∥ Q ) ≥ 0 D_{\text{KL}}(P \parallel Q) \geq 0 DKL(PQ)0),等号成立当且仅当 ( P P P) 和 ( Q Q Q) 在所有点上都相等。
  2. 不对称性:一般情况下,( D KL ( P ∥ Q ) ≠ D KL ( Q ∥ P ) D_{\text{KL}}(P \parallel Q) \neq D_{\text{KL}}(Q \parallel P) DKL(PQ)=DKL(QP))。它衡量了从 ( Q Q Q) 到 ( P P P) 的信息损失,和从 ( P P P) 到 ( Q Q Q) 的信息损失是不同的。
  3. 不满足三角不等式:( D KL ( P ∥ R ) ≰ D KL ( P ∥ Q ) + D KL ( Q ∥ R ) D_{\text{KL}}(P \parallel R) \nleq D_{\text{KL}}(P \parallel Q) + D_{\text{KL}}(Q \parallel R) DKL(PR)DKL(PQ)+DKL(QR))。这意味着KL散度不满足三角不等式,因此不能被解释为标准的距离度量。

KL散度的应用广泛,包括在信息论、统计学、机器学习等领域,例如在变分推断、最大似然估计和生成模型中。

KL散度在matlab中的计算

KL(Kullback-Leibler)散度是衡量两个概率分布之间差异的一种方法。在Matlab中,你可以使用kldiv函数来计算两个概率分布的KL散度。这个函数通常包含在Statistics and Machine Learning Toolbox中,因此你需要确保你的Matlab版本中包含了这个工具箱。

以下是一个简单的示例,演示如何使用kldiv函数计算两个离散概率分布之间的KL散度:

% 定义两个离散概率分布
P = [0.3, 0.4, 0.3]; % 第一个分布
Q = [0.5, 0.2, 0.3]; % 第二个分布% 计算KL散度
kl_divergence = kldiv(P, Q);% 显示结果
disp(['KL散度:', num2str(kl_divergence)]);

请确保你的Matlab环境中已经安装了Statistics and Machine Learning Toolbox,以便使用kldiv函数。如果没有安装,你可以通过MathWorks官方网站获取该工具箱或者使用其他方法计算KL散度,例如手动实现KL散度的计算公式。

KL散度在隐蔽通信概率推导中的应用

Robust Beamfocusing for FDA-Aided Near-Field
Covert Communications With Uncertain Location
2023 IEEE ICC

Let ( D w , θ w ) \left(D_{\mathrm{w}}, \theta_{\mathrm{w}}\right) (Dw,θw) denote the location of Willie. We assume Willie is synchronized with Alice with the full knowledge of the carrier frequencies, and the channel vector h H ( D w , θ w ) \mathbf{h}^{H}\left(D_{\mathrm{w}}, \theta_{\mathrm{w}}\right) hH(Dw,θw) . This is the worst case for legitimate nodes to analyze the lower bound of covert communications performance. The hypothesis test at Willie is given by

{ H 0 : y w ( n ) = z w ( n ) , H 1 : y w ( n ) = h w H w s ( n ) + z w ( n ) , \left\{\begin{array}{l} \mathcal{H}_{0}: y_{\mathrm{w}}^{(n)}=z_{\mathrm{w}}^{(n)}, \\ \mathcal{H}_{1}: y_{\mathrm{w}}^{(n)}=\mathbf{h}_{\mathrm{w}}^{H} \mathbf{w} s^{(n)}+z_{\mathrm{w}}^{(n)}, \end{array}\right. {H0:yw(n)=zw(n),H1:yw(n)=hwHws(n)+zw(n),

where h w H \mathbf{h}_{\mathrm{w}}^{H} hwH is short for h H ( D w , θ w ) \mathbf{h}^{H}\left(D_{\mathrm{w}}, \theta_{\mathrm{w}}\right) hH(Dw,θw) , and z w ( n ) ∼ C N ( 0 , σ w 2 ) z_{\mathrm{w}}^{(n)} \sim \mathcal{C N}\left(0, \sigma_{\mathrm{w}}^{2}\right) zw(n)CN(0,σw2) is the AWGN at Willie with noise power σ w 2 \sigma_{\mathrm{w}}^{2} σw2 . From (5), the probability distribution functions (PDFs) of y w = [ y w ( 1 ) , y w ( 2 ) , … , y w ( N ) ] T \mathbf{y}_{\mathrm{w}}= \left[y_{\mathrm{w}}^{(1)}, y_{\mathrm{w}}^{(2)}, \ldots, y_{\mathrm{w}}^{(N)}\right]^{T} yw=[yw(1),yw(2),,yw(N)]T under H 0 \mathcal{H}_{0} H0 and H 1 \mathcal{H}_{1} H1 can be derived as

P 0 ≜ P ( y w ∣ H 0 ) = 1 π N σ w 2 N e − y w H y w σ w 2 (6) \mathbb{P}_{0} \triangleq \mathbb{P}\left(\mathbf{y}_{\mathrm{w}} \mid \mathcal{H}_{0}\right)=\frac{1}{\pi^{N} \sigma_{\mathrm{w}}^{2 N}} e^{-\frac{\mathbf{y}_{\mathrm{w}}^{H} \mathbf{y}_{\mathrm{w}}}{\sigma_{\mathrm{w}}^{2}}} \tag{6} P0P(ywH0)=πNσw2N1eσw2ywHyw(6)

and:

P 1 ≜ P ( y w ∣ H 1 ) = 1 π N ( ∣ h w H w ∣ 2 + σ w 2 ) N e − y w H y w ∣ h w H ∣ 2 + σ w 2 (7) \mathbb{P}_{1} \triangleq \mathbb{P}\left(\mathbf{y}_{\mathrm{w}} \mid \mathcal{H}_{1}\right)=\frac{1}{\pi^{N}\left(\left|\mathbf{h}_{\mathrm{w}}^{H} \mathbf{w}\right|^{2}+\sigma_{\mathrm{w}}^{2}\right)^{N}} e^{-\frac{\mathbf{y}_{\mathrm{w}}^{H} \mathbf{y}_{\mathrm{w}}}{\left|\mathbf{h}_{\mathrm{w}}^{H}\right|^{2}+\sigma_{\mathrm{w}}^{2}}} \tag{7} P1P(ywH1)=πN(hwHw2+σw2)N1ehwH2+σw2ywHyw(7)

respectively. Let D 0 \mathcal{D}_{0} D0 and D 1 \mathcal{D}_{1} D1 denote the decisions in favor of H 0 \mathcal{H}_{0} H0 and H 1 \mathcal{H}_{1} H1 , respectively. The false alarm and missed detection probabilities are defined as P F A ≜ P ( D 1 ∣ H 0 ) \mathbb{P}_{F A} \triangleq \mathbb{P}\left(\mathcal{D}_{1} \mid \mathcal{H}_{0}\right) PFAP(D1H0) and P M D ≜ P ( D 0 ∣ H 1 ) \mathbb{P}_{M D} \triangleq \mathbb{P}\left(\mathcal{D}_{0} \mid \mathcal{H}_{1}\right) PMDP(D0H1) , respectively. The detection performance of Willie is characterized by the sum of the detection error probabilities ξ = P F A + P M D \xi=\mathbb{P}_{F A}+\mathbb{P}_{M D} ξ=PFA+PMD . Under the optimal detection, ξ \xi ξ is minimized, which is denoted by ξ ∗ \xi^{*} ξ . Then the covertness constraint of the system is expressed as ξ ∗ ≜ P F A + P M D ≥ 1 − ϵ \xi^{*} \triangleq \mathbb{P}_{F A}+\mathbb{P}_{M D} \geq 1-\epsilon ξPFA+PMD1ϵ , where
ϵ ∈ [ 0 , 1 ] \epsilon \in[0,1] ϵ[0,1] is an arbitrarily small positive constant indicating the level of covertness. Smaller \epsilon corresponds to stricter covertness requirement. Specially, when ϵ = 0 \epsilon=0 ϵ=0 , we have ξ ∗ = 1 \xi^{*}=1 ξ=1 , which renders Willie’s detection to a blind guess. Moreover, according to Pinsker’s inequality [14], [15], we have ξ ∗ ≥ 1 − D ( P 1 ∥ P 0 ) 2 \xi^{*} \geq 1-\sqrt{\frac{\mathcal{D}\left(\mathbb{P}_{1} \| \mathbb{P}_{0}\right)}{2}} ξ12D(P1P0) , where D ( P 1 ∥ P 0 ) = ∫ y P 1 log ⁡ P 1 P 0 d y \mathcal{D}\left(\mathbb{P}_{1} \| \mathbb{P}_{0}\right)=\int_{\mathbf{y}} \mathbb{P}_{1} \log \frac{\mathbb{P}_{1}}{\mathbb{P}_{0}} \mathrm{~d} \mathbf{y} D(P1P0)=yP1logP0P1 dy is the Kullback-Leibler (KL) divergence of P 1 \mathbb{P}_{1} P1 and P 0 \mathbb{P}_{0} P0 . It can be easily verified that the original covertness constraint is satisfied as long as D ( P 1 ∥ P 0 ) ≤ 2 ϵ 2 \mathcal{D}\left(\mathbb{P}_{1} \| \mathbb{P}_{0}\right) \leq 2 \epsilon^{2} D(P1P0)2ϵ2 . Furthermore, by substituting (6) and (7) into the expression of D ( P 1 ∥ P 0 ) \mathcal{D}\left(\mathbb{P}_{1} \| \mathbb{P}_{0}\right) D(P1P0) , we have D ( P 1 ∥ P 0 ) = N ζ ( ∣ h w H w ∣ 2 σ w 2 ) \mathcal{D}\left(\mathbb{P}_{1} \| \mathbb{P}_{0}\right)=N \zeta\left(\frac{\left|\mathbf{h}_{\mathrm{w}}^{H} \mathbf{w}\right|^{2}}{\sigma_{\mathrm{w}}^{2}}\right) D(P1P0)=(σw2hwHw2) , where ζ ( x ) = x − log ⁡ ( 1 + x ) \zeta(x)=x-\log (1+x) ζ(x)=xlog(1+x) for x ≥ 0 x \geq 0 x0 is a monotonically increasing function w.r.t. x x x . Then the original covertness constraint can be simplified by

∣ h w H w ∣ 2 σ w 2 ≤ ζ − 1 ( 2 ϵ 2 N ) (8) \frac{\left|\mathbf{h}_{\mathrm{w}}^{H} \mathbf{w}\right|^{2}}{\sigma_{\mathrm{w}}^{2}} \leq \zeta^{-1}\left(\frac{2 \epsilon^{2}}{N}\right) \tag{8} σw2 hwHw 2ζ1(N2ϵ2)(8)

where  ζ − 1 ( x ) is the inverse function of  ζ ( x ) .  \text { where } \zeta^{-1}(x) \text { is the inverse function of } \zeta(x) \text {. }  where ζ1(x) is the inverse function of ζ(x)

这篇关于Pinsker’s inequality 与 Kullback-Leibler (KL) divergence / KL散度的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/596400

相关文章

Fisher散度

Fisher散度(Fisher Divergence)是概率分布相似性或差异性的一种量度,它基于概率分布的对数似然函数的一阶导数(梯度)。Fisher散度是用来量化一个概率分布在参数空间的局部变化情况的,它是Fisher信息矩阵的一部分。 更具体地说,Fisher散度是指概率模型中,真实数据分布 p ( x ) p(x) p(x) 和模型分布 q θ ( x ) q_{\theta}(x) q

KL距离(衡量两个概率分布的差异情况)

KL距离,是Kullback-Leibler差异(Kullback-Leibler Divergence)的简称,也叫做相对熵(Relative Entropy)。它衡量的是相同事件空间里的两个概率分布的差异情况。 KL距离全称为Kullback-Leibler Divergence,也被称为相对熵。公式为: 感性的理解,KL距离可以解释为在相同的事件空间P(x)中两个概率P(x)和Q(x)分

KL散度(Kullback-Leibler divergence)

K L KL KL散度( K u l l b a c k − L e i b l e r d i v e r g e n c e Kullback-Leibler\ divergence Kullback−Leibler divergence),也被称为相对熵、互熵或鉴别信息,是用来衡量两个概率分布之间的差异性的度量方法。以下是对 K L KL KL散度的详细解释: 定义 K L KL

信息熵,交叉熵,相对熵,KL散度

熵,信息熵在机器学习和深度学习中是十分重要的。那么,信息熵到底是什么呢?   首先,信息熵是描述的一个事情的不确定性。比如:我说,太阳从东方升起。那么这个事件发生的概率几乎为1,那么这个事情的反应的信息量就会很小。如果我说,太阳从西方升起。那么这就反应的信息量就很大了,这有可能是因为地球的自转变成了自东向西,或者地球脱离轨道去到了别的地方,那么这就可能导致白天变成黑夜,热带雨林将

Codeforces Round 940 (Div. 2) and CodeCraft-23 D. A BIT of an Inequality

A BIT of an Inequality 题目描述 给你一个数组 a 1 , a 2 , … , a n a_1, a_2, \ldots, a_n a1​,a2​,…,an​ 。求这样的图元( x , y , z x, y, z x,y,z )的个数: 1 ≤ x ≤ y ≤ z ≤ n 1 \leq x \leq y \leq z \leq n 1≤x≤y≤z≤n , 和 f

从概率角度出发,对交叉熵和 KL 散度进行分析和推导

🍉 CSDN 叶庭云:https://yetingyun.blog.csdn.net/ 1. 定义与推导 交叉熵(Cross Entropy) 交叉熵是一个衡量两个概率分布之间差异的指标。在机器学习中,这通常用于衡量真实标签的分布与模型预测分布之间的差异。对于两个概率分布 P P P 和 Q Q Q,其中 P P P 是真实分布, Q Q Q 是模型预测分布,交叉熵的定义为:

python ERA5 画水汽通量散度图地图:风速风向矢量图、叠加等高线、色彩分级、添加shp文件、添加位置点及备注

动机 有个同事吧,写论文,让我帮忙出个图,就写了个代码,然后我的博客好久没更新了,就顺便贴上来了! 很多人感兴趣风速的箭头怎样画,可能这种图使用 NCL 非常容易,很多没用过代码的小朋友,就有点犯怵,怕 python 画起来很困难。但是不然,看完我的代码,就会发现很简单,并且也可以批量,同时还能自定义国界等shp文件,这对于发sci等国际论文很重要,因为有时候内置的国界是有问题的。 数据 本

[机器学习] Pytorch19种损失函数理解[上]— L1、MSE、CrossEntropy、KL、BCE、BCEWithLogits loss function

损失函数通过torch.nn包实现。 文章目录 1 基本用法2 损失函数(前6种)2-1 L1范数损失 —— L1_Loss2-2 均方误差损失 —— MSELoss2-3 交叉熵损失 CrossEntropyLoss2-4 KL 散度损失 KLDivLoss2-5 二元交叉熵损失 BCELoss2-6 BCEWithLogitsLoss 1 基本用法 criterion =

【域适应】基于散度成分分析(SCA)的四分类任务典型方法实现

关于 SCA(scatter component analysis)是基于一种简单的几何测量,即分散,它在再现内核希尔伯特空间上进行操作。 SCA找到一种在最大化类的可分离性、最小化域之间的不匹配和最大化数据的可分离性之间进行权衡的表示;每一个都通过分散进行量化。  参考论文:Shibboleth Authentication Request 工具 MATLAB 方法实现 SCA变换实

<Senior High School Math>: inequality question

( 1 ) . o m i t (1). omit (1).omit ( 2 ) . ( a 2 − b 2 ) ( x 2 a 2 − y 2 b 2 ) = ( x 2 + y 2 ) − ( a 2 y 2 b 2 + b 2 x 2 a 2 ) ≤ x 2 + y 2 − 2 x y = ( x − y ) 2 (2). (a^2-b^2)(\frac{x^2}{a^2} - \f