调节固有模型参数

上接测量噪声\quad包含噪声的测量仪测量模型
\qquad建立含噪声的测量模型后,需要选择传感器模型参数,参数包含zhitzshortzmaxzrandσhitz_{hit}、z_{short}、z_{max}、z_{rand}、\sigma_{hit}zhit​、zshort​、zmax​、zrand​、σhit​和λshort\lambda_{short}λshort​,所有的内部参数标记为Θ\boldsymbol{\Theta}Θ,传感器测量的似然就是Θ\boldsymbol{\Theta}Θ的函数。
\qquad从实际数据中获得这些参数,通过考虑参考数据集Z={zi}Z=\{z_{i}\}Z={zi​}(联合位置X={xi}X=\{x_{i}\}X={xi​}和地图mmm)的似然最大化。似然由下式给出
p(ZX,m,Θ) p(Z|X,m,\boldsymbol{\Theta}) p(Z∣X,m,Θ)\qquad目标是确定使这个似然最大的固有参数Θ\boldsymbol{\Theta}Θ。使用数据似然最大化的估计或算法称为极大似然估计或MLMLML估计。为了推导极大似然估计,引入辅助变量cic_{i}ci​,即一致性变量cic_{i}ci​可能取四个值,对应着产生测量ziz_{i}zi​的四个可能途径。
\qquad基于cic_{i}ci​的值,可以将ZZZ分解为四个不相交的子集ZhitZshortZmaxZ_{hit}、Z_{short}、Z_{max}Zhit​、Zshort​、Zmax​和ZrandZ_{rand}Zrand​。对于参数zhitzshortzmaxzrandz_{hit}、z_{short}、z_{max}、z_{rand}zhit​、zshort​、zmax​、zrand​的极大似然估计是简单的归一化系数
(zhitzshortzmaxzrand)=Z1(ZhitZshortZmaxZrand) \begin{pmatrix} z_{hit}\\ z_{short}\\ z_{max}\\ z_{rand} \end{pmatrix}=|Z|^{-1}\begin{pmatrix} |Z_{hit}|\\ |Z_{short}|\\ |Z_{max}|\\ |Z_{rand}| \end{pmatrix} ⎝⎜⎜⎛​zhit​zshort​zmax​zrand​​⎠⎟⎟⎞​=∣Z∣−1⎝⎜⎜⎛​∣Zhit​∣∣Zshort​∣∣Zmax​∣∣Zrand​∣​⎠⎟⎟⎞​\qquadZ|Z_{*}|∣Z∗​∣表示所有测量点ziz_{i}zi​在每次测量中的权值(对应四种途径)和。获取固有参数σhit\sigma_{hit}σhit​
p(ZhitX,m,Θ)=ziZhitphit(zixi,m,Θ)=ziZhit12πσhit2e12(zizi)2σhit2 p(Z_{hit}|X,m,\boldsymbol{\Theta})= \prod_{z_{i}\in Z_{hit}}p_{hit}(z_{i}|x_{i},m,\boldsymbol{\Theta})\\ = \prod_{z_{i}\in Z_{hit}}\frac{1}{\sqrt{2\pi\sigma_{hit}^{2}}}e^{-\frac{1}{2}\frac{(z_{i}-z_{i}^{*})^{2}}{\sigma_{hit}^{2}}} p(Zhit​∣X,m,Θ)=zi​∈Zhit​∏​phit​(zi​∣xi​,m,Θ)=zi​∈Zhit​∏​2πσhit2​​1​e−21​σhit2​(zi​−zi∗​)2​\qquad取对数(连乘变为连加),求导,由极值的必要条件,对数函数单调递增性质得极大似然估计解:
σhit=1ZhitziZhit(zizi)2 \sigma_{hit}=\sqrt{\frac{1}{|Z_{hit}|}\sum_{z_{i}\in Z_{hit}}(z_{i}-z_{i}^{*})^{2}} σhit​=∣Zhit​∣1​zi​∈Zhit​∑​(zi​−zi∗​)2\qquad求解参数λshort\lambda_{short}λshort​使用相同的方法,求解结果为:
λshort=ZshortziZshortzi \lambda_{short}=\frac{|Z_{short}|}{\sum_{z_{i}\in Z_{short}}z_{i}} λshort​=∑zi​∈Zshort​​zi​∣Zshort​∣​\qquad上述推导为假设参数cic_{i}ci​已知,现在延伸到cic_{i}ci​未知,使用EMEMEM算法求解,第一步计算cic_{i}ci​的期望值,第二步计算该期望值下的固有模型参数。将前文极大似然估计中:
log p(ZX,m,Θ)=ziZlog p(zixi,m)=ziZhitlog phit(zixi,m)+ziZshortlog pshort(zixi,m)+ziZmaxlog pmax(zixi,m)+ziZrandlog prand(zixi,m) log\ p(Z|X,m,\boldsymbol{\Theta})=\sum_{z_{i}\in Z}log\ p(z_{i}|x_{i},m)\\ = \sum_{z_{i}\in Z_{hit}}log\ p_{hit}(z_{i}|x_{i},m) + \sum_{z_{i}\in Z_{short}}log\ p_{short}(z_{i}|x_{i},m) + \sum_{z_{i}\in Z_{max}}log\ p_{max}(z_{i}|x_{i},m) + \sum_{z_{i}\in Z_{rand}}log\ p_{rand}(z_{i}|x_{i},m) log p(Z∣X,m,Θ)=zi​∈Z∑​log p(zi​∣xi​,m)=zi​∈Zhit​∑​log phit​(zi​∣xi​,m)+zi​∈Zshort​∑​log pshort​(zi​∣xi​,m)+zi​∈Zmax​∑​log pmax​(zi​∣xi​,m)+zi​∈Zrand​∑​log prand​(zi​∣xi​,m)\qquad改写为
log p(ZX,m,Θ)=ziZI(ci=hit)log phit(zixi,m)+I(ci=short)log pshort(zixi,m)+I(ci=max)log pmax(zixi,m)+I(ci=rand)log prand(zixi,m) log\ p(Z|X,m,\boldsymbol{\Theta}) = \sum_{z_{i}\in Z}I(c_{i}=hit)log\ p_{hit}(z_{i}|x_{i},m)+I(c_{i}=short)log\ p_{short}(z_{i}|x_{i},m)+I(c_{i}=max)log\ p_{max}(z_{i}|x_{i},m)+I(c_{i}=rand)log\ p_{rand}(z_{i}|x_{i},m) log p(Z∣X,m,Θ)=zi​∈Z∑​I(ci​=hit)log phit​(zi​∣xi​,m)+I(ci​=short)log pshort​(zi​∣xi​,m)+I(ci​=max)log pmax​(zi​∣xi​,m)+I(ci​=rand)log prand​(zi​∣xi​,m)\qquadzi\color{#F00}{z_{i}的取值范围变化!!!}zi​的取值范围变化!!!求解期望值最大得:
E(log p(ZX,m,Θ))=ziZei,hitlog phit(zixi,m)+ei,shortlog pshort(zixi,m)+ei,shortlog pmax(zixi,m)+ei,randlog prand(zixi,m) E(log\ p(Z|X,m,\boldsymbol{\Theta}))=\sum_{z_{i}\in Z}e_{i,hit}log\ p_{hit}(z_{i}|x_{i},m)+e_{i,short}log\ p_{short}(z_{i}|x_{i},m)+e_{i,short}log\ p_{max}(z_{i}|x_{i},m)+e_{i,rand}log\ p_{rand}(z_{i}|x_{i},m) E(log p(Z∣X,m,Θ))=zi​∈Z∑​ei,hit​log phit​(zi​∣xi​,m)+ei,short​log pshort​(zi​∣xi​,m)+ei,short​log pmax​(zi​∣xi​,m)+ei,rand​log prand​(zi​∣xi​,m)\qquad使用EMEMEM算法实现最大化,固定变量σhit\sigma_{hit}σhit​和λshort\lambda_{short}λshort​,计算变量cic_{i}ci​的期望。
(ei,hitei,shortei,maxei,rand)=η(phit(zixi,m)pshort(zixi,m)pmax(zixi,m)prand(zixi,m)) \begin{pmatrix} e_{i,hit}\\ e_{i,short}\\ e_{i,max}\\ e_{i,rand} \end{pmatrix}=\eta\begin{pmatrix} p_{hit}(z_{i}|x_{i},m)\\ p_{short}(z_{i}|x_{i},m)\\ p_{max}(z_{i}|x_{i},m)\\ p_{rand}(z_{i}|x_{i},m) \end{pmatrix} ⎝⎜⎜⎛​ei,hit​ei,short​ei,max​ei,rand​​⎠⎟⎟⎞​=η⎝⎜⎜⎛​phit​(zi​∣xi​,m)pshort​(zi​∣xi​,m)pmax​(zi​∣xi​,m)prand​(zi​∣xi​,m)​⎠⎟⎟⎞​其中η=[phit(zixi,m)+pshort(zixi,m)+pmax(zixi,m)+prand(zixi,m)]1\eta = [p_{hit}(z_{i}|x_{i},m)+p_{short}(z_{i}|x_{i},m)+p_{max}(z_{i}|x_{i},m)+p_{rand}(z_{i}|x_{i},m)]^{-1}η=[phit​(zi​∣xi​,m)+pshort​(zi​∣xi​,m)+pmax​(zi​∣xi​,m)+prand​(zi​∣xi​,m)]−1
(zhitzshortzmaxzrand)=Z1i(ei,hitei,shortei,maxei,rand) \begin{pmatrix} z_{hit}\\ z_{short}\\ z_{max}\\ z_{rand} \end{pmatrix}= |Z|^{-1}\sum_{i}\begin{pmatrix} e_{i,hit}\\ e_{i,short}\\ e_{i,max}\\ e_{i,rand} \end{pmatrix} ⎝⎜⎜⎛​zhit​zshort​zmax​zrand​​⎠⎟⎟⎞​=∣Z∣−1i∑​⎝⎜⎜⎛​ei,hit​ei,short​ei,max​ei,rand​​⎠⎟⎟⎞​
σhit=1ziZei,hitziZei,hit(zizi)2λshort=ziZei,shortziZei,shortzi \sigma_{hit}=\sqrt{\frac{1}{\sum_{z_{i}\in Z}e_{i,hit}}\sum_{z_{i}\in Z}e_{i,hit}(z_{i}-z_{i}^{*})^{2}}\\ \lambda_{short} = \frac{\sum_{z_{i}\in Z}e_{i,short}}{\sum_{z_{i}\in Z}e_{i,short}z_{i}} σhit​=∑zi​∈Z​ei,hit​1​zi​∈Z∑​ei,hit​(zi​−zi∗​)2​λshort​=∑zi​∈Z​ei,short​zi​∑zi​∈Z​ei,short​​ziη()\color{#F00}{给每个测量值z_{i}按照概率值在\eta(归一化系数)中的比例加权}给每个测量值zi​按照概率值在η(归一化系数)中的比例加权。

上一篇:Keras猫狗大战二:加载模型预测单张图片


下一篇:Unity 双击某个物体