# PyMC3 中的 SARIMAX model

#### SARIMAX model in PyMC3

``````with pm.Model() as ar2:
theta = pm.Normal("theta", 0.0, 1.0, shape=2)
sigma = pm.HalfNormal("sigma", 3)
likelihood = pm.AR("y", theta, sigma=sigma, observed=data)

trace = pm.sample(
1000,
tune=2000,
random_seed=13,
)
idata = az.from_pymc3(trace)
``````
2 个回复

``````with pm.Model():
# Priors
arL1 = pm.Uniform('ar.L1', -0.99, 0.99)
maL1 = pm.Uniform('ma.L1', -0.99, 0.99)
sigma2 = pm.InverseGamma('sigma2', 2, 4)

# convert variables to tensor vectors
# # this is wrong:
theta = tt.as_tensor_variable([arL1, maL1, sigma2])
# # this is correct:
theta = tt.as_tensor_variable([arL1, maL1, sigma2], 'v')

# use a DensityDist (use a lamdba function to "call" the Op)
# # this is wrong:
# pm.DensityDist('likelihood', lambda v: loglike(v), observed={'v': theta})
# # this is correct:
pm.DensityDist('likelihood', lambda v: loglike(v), observed=theta)

# Draw samples
trace = pm.sample(ndraws, tune=nburn, discard_tuned_samples=True, cores=4)
``````

1 在 PyMC3 中更新模型

2 pymc3中的条件Logit model

2019-09-23 09:47:42 0 26   pymc3
3 Pymc3中的分类混合模型

2015-08-28 00:43:44 1 666   pymc3
4 在pymc3中创建Emax模型

2016-06-07 13:20:14 1 58   pymc3
5 将 pymc3 模型包装在一个函数中

2020-11-23 21:38:10 1 52   pymc
6 pymc3在Jupyter Notebook中-模型未“重置”

2021-04-28 15:10:42 0 15   pymc3
7 PyMC3模型解释

2020-07-30 17:02:46 0 27   pymc3
8 将混合模型移植到pymc3

2013-12-15 04:30:51 1 583   pymc
9 PyMC3高斯混合模型

10 从pymc2到PyMC3的CAR模型

2017-04-10 16:43:54 1 207   pymc