首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >PyMC3中的隐马尔可夫

PyMC3中的隐马尔可夫
EN

Stack Overflow用户
提问于 2013-11-09 19:54:12
回答 1查看 1.6K关注 0票数 8

我有一个多变量蒙特卡洛隐马尔可夫问题要解决:

代码语言:javascript
复制
   x[k] = f(x[k-1]) + B u[k]
   y[k] = g(x[k])

其中:

代码语言:javascript
复制
x[k] the hidden states (Markov dynamics)
y[k] the observed data
u[k] the stochastic driving process

PyMC3是否已经足够成熟,可以处理这个问题,或者我应该继续使用2.3版?其次,在PyMC框架中对HM模型的任何引用都将非常受欢迎。谢谢。

--亨克

EN

Stack Overflow用户

发布于 2013-11-29 22:58:37

我在PyMC 2.x上也做了类似的事情。我的u并不依赖于时间。下面是我的例子。

代码语言:javascript
复制
# we're using `some_tau` for the noise throughout the example.
# this should be replaced with something more meaningful.
some_tau = 1 / .5**2

# PRIORS
# we don't know too much about the velocity, might be pos. or neg. 
vel = pm.Normal("vel", mu=0, tau=some_tau)

# MODEL
# next_state = prev_state + vel (and some gaussian noise)
# That means that each state depends on the prev_state and the vel.
# We save the states in a list.
states = [pm.Normal("s0", mu=true_positions[0], tau=some_tau)]
for i in range(1, len(true_positions)):
    states.append(pm.Normal(name="s" + str(i),
                            mu=states[-1] + vel,
                            tau=some_tau))

# observation with gaussian noise
obs = pm.Normal("obs", mu=states, tau=some_tau, value=true_positions, observed=True)

我想你需要把你的vel建模成一个房车列表。他们可能也有一些依赖性。

这是最初的问题:PyMC: Parameter estimation in a Markov system

下面是作为IPython笔记本的完整示例:http://nbviewer.ipython.org/github/sotte/random_stuff/blob/master/PyMC%20-%20Simple%20Markov%20Chain.ipynb

票数 2
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19875621

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档