Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 22 additions & 14 deletions pymc/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1967,6 +1967,25 @@ def Deterministic(name, var, model=None, dims=None):
they don't add randomness to the model. They are generally used to record
an intermediary result.

Parameters
----------
name : str
Name of the deterministic variable to be registered in the model.
var : tensor_like
Expression for the calculation of the variable.
model : Model, optional
The model object to which the Deterministic variable is added.
If ``None`` is provided, the current model in the context stack is used.
dims : str or tuple of str, optional
Dimension names for the variable.

Returns
-------
var : tensor_like
The registered, named variable wrapped in Deterministic.

Examples
--------
Indeed, PyMC allows for arbitrary combinations of random variables, for
example in the case of a logistic regression

Expand Down Expand Up @@ -2007,19 +2026,6 @@ def Deterministic(name, var, model=None, dims=None):
of times during a NUTS step, the Deterministic quantities are just
computeed once at the end of the step, with the final values of the other
random variables.

Parameters
----------
name: str
var: PyTensor variables
auto: bool
Add automatically created deterministics (e.g., when imputing missing values)
to a separate model.auto_deterministics list for filtering during sampling.


Returns
-------
var: var, with name attribute
"""
model = modelcontext(model)
var = var.copy(model.name_for(name))
Expand Down Expand Up @@ -2059,7 +2065,9 @@ def Potential(name, var, model=None, dims=None):
Expression to be added to the model joint logp.
model : Model, optional
The model object to which the potential function is added.
If ``None`` is provided, the current model is used.
If ``None`` is provided, the current model in the context stack is used.
dims : str or tuple of str, optional
Dimension names for the variable.

Returns
-------
Expand Down