Skip to content

Negative value of "scale" parameter doesn't throw an exception #2

Description

@eldarkurtic

Hi :),
setting the negative value of the scale parameter doesn't throw an exception and allows user to even sample from that model. There is only a RuntimeWarning: "invalid value encountered in log return np.log(np.exp(y - self.lower_bound) - 1)".

x = NormalVariable(loc=0., scale=-10., name="mu")
model = ProbabilisticModel([x])

If one try to sample from this model, output will contain NaN but maybe it would be better to throw an exception for the invalid parameters of the model.

sample = model.get_sample(2)
print(sample)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions