@@ -253,7 +253,7 @@ def sample(
253
253
step = None ,
254
254
init = "auto" ,
255
255
n_init = 200_000 ,
256
- start : Optional [Union [PointType , Sequence [Optional [PointType ]]]] = None ,
256
+ initvals : Optional [Union [PointType , Sequence [Optional [PointType ]]]] = None ,
257
257
trace : Optional [Union [BaseTrace , List [str ]]] = None ,
258
258
chain_idx = 0 ,
259
259
chains = None ,
@@ -291,11 +291,10 @@ def sample(
291
291
users.
292
292
n_init : int
293
293
Number of iterations of initializer. Only works for 'ADVI' init methods.
294
- start : dict, or array of dict
295
- Starting point in parameter space (or partial point)
296
- Defaults to ``trace.point(-1))`` if there is a trace provided and model.initial_point if not
297
- (defaults to empty dict). Initialization methods for NUTS (see ``init`` keyword) can
298
- overwrite the default.
294
+ initvals : optional, dict, array of dict
295
+ Dict or list of dicts with initial values to used instead of the defaults from `Model.initial_values`.
296
+ The keys should be names of transformed random variables.
297
+ Initialization methods for NUTS (see ``init`` keyword) can overwrite the default.
299
298
trace : backend or list
300
299
This should be a backend instance, or a list of variables to track.
301
300
If None or a list of variables, the NDArray backend is used.
@@ -417,13 +416,23 @@ def sample(
417
416
mean sd hdi_3% hdi_97%
418
417
p 0.609 0.047 0.528 0.699
419
418
"""
419
+ if "start" in kwargs :
420
+ if initvals is not None :
421
+ raise ValueError ("Passing both `start` and `initvals` is not supported." )
422
+ warnings .warn (
423
+ "The `start` kwarg was renamed to `initvals`. Please check the docstring." ,
424
+ DeprecationWarning ,
425
+ stacklevel = 2 ,
426
+ )
427
+ initvals = kwargs .pop ("start" )
428
+
420
429
model = modelcontext (model )
421
430
if not model .free_RVs :
422
431
raise SamplingError (
423
432
"Cannot sample from the model, since the model does not contain any free variables."
424
433
)
425
434
426
- start = deepcopy (start )
435
+ start = deepcopy (initvals )
427
436
model_initial_point = model .initial_point
428
437
if start is None :
429
438
model .check_start_vals (model_initial_point )
0 commit comments