Skip to content
Closed
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
8 changes: 6 additions & 2 deletions pymc3/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,9 @@ def logpt(self):

@property
def logp_nojact(self):
"""Theano scalar of log-probability, excluding jacobian terms."""
"""Theano scalar of log-probability of the model but without the jacobian
if transformed Random Variable is presented.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if transformed Random Variable is presented.
if transformed Random Variable is presented.
Note that If there is no transformed variable in the model, logp_nojact
will be the same as logpt as there is no need for Jacobian correction.

"""
if getattr(self, 'total_size', None) is not None:
logp = tt.sum(self.logp_nojac_unscaledt) * self.scaling
else:
Expand Down Expand Up @@ -734,7 +736,9 @@ def logpt(self):

@property
def logp_nojact(self):
"""Theano scalar of log-probability of the model"""
"""Theano scalar of log-probability of the model but without the jacobian
if transformed Random Variable is presented.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that the Jacobian will be present if there are no transformed random variables? That is how I understand the sentence.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there are no transformed variables there is no need for Jacobian correction, hence logp_nojact will be the same as logpt
This should be rephrased to make it clearer indeed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if transformed Random Variable is presented.
if transformed Random Variable is presented.
Note that If there is no transformed variable in the model, logp_nojact
will be the same as logpt as there is no need for Jacobian correction.

"""
with self:
factors = [var.logp_nojact for var in self.basic_RVs] + self.potentials
logp = tt.sum([tt.sum(factor) for factor in factors])
Expand Down