用给定的MLE模拟随机样本


17

这个交叉验证问题要求模拟一个以固定金额为条件的样本,使我想起了乔治•卡塞拉George Casella)提出的一个问题。

f(x|θ)(X1,,Xn)θ

θ^(x1,,xn)=argmini=1nlogf(xi|θ)
对于一个给定的值,有以模拟IID样品一个通用的方法上的MLE的值有条件?θθX 1... X Ñ(X1,,Xn)θ^(X1,,Xn)

例如,采用分布,位置参数为,密度为如果我们如何以条件来模拟?在此示例中,没有封闭形式的表达式。T5μ

f(x|μ)=Γ(3)Γ(1/2)Γ(5/2)[1+(xμ)2/5]3
(X1,,Xn)iidf(x|μ)
(X1,,Xn)μ^(X1,,Xn)=μ0T5μ^(X1,,Xn)

Answers:


20

一种选择是使用约束的HMC变体,如Brubaker等人(1)在“隐式定义的歧管上的MCMC方法家族”中所述。这就要求我们可以表达的条件,位置参数的最大似然估计等于某个固定为一些隐含定义(和微分)完整约束Ç { X } Ñ = 1 = 0。然后,我们可以模拟受此约束的受限哈密顿动力学,并像在标准HMC中一样在Metropolis-Hastings步骤中接受/拒绝。μ0c({xi}i=1N)=0

负对数似然为 ,其具有相对于所述位置参数的第一和第二偏导数μ∂&大号

L=i=1N[logf(xi|μ)]=3i=1N[log(1+(xiμ)25)]+constant
μ 的最大似然估计μ0然后被隐含地定义作为解决 ç=ÑΣ=1[2μ0-X
Lμ=3i=1N[2(μxi)5+(μxi)2]and2Lμ2=6i=1N[5(μxi)2(5+(μxi)2)2].
μ0
c=i=1N[2(μ0xi)5+(μ0xi)2]=0subject toi=1N[5(μ0xi)2(5+(μ0xi)2)2]>0.

我不知道是否有暗示将有一个独特的MLE的任何结果给定{ X } ñ = 1 -密度无法登录凹在μ所以它似乎并不平凡,以保证这一点。如果有一个单一的独特的解决方案上述隐式地定义连接ñ - 1个嵌入维流形ř Ñ对应于该组的{ X } Ñ = 1与MLE为μ等于μ 0μ{xi}i=1NμN1RN{xi}i=1Nμμ0。如果存在多个解决方案,那么歧管可能由多个未连接的组件组成,其中一些可能对应于似然函数的最小值。在这种情况下,我们将需要一些其他机制来在未连接的组件之间移动(因为模拟动态通常将保持在单个组件之内),并检查二阶条件,如果它对应于移动到,则拒绝移动。可能性最小。

如果我们用表示向量[ x 1x N ] T并引入一个带有质量矩阵M的共轭动量状态p和一个用于标量约束c x 的拉格朗日乘数λ,那么ODE的系统 d x的解x[x1xN]TpMλc(x) 给定的初始条件X0=X0p0=p0ÇX0=0Ç

dxdt=M1p,dpdt=Lxλcxsubject toc(x)=0andcxM1p=0
x(0)=x0, p(0)=p0c(x0)=0,定义了一个受约束的哈密顿动力学,该动力学仍然局限于约束流形,它是时间可逆的,并且精确地保留了哈密顿量和流形体积元素。如果我们用一个辛积分器用于约束Hamilton系统如SHAKE(2)或咔嗒声(3),其通过求解拉格朗日乘数恰好维持在每个时步的约束,我们可以模拟的准确动态的前进大号离散时间步长δ从满足x的一些初始约束cx|x0M1p0=0Lδt并接受建议的新状态对 x x,px,p with probability
min{1,exp[L(x)L(x)+12pTM1p12pTM1p]}.
If we interleave these dynamics updates with partial / full resampling of the momenta from their Gaussian marginal (restricted to the linear subspace defined by cxM1p=0) then modulo the possiblity of there being multiple non-connected constraint manifold components, the overall MCMC dynamic should be ergodic and the configuration state samples x will coverge in distribution to the target density restricted to the constraint manifold.

To see how constrained HMC performed for the case here I ran the geodesic integrator based constrained HMC implementation described in (4) and available on Github here (full disclosure: I am an author of (4) and owner of the Github repository), which uses a variation of the 'geodesic-BAOAB' integrator scheme proposed in (5) without the stochastic Ornstein-Uhlenbeck step. In my experience this geodesic integration scheme is generally a bit easier to tune than the RATTLE scheme used in (1) due the extra flexibility of using multiple smaller inner steps for the geodesic motion on the constraint manifold. An IPython notebook generating the results is available here.

N=3μ=1μ0=2. An initial x corresponding to a MLE of μ0 was found by Newton's method (with the second order derivative checked to ensure a maxima of the likelihood was found). I ran a constrained dynamic with δt=0.5, L=5 interleaved with full momentum refreshals for 1000 updates. The plot below shows the resulting traces on the three x components

3D示例的迹线图

and the corresponding values of the first and second order derivatives of the negative log-likelihood are shown below

对数似然导数迹线图

from which it can be seen that we are at a maximum of the log-likelihood for all sampled x. Although it is not readily apparent from the individual trace plots, the sampled x lie on a 2D non-linear manifold embedded in R3 - the animation below shows the samples in 3D

限于2D歧管的样品的3D可视化

Depending on the interpretation of the constraint it may also be necessary to adjust the target density by some Jacobian factor as described in (4). In particular if we want results consistent with the ϵ0 limit of using an ABC like approach to approximately maintain the constraint by proposing unconstrained moves in RN and accepting if |c(x)|<ϵ, then we need to multiply the target density by cxTcx. In the above example I did not include this adjustment so the samples are from the original target density restricted to the constraint manifold.

References

  1. M. A. Brubaker, M. Salzmann, and R. Urtasun. A family of MCMC methods on implicitly defined manifolds. In Proceedings of the 15th International Conference on Artificial Intelligence and Statistics, 2012.
    http://www.cs.toronto.edu/~mbrubake/projects/AISTATS12.pdf

  2. J.-P. Ryckaert, G. Ciccotti, and H. J. Berendsen. Numerical integration of the Cartesian equations of motion of a system with constraints: molecular dynamics of n-alkanes. Journal of Computational Physics, 1977.
    http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.399.6868

  3. H. C. Andersen. RATTLE: A "velocity" version of the SHAKE algorithm for molecular dynamics calculations. Journal of Computational Physics, 1983.
    http://www.sciencedirect.com/science/article/pii/0021999183900141

  4. M. M. Graham and A. J. Storkey. Asymptotically exact inference in likelihood-free models. arXiv pre-print arXiv:1605.07826v3, 2016.
    https://arxiv.org/abs/1605.07826

  5. B. Leimkuhler and C. Matthews. Efficient molecular dynamics using geodesic integration and solvent–solute splitting. Proc. R. Soc. A. Vol. 472. No. 2189. The Royal Society, 2016.
    http://rspa.royalsocietypublishing.org/content/472/2189/20160138.abstract


3
Brilliant and opening new and bright perspectives! Thank you.
Xi'an
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.