@@ -473,39 +473,39 @@ def __init__(self, mean=0, sigma=1, name=''):
473
473
474
474
# 4) this syntax will also work as we are in the
475
475
# context of instance itself, names are given as usual
476
- pm. Normal('v2', mu=mean, sigma=sigma)
476
+ Normal('v2', mu=mean, sigma=sigma)
477
477
478
478
# something more complex is allowed, too
479
- half_cauchy = pm. HalfCauchy('sd', beta=10, initval=1.)
480
- pm. Normal('v3', mu=mean, sigma=half_cauchy)
479
+ half_cauchy = HalfCauchy('sd', beta=10, initval=1.)
480
+ Normal('v3', mu=mean, sigma=half_cauchy)
481
481
482
482
# Deterministic variables can be used in usual way
483
- pm. Deterministic('v3_sq', self.v3 ** 2)
483
+ Deterministic('v3_sq', self.v3 ** 2)
484
484
485
485
# Potentials too
486
- pm. Potential('p1', at.constant(1))
486
+ Potential('p1', at.constant(1))
487
487
488
488
# After defining a class CustomModel you can use it in several
489
489
# ways
490
490
491
491
# I:
492
492
# state the model within a context
493
- with pm. Model() as model:
493
+ with Model() as model:
494
494
CustomModel()
495
495
# arbitrary actions
496
496
497
497
# II:
498
498
# use new class as entering point in context
499
499
with CustomModel() as model:
500
- pm. Normal('new_normal_var', mu=1, sigma=0)
500
+ Normal('new_normal_var', mu=1, sigma=0)
501
501
502
502
# III:
503
503
# just get model instance with all that was defined in it
504
504
model = CustomModel()
505
505
506
506
# IV:
507
507
# use many custom models within one context
508
- with pm. Model() as model:
508
+ with Model() as model:
509
509
CustomModel(mean=1, name='first')
510
510
CustomModel(mean=2, name='second')
511
511
0 commit comments