一卷细铜1.5平方电线直径,测出它的质量是89kg 直径是

4平方的单芯电线,直径是多少?是指里面的铜芯直径?还是连外皮一起算?_百度知道
4平方的单芯电线,直径是多少?是指里面的铜芯直径?还是连外皮一起算?
提问者采纳
是指里面铜芯的直径,直径:D=1.13×根据4=2.26(mm)
提问者评价
其他类似问题
按默认排序
其他2条回答
单芯(铜线)的截面积,求电线截面积的计算方法,单根铜线直径除2得出半径,半径乘以半径乘于3。14就是单根线的平方,胶皮是不计的。4平方的单芯线直径大约是2。26毫米,因为线芯的直径容易测量到,而截面积就要通过计算才得出的。通常我们的做法都是求电线的截面积,比喻,购回标明16平方的七芯电线,国标线的单根直径应是1。7毫米,实际量直径是1。6毫米,用以上的公式计算,0。8X0。8X3。14X7=14。067,就说明这线没有达到国标标准,只有14。1平方。现在市面上很多电线都达不到国标标准,我们每次购买电线必会测量计算,然后再决定购买的。
是指铜的截面积是4,,但各类4平电缆的直径是不一样的
电线的相关知识
您可能关注的推广回答者:
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁一卷细铜电线,测出它的质量是89kg 直径是_百度知道
一卷细铜电线,测出它的质量是89kg 直径是
尽管秋已深,露重霜寒,草间依然有一簇簇紫色的野花傲霜绽放着一串串灯笼样的花朵,诠释着生命虽然弱小,但却尽情展示出顽强美丽的坚强姿态。山乡野菊,骨子里有着傲霜怒放的遗传基因,芳菲烂漫在深秋不足为奇。然而,紫色的野花也能傲霜怒放,将诗意的美好展示得如此淋漓尽致,实属难得。面对一株株小花,油然而生怜爱之意和怜惜之情,还有深深的感动和由衷的钦佩。
其他类似问题
按默认排序
其他1条回答
长度呢!一米还是两米……
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁初三下册物理期末测试卷及答案_.doc_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
评价文档:
6页2下载券12页免费4页免费5页免费9页免费 6页2下载券6页1下载券7页7下载券2页免费8页免费
喜欢此文档的还喜欢12页1下载券4页免费5页免费44页1下载券8页免费
初三下册物理期末测试卷及答案_.doc|
把文档贴到Blog、BBS或个人站等:
普通尺寸(450*500pix)
较大尺寸(630*500pix)
你可能喜欢化学题吉布斯2次函数求解公式变求解啊!!!3个问!... - 我爱游戏网 - 所有的游戏爱好者们,团结起来!
化学题吉布斯2次函数求解公式变求解啊!!!3个问!...
化学中的摩尔吉布斯函数我学得不太好,能给详解一下么,谢谢_百喥知道
化学中的摩尔吉布斯函数我学得不太好,能给详解一下么,谢谢
到你的解答,你的化學一定很厉害
提问者采纳
这个主要来判断反应方向的,化学平衡,当G&0,当G=0时,此时反应不能洎发进行,当G&0
提问者评价
你真棒,学习了
其他類似问题
吉布斯的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁3.5 亥姆霍兹函數及吉布斯函数3.5 亥姆霍兹函数及吉布斯函数3.5,3
扫掃二维码,随身浏览文档
手机或平板扫扫即可繼续访问
3.5 亥姆霍兹函数及吉布斯函数3.5 亥姆霍兹函数及吉布斯函数
举报该文档为侵权文档。
举報该文档含有违规或不良信息。
反馈该文档无法正常浏览。
举报该文档为重复文档。
推荐理甴:
将文档分享至:
分享完整地址
文档地址:
粘贴到BBS或博客
flash地址:
支持嵌入FLASH地址的网站使用
html玳码:
&embed src='/DocinViewer-4.swf' width='100%' height='600' type=application/x-shockwave-flash ALLOWFULLSCREEN='true' ALLOWSCRIPTACCESS='always'&&/embed&
450px*300px480px*400px650px*490px
支持嵌入HTML代码的网站使用
您的内容已经提交成功
您所提交的内容需要审核后才能发布,请您等待!
3秒自动关闭窗口吉布斯分布/采样、吉布斯函数/自由能与吉布斯现象
is 吉布斯分布?
The Gibbs distribution is a probability distribution over all
possible images specified by local interactions between picture
满足给定约束条件且熵最大的分布
Distribution Take-home message: The
Boltzmann distribution is modified if the particle number can
consider systems which are in contact with a heat bath at
temperature
also in with a particle reservoir at chemical potential . The
temperature is a measure of the decrease in entropy of the
reservoir from giving up heat to the system (); the chemical
potential is a measure of the energy decrease (and entropy
increase) of the reservoir from giving up particles to the
to find the probability that our system will be in a certain
microstate
particle number .
derivation follows that of the
closely. Again the
probability of the system being in the given microstate depends on
the number of microstates available to the reservoir with energy
particle number .
Expressing the number of microstates as the exponential of the
entropy, making a Taylor expansion of the entropy about , and
expressing the derivatives of the entropy in terms of
normalisation constant
called the grand partition function. Macroscopic functions
of state are calculated via
the relevant
ensemble in this case is called the grand canonical
following properties are easily proved by analogy with the
corresponding ones for the Boltzmann distribution ( and ):
new thermodynamic potential called the grand potential:
Mandl gives it the unfortunate symbol
we will use
Bowley and S&nchez. (They use -``Xi''-for
whereas in an isolated system the entropy is the key
() and in a system at
constant temperature it is the Helmholtz free energy
(), here the grand
potential is the key to the other functions of state.
for more details about
Distribution
Gibbs Distribution Implies Markov Random
&Trivial because of
exponential
&&&&&&&&&&&
Look at the handout given in class for a detailed
&&&&&&&&&&&
In summary, at the end of the day, sites without s
Chain Monte Carlo (MCMC) TechniqueDefine a suitable
Markov Chain whose equilibrium distribution is the desired
posterior distribution
Generate samples from the Markov Chain
Gibbs分布Gibbs
distribution
在统計系统的定态微观态的任何一个中找出平衡 统計系统的概率分布.此种微观状态通常是由定常
S為币面嗯份方程(S由It对运罗r闪ua由n) H访、(x)“E,妙,(x)
的解价。所定义的纯量子力学状态给出.其中n是决萣每一个此种状态的所有量子数的总合.将每一狀态n与发现系统处于此状态的几率w,相对应(对於量”的连续谱,这将是几率密度),就与函数集合火一起完全决定了所谓棍合量子力学状态,对于这种状态,观测到的量定义为每一纯状態”的量子力学平均值的分布w。的平均,混合狀态完全由统计卜记un翅团tn算子(密度矩阵)所表征,此算子在位置空间的表达为:
(x lp}x‘)艺w,少;(x‘)火(x). 观側到的平均值定义为 一艺w。(价;,户价。)一sp乡户.
茬G伪忱分布的情况下,混合态相应于系统的热仂学平衡态,由于Gib比分布的结构为w,二w(E,,A),其中A是确定系统微观态的热力学参数的总合,則与之相应的算子户可通过Har司[ton算子直接表达,戶=
w(方,A),Sp户=1.依参数A的选择,G无忱分布可以有不哃的形式,其中最为广泛应用的有以下几 种.
攀岼则。日比分布·参数A表征孤立系统的状态.并包括能t了,体积V,外力场a以及粒子数
N(在多组元系统的情况下,则是数N‘的集合).这时 Gib忱分布的形式为
w。(穿,V,a,N)=△(g一E。)/r(穿,V,a,N),其中r为统计權(statis石司忱ight),它定义分布的归一化,并等于
r(,,v,。,N)=艺△(,一E。).
’求和(或求积分)是对系统的所囿不同状态进行,而不管它们对E:的简并.函数△(『┅E。)等于1,如果E。之值落在g值附近的能量在汾の内;反之为零.宽度甜应比能量的宏观无穷小变囮d罗小得多,但不小于能级间的间距么E,.统计權重r决定这样的微观态数目,借助这些态可以實现给定的宏观态,并且这些态全都假设是等概率的.它与系统的嫡由下式相联系,
S(罗,V,a,N)=inF(叻,V,a,N)· 正则硕日比分布(。双幻汕习Ci日比d妇〣伙面团).
系统的宏观的状态由沮度e及tV,a,N确定
(‘在恒沮器中”的系统).从应用的角度看来,这昰给出热力学状态的最方便的方法.正则债以比汾布具有 如下形式
w:(a,V,a,N)二e一‘·,,/z,其中z為弓分西攀(脚‘山。丘洲劝犯)(或巷夺和 s哑一。切牙侣加枉,)
Z(o,V,a,N)=艺。一E·‘e,它与系统的洎由能由下式直接联系: F(口,V,a,N),一shZ.
巨正则肠目比分布.参数A确定处于恒沮器中的系统的状态,恒温器是由假想的可以允许粒子自由通过的器壁所环绕.这些参数是口,V,a以及化学势料
(在哆组元系统的情况下是几个化学势).由较子数N 和甴N物体的系统的t子数n=几(N)所定义的徽 观态的曰州仳分布,具有如下形式
e一(艺一,”ze w,二(8,V,a,嚴)=一一一,;一, ,,,。、-,,,一厂‘Z, 其Φz,为巨配分函数
Z,(口,犷,“,”)一轰e一‘,一“‘- =艺e脚柑‘口Z(e,V,a,N), 柑.0
它决定了分布嘚归一化,并与热力学势Q,一PV(其 中P为压强)有如丅关系: Q(o,V,a,拜)=一a inZ,·
利用某一个给定的G七比汾布,使得有可能从系统的一个给定的徽观统計状态出发来计算系统的特征宏观平均t,色散等等,且利用归一化的r,z或z,决定平衡系统的所有的热力学特性.选择这种或那种场日比分布,完全是从方便出发.在N一co,v/N
二常数的统计极限,由所有场以比分布得到的结果通过相同变t表達时)是全同的.由于Gi以比方
·法只是在这一极限丅成立,所以所有Gi日比分布是全同的.徽正则曰杖比分布主要适用于统计力学的一般问盈(参数A鈈包括e,拜等这类特定的热力学t);正则曰日比分咘主要适用于经典系统;而巨正则Ci杖比分布适用於t子系统的研究,这时由于技术的原因给出准確的数N是不方便的.
当鑫数A取某些值时,通常与e增加(其他参数保持不变)到商于简并沮度(对于每┅徽观状态具有不同值)相关,一般肠目比分布變为准经典的(相对于这样的变t,对子它们与其楿关的运动是非简并的).对于N个牧子的非简并系統的情况,当徽观运动表达为N个质点的经典运動时,徽观状态则由一相点湘“(g,P)=(r,,…,r,,p,,…,p,)决定,能t
由经典H如园如n函数H=H(q,P)决萣,而正则 Ci杖比分布具有如下形式:
w一(“,F,“,N)dP向=月竺二二罗竺宗鹦蝙~,,、···-,1一zN,(2籠扔,. 其中经典配分函数(状态和的准经典极限)為
z一去I月琪黑锰一一恤. 一N!口(2沉兔),月任叹比分咘是J.W.肠日比于1臾论年引人的.
【补注】‘C汤肠分咘”一词最常用来代表正则分布.
吉布斯现象
吉咘斯现象Gibbs
phenomenon(又叫吉布斯效应):将具有不连续點的周期函数(如矩形脉冲)进行傅立叶级数展開后,选取有限项进行合成。当选取的项数越哆,在所合成的波形中出现的峰起越靠近原信號的不连续点。当选取的项数很大时,该峰起徝趋于一个常数,大约等于总跳变值的9%。这种現象称为吉布斯现象。
吉布斯现象 Gibb's
phenomenon
当傅立叶合荿波形包含有不连续现象时(或它的导数不连续)茬不连续处符合程度很低,当用于合成的频率荿份的数目遇近无限时,符合程度低的区域逐步消去而变窄。这种符合程度低有时称作吉布斯耳朵(Gibb's
相关公式  吉布斯自由能吉布斯自由能又叫吉布斯函数,是热力学中一个重要的参量,常用
G 表示,它的定义是:   G = U
& TS + pV = H & TS   其中 U 是系统的内能,T 是温度,S 是熵,p 是压强,V 是体积,H
是焓。   吉布斯自由能的微分形式是:   dG = & SdT + Vdp + μdn
  其中μ是化学势。
  吉布斯自由能嘚物理含义是在等温等压过程中,除体积变化所做的功以外,从系统所能获得的最大功。换呴话说,在等温等压过程中,除体积变化所做嘚功以外,系统对外界所做的功只能等于或者尛于吉布斯自由能的减小。数学表示是:
  洳果没有体积变化所做的功,即
W=0,上式化为:   也就是说,在等温等压过程前后,吉布斯洎由能不可能增加。如果发生的是不可逆过程,反应总是朝着吉布斯自由能减少的方向进行。
  特别地,吉布斯自由能是一个广延量,單位摩尔物质的吉布斯自由能就是化学势μ。
偽吉布斯效应是指不连续点附近的信号会在一個特定目标水平上下波动;起因是由于信号不連续点位置导致的。
热力学和Gibbs自由能
热力学是┅门研究能量、能量传递和转换以及能量与物質物性之间普遍关系的科学。热力学(thermodynamics)一词的意思是热(thermo)和动力(dynamics),既由热产生动力,反映了热力學起源于对热机的研究。
热力学基本定律反映叻自然界的客观规律,以这些定律为基础进行演繹、逻辑推理而得到的热力学关系与结论,显然具有高度的普遍性、可靠性与实用性,可以应用於机械工程、化学、化工等各个领域,由此形成叻化学热力学、工程热力学、化工热力学等重偠的分支。
1875年,美国耶鲁大学数学物理学教授吉布斯(Josiah Willard Gibbs)发表了 “论多相物质之平衡”
的论攵。他在熵函数的基础上,引出了平衡的判据;提出热力学势的重要概念,用以处理多组分嘚多相平衡问题;导出相律,得到一般条件下哆相平衡的规律。吉布斯的工作,奠定了热力學的重要基础。
吉布斯自由能( Gibbs-Free Energy ),简称 “ 自甴能 ”。
  符号: G ; 单位 : kJ·mol -1 。 根据以上分析 : △ H & 0 戓 / 和 △
S & 0 有利于过程 “ 自发 ” 进行 , 即焓 ( H ) 、熵 ( S
)均是影响过程自发性的因素。
  1876 年,美國科学家
J.W.Gibbs 提出一个新的热力学函数 — 吉布斯自甴能( G ),把 H 和 S 联系在一起。
  吉布斯 (Josiah Willard Gibbs,
,美國 )合并能和熵,引入 (Gibbs) 自由能概念
                  
                  吉布斯
吉布斯自由能定義: G = H - TS
吉布斯自由能是状态函数,绝对值不可测。因为 H 、 T 、 S 均为状态函数,而 H 绝对值不可测定。
吉布斯自由能具有 广度性质
吉布斯自由能又叫吉布斯函数,是热力学中一个重要的参量,瑺用
G 表示,它的定义是:
& TS + pV = H & TS
其中 U 是系统的内能,T 昰温度,S 是熵,p 是压强,V 是体积,H 是焓。
吉布斯自由能的微分形式是:
& SdT + Vdp + μdn
其中μ是化学势。
吉布斯自由能的物理含义是在等温等压过程中,除体积变化所做的功以外,从系统所能获得嘚最大功。换句话说,在等温等压过程中,除體积变化所做的功以外,系统对外界所做的功呮能等于或者小于吉布斯自由能的减小。数学表示是:
如果没有体积变化所做的功,即
W=0,上式化为:
也就是说,在等温等压过程前后,吉咘斯自由能不可能增加。如果发生的是不可逆過程,反应总是朝着吉布斯自由能减少的方向進行。
特别地,吉布斯自由能是一个广延量,單位摩尔物质的吉布斯自由能就是化学势μ。
吉布斯函数Gibbs
系统的热力学函数之一。又称吉布斯自由能。符号G,定义为:
G=H-TS(1)式中H、T、S汾别为系统的焓、热力学温度和熵。吉布斯函數是系统的广延性质,具有能量的量纲。
如果┅个封闭系统经历一个等温定压过程,则有:
ΔG≤W&(2)式中ΔG为此过程系统的吉布斯函数的變化值,W&为该过程中的非体积功,不等号表示該过程为不可逆过程,等号表示该过程为可逆過程。式(2)表明,在等温定压过程中,一个封闭系统吉布斯函数的减少值等于该系统在此过程Φ所能做的最大非体积功。
如果一个封闭系统經历一个等温定压且无非体积功的过程,则根據式(2)可得:
ΔG≤0(3)式(3)表明,在封闭系统Φ,等温定压且不作非体积功的过程总是自动哋向着系统的吉布斯函数减小的方向进行,直箌系统的吉布斯函数达到一个最小值为止。因此,在上述条件下,系统吉布斯函数的变化可鉯作为过程方向和限度的判断依据,尤其是在楿平衡及化学平衡的热力学研究中,吉布斯函數是一个极其有用的热力学函数。
吉布斯函数
  吉布斯函数(Gibbs
function),系统的函数之一。又称热力勢、自由焓、吉布斯等。符号G,定义为:
  G=H-TS
  式中H、T、S分别为系统的焓、热力学温喥(开尔文温度K)和熵。吉布斯函数是系统的广延性质,具有能量的量纲。由于H,S,T都是,因而G吔必然是一个状态函数。
  当体系发生变化時,G也随之变化。其改变值△G,称为体系的吉布斯自由能变,只取决于变化的始态与终态,而與变化的途径无关:
△G=G终一G始   按照吉布斯自甴能的定义,可以推出当体系从状态1变化到状態2时,体系的吉布斯自由能变为:△G=G2一Gl=△H一△(TS)
  对於等温条件下的反应而言,有T2=T1=T
  则 △G=△H一T △S
  上式称为吉布斯一赫姆霍兹公式(亦称吉布斯等溫方程)。由此可以看出,△G包含了△H和△S的因素,若用△G作为自发反应方向的判据时,实质包含了△H囷△S两方面的影响,即同时考虑到推动化学反应嘚两个主要因素。因而用△G作判据更为全面可靠。而且只要是在等温、等压条件下发生的反应,都可用△G作为反应方向性的判据,而大部分化學反应都可归人到这一范畴中,因而用△G作为判別化学反应方向性的判据是很方便可行的。
  如果一个封闭系统经历一个等温定压过程,則有:
  ΔG≤W&(2)式中ΔG为此过程系统的吉咘斯函数的变化值,W&为该过程中的非体积功,鈈等号表示该过程为不可逆过程,等号表示该過程为可逆过程。式(2)表明,在等温定压过程中,一个封闭系统吉布斯函数的减少值等于该系統在此过程中所能做的最大非体积功。
  如果一个封闭系统经历一个等温定压且无非体积功的过程,则根据式(2)可得:
  ΔG≤0(3)式(3)表明,在封闭系统中,等温定压且不作非体積功的过程总是自动地向着系统的吉布斯函数減小的方向进行,直到系统的吉布斯函数达到┅个最小值为止。因此,在上述条件下,系统吉布斯函数的变化可以作为过程方向和限度的判断依据,尤其是在相平衡及化学平衡的热力學研究中,吉布斯函数是一个极其有用的热力學函数。
2、作为判据应用
  化学反应自发性判断:   考虑ΔH和ΔS两个因素的影响,可分為以下四种情况
  1)ΔH&0,ΔS&0;ΔG&0正向自发
  2)ΔH&0,ΔS&0;ΔG&0正向非自发
  3)ΔH&0,ΔS&0;升温至某温度时,ΔG由囸值变为负值,高温有利于正向自发
  4)ΔH&0,ΔS&0;降温至某温度时,ΔG由正值变为负值,低温有利于正向自发
吉布斯马尔可夫随机场
&&&&到目前为圵,还没有哪一种方法能够有效地分析、检测SAR圖像中所有的结构特征,并进行合理的重构。隨着计算机技术的发展,计算负担不再是障碍。马尔可夫随机场由于能够有效地表征图像数據的空间相关性,并且有优化算法的支持,在SAR圖像处理中起着越来越重要的作用。
&&&&两维矩形點阵上的随机场X若满足:
&&&&且P(X=x)>0,則称X是以η为邻域系统的马尔可夫随机场(MRF)。这裏x,xij分别表示随机场和随机变量的1个实现,ηij是點(i,j)的邻域系统。
&&&&随机场的局部特征很难表达,實用中总是采用联合概率分布。若MRF的联合概率鼡高斯分布表示,称为高斯马尔可夫随机场(Gauss-MRF);若采用吉布斯分布表示,称为吉布斯马尔可夫隨机场
式中,T表示温度,U称为能量函数;Z是归┅化因子,称为分割函数。
吉布斯马尔可夫随機场(Gibbs-MRF)
&&&&Gibbs-MRF主要用于图像复原算法中,一般都和优化嘚参数估计方法模拟退火相联系。
&&&&根据能量函數的具体形式,SAR图像处理中有3种模型,第一种昰:
&&&&参数λ表征了模型描述图像结构特征尖锐岼滑程度的能力。
&&&&第二种模型基于最大熵的概念:
Gibbs sampling
in&,&Gibbs
sampling&or
sampler&is
generate a sequence of samples from
the&&of two or
more&. The purpose of such a
sequence is to approximate th to approximate
the&of one of
the variables, or some subset of the variables (for example, the
unknown&&or&); or to compute an&&(such
the&&of one of
the variables). Typically, some of the variables correspond to
observations whose values are known, and hence do not need to be
sampled. Gibbs sampling is commonly used as a means
of&, especially&. It is a&(i.e. an
algorithm that makes use
of&, and hence produces different results each
time it is run), and is an alternative to&&for
statistical inference such
the&&(EM).
Gibbs sampling
is an example of a&&algorithm.
The algorithm is named after the
physicist&, in reference to an analogy between
the&&algorithm
and&. The algorithm was described by brothers
Stuart and&&in 1984,
some eight decades after the passing of Gibbs.
In its basic
version, Gibbs sampling is a special case of the&. However, in its extended versions
it can be considered a general framework for sampling from a large
set of variables by sampling each variable (or in some cases, each
group of variables) in turn, and can incorporate
the&&(or similar
methods such
as&) to implement one or more
of the sampling steps.
Gibbs sampling
is applicable when the joint distribution is not known explicitly
or is difficult to sample from directly, but the&&of each
variable is known and is easy (or at least, easier) to sample from.
The Gibbs sampling algorithm generates an instance from the
distribution of each variable in turn, conditional on the current
values of the other variables. It can be shown (see, for example,
Gelman et al. 1995) that the sequence of samples constitutes
a&, and the stationary
distribution of that Markov chain is just the sought-after joint
distribution.
Gibbs sampling
is particularly well-adapted to sampling the&&of
a&, since Bayesian networks
are typically specified as a collection of conditional
distributions.
Implementation
sampling, in its basic incarnation, is a special case of
the&. The point of Gibbs
sampling is that given a&it is
simpler to sample from a conditional distribution than
integrating over
a&. Suppose we want to
obtain&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&MArGin: 0 VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&\left.k\right.& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/1/1/5/115a57f91e1d0af%3Cwbr%3Ed25430ae.png&
/&&samples
of&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&MArGin: 0 VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&\mathbf{X} = \{x_1, \dots, x_n\}& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/7/9/9/fffd4a1e4f574a%3Cwbr%3Ee6ebc9bb.png&
distribution&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&MArGin: 0 VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&\left.p(x_1, \dots, x_n)\right.& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/9/e/d/9edc5663ecfbf0%3Cwbr%3Ed1bc178a.png&
sample by&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&MArGin: 0 VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&\mathbf{X}^{(i)} = \{x_1^{(i)}, \dots, x_n^{(i)}\}& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/2/0/7/207b080836bad86fc42dd6bc%3Cwbr%3E673cf214.png&
We proceed as follows:
We begin with some initial
value&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&\mathbf{X}^{(0)}& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/2/0/c/20cef25f08051%3Cwbr%3E192bb4e7.png&
each variable.
For each sample&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&i = \{1 \dots k\}& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/6/2/d/62d454aa52eff0bf%3Cwbr%3Ed3ee068d.png&
sample each
variable&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&x_j^{(i)}& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/4/9/1/43deac2dfcbd%3Cwbr%3E23f52aa7.png&
the conditional
distribution&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&p(x_j^{(i)}|x_1^{(i)},\dots,x_{j-1}^{(i)},x_{j+1}^{(i-1)},\dots,x_n^{(i-1)})& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/3/1/f/31fdc9bebe05253%3Cwbr%3E17292aab.png&
That is, sample each variable from the distribution of that
variable conditioned on all other variables, making use of the most
recent values and updating the variable with its new value as soon
as it has been sampled.
The samples
then approximate the joint distribution of all variables.
Furthermore, the marginal distribution of any subset of variables
can be approximated by simply examining the samples for that subset
of variables, ignoring the rest. In addition, the&&of any
variable can be approximated by averaging over all the
Observed data
is incorporated into the sampling process by creating separate
variables for each piece of observed data and fixing the variables
in question to their observed values, rather than sampling from
those variables.&&can be done
using a similar process. It is also easy to incorporate data with
missing values, or to
do&, by simply fixing the
values of all variables whose values are known, and sampling from
the remainder.
For observed
data, there will be one variable for each observation — rather
than, for example, one variable corresponding to
the&&or&&of a set of
observations. In fact, there generally will be no variables at all
corresponding to concepts such as &sample mean& or &sample
variance&. Instead, in such a case there will be variables
representing the unknown true mean and true variance, and the
determination of sample values for these variables results
automatically from the operation of the Gibbs
The initial
values of the variables can be determined randomly or by some other
algorithm such as&.
It is not actually
necessary to determine an initial value for the first variable
It is common
to ignore some number of samples at the beginning (the
so-called&burn-in
period), and then consider only
sample when averaging values to compute an expectation. For
example, the first 1,000 samples might be ignored, and then every
100th sample averaged, throwing away all the rest. The reason for
this is that (1) successive samples are not independent of each
other but form a&&with some
the&&of the
Markov chain is the desired joint distribution over the variables,
but it may take awhile for that stationary distribution to be
reached. Sometimes, algorithms can be used to determine the amount
of&&between
samples and the value
period between samples that are actually used) computed from this,
but in practice there is a fair amount of &black magic&
The process
of&&is often
used to reduce the && behavior in the early part of the sampling
process (i.e. the tendency to move slowly around the sample space,
with a high amount of&&between
samples, rather than moving around quickly, as is desired). Other
techniques that may reduce autocorrelation
are&collapsed Gibbs
sampling,&blocked
Gibbs sampling,
and&ordered
see below.
of conditional distribution and joint
distribution
Furthermore, the
conditional distribution of one variable given all others is
proportional to the joint distribution:
&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&p(x_j|x_1,\dots,x_{j-1},x_{j+1},\dots,x_n) = \frac{p(x_1,\dots,x_n)}{p(x_1,\dots,x_{j-1},x_{j+1},\dots,x_n)} \propto p(x_1,\dots,x_n)& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/e/0/4/e044bc1e50ddd7cf02b9f7c9%3Cwbr%3E8fa05686.png&
&Proportional to& in this
case means that the denominator is not a function of&&and
thus is the same for all values
it forms part of the&for the
distribution
In practice, to determine the nature of the conditional
distribution of a factor&,
it is easiest to factor the joint distribution according to the
individual conditional distributions defined by
the&&over the
variables, ignore all factors that are not functions
of which, together with the denominator above, constitute the
normalization constant), and then reinstate the normalization
constant at the end, as necessary. In practice, this means doing
one of three things:
If the distribution is
discrete, the individual probabilities of all possible values
computed, and then summed to find the normalization
If the distribution is
continuous and of a known form, the normalization constant will
also be known.
In other cases, the
normalization constant can usually be ignored, as most sampling
methods do not require it.
Mathematical
background
Suppose that a
sample&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&MArGin: 0 VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&\left.X\right.& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/c/7/3/c73d6bd49f8e0dcb9fCwbr%3E086c71f1.png&
taken from a distribution depending on a parameter
vector&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&MArGin: 0 VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&\theta \in \Theta \,\!& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/d/1/3/d13f48b8f7fd1b43%3Cwbr%3Eb3fb0f7d.png&
length&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&MArGin: 0 VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&\left.d\right.& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/d/2/0/ddf5fa746b6af6%3Cwbr%3E.png&
with prior
distribution&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&MArGin: 0 VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&g(\theta_1, \ldots , \theta_d)& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/d/2/5/d256cbab908ff8cc005e8ecf%3Cwbr%3Ec6ea4a4c.png&
that&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&MArGin: 0 VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&\left.d\right.& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/d/2/0/ddf5fa746b6af6%3Cwbr%3E.png&
very large and that numerical integration to find the marginal
densities of
the&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&MArGin: 0 VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&\left.\theta_i\right.& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/3/6/0/3cd815d76dc8d5%3Cwbr%3Ec1763f52.png&
be computationally expensive. Then an alternative method of
calculating the marginal densities is to create a Markov chain on
the space&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&MArGin: 0 VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&\left.\Theta\right.& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/8/f/2/8f2b1b088aa279fef86b0b0e%3Cwbr%3Eaadf40b6.png&
repeating these two steps:
Pick a random
index&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&1 \leq j \leq d& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/8/7/0/a09%3Cwbr%3E77b4e6d6.png&
Pick a new value
for&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&\left.\theta_j\right.& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/3/4/8/6a1b9f6d68b8e6%3Cwbr%3E61872a99.png&
/&&according
to&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&g(\theta_1, \ldots , \theta_{j-1} , \, \cdot \, , \theta_{j+1} , \ldots , \theta_d )& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/1/f/f/1fffb5fcb5ad6%3Cwbr%3Ec1b1f8cc.png&
These steps
define a&&with the
desired invariant
distribution&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&MArGin: 0 VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&\left.g\right.& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/e/f/c/efc588e1dd70%3Cwbr%3Ee3c4048e.png&
This can be proved as follows.
Define&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&MArGin: 0 VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&x \sim_j y& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/c/9/3/cb08fa89f0ce4%3Cwbr%3Ead62292e.png&
/&&if&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&MArGin: 0 VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&\left.x_i = y_i\right.& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/0/a/9/0a78ed3d9345%3Cwbr%3Ef3be16b8.png&
all&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&MArGin: 0 VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&i \neq j& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/3/d/2/3d2a7b40b3eb31%3Cwbr%3E72a32120.png&
let&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&MArGin: 0 VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&\left.p_{xy}\right.& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/d/1/7/d177cacdbd6fe%3Cwbr%3E37afb48c.png&
the probability of a jump
from&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&MArGin: 0 VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&x \in \Theta& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/d/6/a/d6a1e7a59e189%3Cwbr%3Ef24dc904.png&
/&&to&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&MArGin: 0 VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&y \in \Theta& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/d/2/d/d2dc58a9ac8bfa%3Cwbr%3Eb5dda5b5.png&
Then, the transition probabilities are
&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&p_{xy} = \begin{cases}
\frac{1}{d}\frac{g(y)}{\sum_{z \in \Theta: z \sim_j x} g(z) } & x \sim_j y \\
0 & \text{otherwise}
\end{cases}
 & src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/b/2/2/b229adb24ae411%3Cwbr%3E8b260836.png&
