相关疑难解决方法(0)

重写pymc脚本以在pymc3中的动态系统中进行参数估计

我想使用pymc3来估计霍奇金·赫x黎神经元模型中的未知参数和状态。我在pymc中的代码基于http://healthyalgorithms.com/2010/10/19/mcmc-in-python-how-to-stick-a-statistical-model-on-a-system-dynamics-model- in-pymc /并执行得很好。

#parameter priors
@deterministic
def HH(priors in here)
    #model equations
    #return numpy arrays that somehow contain the probability distributions as elements
    return V,n,m,h

#Make V deterministic in one line. Seems to be the magic that makes this work.
V = Lambda('V', lambda HH=HH: HH[0])

#set up the likelihood
A = Normal('A',mu=V,tau=2.0,value=voltage_data,observed = True)
#run the sampling...
Run Code Online (Sandbox Code Playgroud)

在pymc3中,我无法使用Lambda技巧。这是我的尝试之一:

import numpy as np
import theano.tensor as tt
from pymc3 import Model, Normal, Uniform, Deterministic, sample, NUTS, Metropolis, find_MAP …
Run Code Online (Sandbox Code Playgroud)

python markov-chains mcmc pymc pymc3

5
推荐指数
1
解决办法
616
查看次数

标签 统计

markov-chains ×1

mcmc ×1

pymc ×1

pymc3 ×1

python ×1