作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我有一个多元蒙特卡洛隐马尔可夫问题要解决:
x[k] = f(x[k-1]) + B u[k]
y[k] = g(x[k])
哪里:
x[k] the hidden states (Markov dynamics)
y[k] the observed data
u[k] the stochastic driving process
PyMC3 是否已经足够成熟来处理这个问题,还是我应该继续使用 2.3 版?其次,非常感谢任何对 PyMC 框架中 HM 模型的引用。谢谢。
-- 亨克
最佳答案
我对 PyMC 2.x 做了类似的事情。我的你虽然不依赖时间。这是我的例子。
# 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 建模为 RV 列表。他们也可能有一些依赖性。
这是原始问题: PyMC: Parameter estimation in a Markov system
这是 IPython notebook 的完整示例: http://nbviewer.ipython.org/github/sotte/random_stuff/blob/master/PyMC%20-%20Simple%20Markov%20Chain.ipynb
关于python - PyMC3 中的隐马尔可夫,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19875621/
我是一名优秀的程序员,十分优秀!