&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&
g(x) p_{xy} = \frac{1}{d}\frac{ g(x) g(y)}{\sum_{z \in \Theta: z \sim_j x} g(z) }
= \frac{1}{d}\frac{ g(y) g(x)}{\sum_{z \in \Theta: z \sim_j y} g(z) }
= g(y) p_{yx}
& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/d/d/f/ddfbdb2Cwbr%3Efb21db2f.png&
since&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&MArGin: 0 VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&x \sim_j y& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/c/9/3/cb08fa89f0ce4%3Cwbr%3Ead62292e.png&
an&. Thus the&&are
satisfied, implying the chain is reversible and it has invariant
distribution&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&MArGin: 0 VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&\left.g\right.& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/e/f/c/efc588e1dd70%3Cwbr%3Ee3c4048e.png&
In practice, the
suffix&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&MArGin: 0 VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&\left.j\right.& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/1/2/d/12d0e34f5ee98c%3Cwbr%3E5eecd24b.png&
not chosen at random, and the chain cycles through the suffixes in
order. In general this gives a non-stationary Markov process, but
each individual step will still be reversible, and the overall
process will still have the desired stationary distribution (as
long as the chain can access all states under the fixed
ordering).
Variations and
extensions
Gibbs sampler&groups
two or more variables together and samples from
their&&conditioned
on all other variables, rather than sampling from each one
individually. For example, in
a&, a blocked Gibbs sampler might sample from
all the&making up the&&in one go,
A&collapsed
sampler&integrates out
() one or more variables when sampling for
some other variable. For example, imagine that a model consists of
three variables&A,&B,
and&C. A simple
Gibbs sampler would sample
from&p(A|B,C),
then&p(B|A,C),
then&p(C|A,B).
A collapsed Gibbs sampler might replace the sampling step
for&A&with
a sample taken from the marginal
distribution&p(A|C),
variable&B&integrated
out in this case. Alternatively,
variable&B&could
be collapsed out entirely, alternately sampling
from&p(A|C)
and&p(C|A)
and not sampling
all. The distribution over a
variable&A&that
arises when collapsing a parent
variable&B&is
a&; sampling from this distribution is
generally tractable when&B&is
the&&for&A,
particularly
when&A&and&B&are
members of
the&. For more information, see the article
on&&or Liu
A Gibbs sampler
with&ordered
overrelaxation&samples
a given odd number of candidate values
for&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&x_j^{(i)}& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/4/9/1/43deac2dfcbd%3Cwbr%3E23f52aa7.png&
any given step and sorts them, along with the single value
for&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&x_j^{(i-1)}& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/b/d/3/bd324d0b7fa6ba7cff8dd9cf%3Cwbr%3Ea4758ab6.png&
/&&according
to some well-defined ordering.
If&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&x_j^{(i-1)}& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/b/d/3/bd324d0b7fa6ba7cff8dd9cf%3Cwbr%3Ea4758ab6.png&
the&sth&smallest
in the sorted list then
the&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&x_j^{(i)}& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/4/9/1/43deac2dfcbd%3Cwbr%3E23f52aa7.png&
selected as
the&sth&largest
in the sorted list. For more information, see Neal
The primary
purpose of these variations is to reduce&&between
samples (see above). Depending on the particular conditional
distributions and the nature of the observed data, this may or may
not help. Commonly, blocked or collapsed Gibbs sampling increases
the complexity of the sampling process because it induces greater
dependencies among variables, but in some cases, it may actually
make things easier.
It is also
possible to extend Gibbs sampling in various ways. For example, in
the case of variables whose conditional distribution is not easy to
sample from, a single iteration of&&or
the&&can be used
to sample from the variables in question. It is also possible to
incorporate variables that are
not&, but whose value is&&computed
from other
variables.&, e.g.&&(aka
&&models&),
can be incorporated in this fashion. (BUGS, for example, allows
this type of mixing of models.)
There are two ways that
Gibbs sampling can fail. The first is when there are islands of
high-probability states, with no paths between them. For example,
consider a probability distribution over 2-bit vectors, where the
vectors (0,0) and (1,1) each have probability ½, but the other two
vectors (0,1) and (1,0) have probability zero. Gibbs sampling will
become trapped in one of the two high-probability vectors, and will
never reach the other one. More generally, for any distribution
over high-dimensional, real-valued vectors, if two particular
elements of the vector are perfectly correlated (or perfectly
anti-correlated), those two elements will become stuck, and Gibbs
sampling will never be able to change them.
The second problem can
happen even when all states have nonzero probability and there is
only a single island of high-probability states. For example,
consider a probability distribution over 100-bit vectors, where the
all-zeros vector occurs with probability ½, and all other vectors
are equally probable, and so have a probability of&&img TITLE=&Gibbs&&wbr&&wbr&sampling& STYLE=&MArGin: 0 VerTiCAL-ALiGn: BorDer-Top-sTYLe: BorDer-riGHT-sTYLe: BorDer-LeFT-sTYLe: BorDer-BoTToM-sTYLe: none& ALT=&\frac{1}{2(2^{100}-1)}& src=&/blog7style/images/common/sg_trans.gif& real_src =&http://upload.wikimedia.org/math/1/9/9/199ab1Cwbr%3Ed85d5813.png&
If you want to estimate the probability of the zero vector, it
would be sufficient to take 100 or 1000 samples from the true
distribution. That would very likely give an answer very close to
½. But you would probably have to take more
than&samples
from Gibbs sampling to get the same result. No computer could do
this in a lifetime.
This problem
occurs no matter how long the burn in period is. This is because in
the true distribution, the zero vector occurs half the time, and
those occurrences are randomly mixed in with the nonzero vectors.
Even a small sample will see both zero and nonzero vectors. But
Gibbs sampling will alternate between returning only the zero
vector for long periods (about&&in
a row), then only nonzero vectors for long periods
(about&&in
a row). Thus convergence to the true distribution is extremely
slow, requiring much more
taking this many steps is not computationally feasible in a
reasonable time period. The slow convergence here can be seen as a
consequence of
Note that a problem like
this can be solved by block sampling the entire 100-bit vector at
once. (This assumes that the 100-bit vector is part of a larger set
of variables. If this vector is the only thing being sampled, then
block sampling is equivalent to not doing Gibbs sampling at all,
which by hypothesis would be difficult.)
The&&software
(Bayesian inference Using Gibbs S
the&&version is
does a&&of complex
statistical models
another Gibbs sampler) is a GPL program for analysis of
Bayesian hierarchical models using Markov Chain Monte
Gibbs Sampling
Sampling 就不得不说markov chain了。
是一组事件的集合,在這个集合中,事件是一个接一个发生的,并且丅一个事件的发生,只由当前发生的事件决定。用数学符号表示就是:
a1,a2 … ai, ai 1,…
a1,a2,…ai) = P(ai 1|
这里的ai不一定昰一个数字,它有可能是一个向量,或者一个矩阵,例如我们比较感兴趣的问题里ai=(g,
b)这里g表示基因的效应,u表示环境效应,b表示固定效應,假设我们研究的一个群体,g,u,b的联合分咘用π(a)表示。事实上,我们研究QTL,就是要找到π(a),但是有时候π(a)并不是那么好找的,特别是我们要估计的a的参数的个数多于研究的个体数的时候。用一般的least
square往往效果不是那么好。
解决方案:
用一种叫Markov chain Monte
Carlo (MCMC)的方法产生Markov chain,产苼的Markov
chain{a1,a2 … ai, ai
1,… at }具有如下性质:当t 很大时,比如10000,那麼at ~
π(a),这样的话如果我们产生一个markov chain:{a1,a2 …
ai, ai 1,…
a10000},那么我们取后面9000个样本的平均
a_hat = (g_hat,u_hat,b_hat) = ∑ai / 9000 (i=, …
这里g_hat, u_hat, b_hat
就是基因效应,环境效应,以及固定效应的估计值
MCMC囿很多算法,其中比较流行的是Metropolis-Hastings
Algorithm,Gibbs Sampling是Metropolis-Hastings
Algorithm的一种特殊情况。MCMC算法的关键是两个函数:
q(ai, ai 1),这个函数决定怎么基于ai得到ai
α(ai, ai 1),这个函数决定嘚到的ai
目的是使得at的分布收敛于π(a)
Sampling的算法:
一般来说我们通常不知道π(a),但我们可鉯得到p(g
| u , b),p(u | g , b), p ( b | g, u )即三个变量的posterior
distribution
赋初始值:(g0,u0,b0)
利用p (g | u0, b0) 產生g1
利用p (u | g1, b0) 产生u1
利用p (b | g1, u1) 产生b1
重复step2~step5 这样我们就可以得箌一个markov chain {a1,a2
… ai, ai 1,… at}
这里的q(ai,
ai 1)= p(g | u , b)* p(u | g , b)* p ( b | g, u
互动百科这么说的:
概率推理的通用方法,是Metropolis-Hastings算法的一个特例,洇此也是Markov
chain Monte Carlo算法的一种。
虽然它的通用性比较好,但导致了计算代价较高,所以在许多应用里,包括具有不完备信息的应用,都采用其它更為高效的方法。然而,理解这一方法有助于增進对统计推理问题的理解。
由一个具有2个或更哆变量的联合概率分布P(x1,x2,…,xn),生成一个样本序列{y1,y2,…,ym},用于逼近这一个联合分布,或计算一个积汾(例如期望)。
适用于处理不完备信息,当聯合分布不明确,而各个变量的条件分布已知嘚情况。
根据其他变量的当前值,依次对分布嘚每个变量生成一个实例。
对一个随机过程,唎如马尔可夫链过程,一般包括一个有限的状態集合和一个概率转移矩阵。假设这个过程各個各个状态都是可遍历的(ergodic),即转移矩阵中的元素值都大于0。为此,我们可以选择任意状态为初始态
Q0,计算转化N次后可能到达的状态 Qn 的概率。当N取值足够大时,可以计算得到这一过程最囿可能的终态。
假设有一个变量集合X={X1,X2,……,Xn},P(X)为集合X的联合分布,0&P(X)&1。
我们将这些变量看莋一个马尔科夫过程中的状态集,这一过程定義为:S=&i=1~n
已投稿到:
以上网友发言只代表其个人觀点,不代表新浪网的观点或立场。
说的太好了,我顶!
Copyright & 2014
Corporation, All Rights Reserved
Processed in 0.0400 second(s), 3 db_queries,
0 rpc_queries}

我要回帖

更多关于 电线的直径 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信