Skip to content

Commit fa5e441

Browse files
authored
Fix outdated Model docstring (#6048)
1 parent 5e7e389 commit fa5e441

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pymc/model.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -465,15 +465,15 @@ def __init__(self, mean=0, sigma=1, name=''):
465465
# variables in several ways note, that all variables
466466
# will get model's name prefix
467467
468-
# 3) you can create variables with Var method
469-
self.Var('v1', Normal.dist(mu=mean, sigma=sd))
470-
# this will create variable named like '{prefix::}v1'
468+
# 3) you can create variables with the register_rv method
469+
self.register_rv(Normal.dist(mu=mean, sigma=sigma), 'v1', initval=1)
470+
# this will create variable named like '{name::}v1'
471471
# and assign attribute 'v1' to instance created
472472
# variable can be accessed with self.v1 or self['v1']
473473
474474
# 4) this syntax will also work as we are in the
475475
# context of instance itself, names are given as usual
476-
Normal('v2', mu=mean, sigma=sd)
476+
Normal('v2', mu=mean, sigma=sigma)
477477
478478
# something more complex is allowed, too
479479
half_cauchy = HalfCauchy('sigma', beta=10, initval=1.)
@@ -510,7 +510,6 @@ def __init__(self, mean=0, sigma=1, name=''):
510510
CustomModel(mean=2, name='second')
511511
512512
# variables inside both scopes will be named like `first::*`, `second::*`
513-
514513
"""
515514

516515
if TYPE_CHECKING:

0 commit comments

Comments
 (0)