We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 142289f commit 5ecc539Copy full SHA for 5ecc539
pymc3/examples/garch_example.py
@@ -38,15 +38,10 @@ def get_garch_model():
38
shape = r.shape
39
40
with Model() as garch:
41
- alpha1 = Normal('alpha1', mu=np.zeros(shape=shape),
42
- sd=np.ones(shape=shape), shape=shape)
+ alpha1 = Normal('alpha1', mu=0., sd=1., shape=shape)
43
BoundedNormal = Bound(Normal, upper=(1 - alpha1))
44
- beta1 = BoundedNormal('beta1',
45
- mu=np.zeros(shape=shape),
46
- sd=1e6 * np.ones(shape=shape),
47
- shape=shape)
48
- mu = Normal('mu', mu=np.zeros(shape=shape),
49
- sd=1e6 * np.ones(shape=shape), shape=shape)
+ beta1 = BoundedNormal('beta1', mu=0., sd=1e6, shape=shape)
+ mu = Normal('mu', mu=0., sd=1e6, shape=shape)
50
theta = tt.sqrt(alpha0 + alpha1 * tt.pow(r - mu, 2) +
51
beta1 * tt.pow(sigma1, 2))
52
Normal('obs', mu, sd=theta, observed=r)
@@ -57,7 +52,7 @@ def run(n=1000):
57
if n == "short":
58
53
n = 50
59
54
with get_garch_model():
60
- tr = sample(n, n_init=10000)
55
+ tr = sample(n, init=None)
61
56
return tr
62
63
0 commit comments