parameterspace.priors.truncated_normal
TruncatedNormal
Truncated normal prior for bounded parameters.
loglikelihood(self, value)
Compute the log PDF (up to an additive constant) of a given value.
Note
Values for the priors are always after the transformation!
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value |
|
[description] |
required |
Returns:
Type | Description |
---|---|
|
[descriptions] |
Source code in parameterspace/priors/truncated_normal.py
def loglikelihood(self, value):
return self.sps_dist.logpdf(value)
pdf(self, value)
Computes the PDF of a given value.
Note
Values for the priors are always after the transformation!
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value |
|
[description] |
required |
Returns:
Type | Description |
---|---|
|
[descriptions] |
Source code in parameterspace/priors/truncated_normal.py
def pdf(self, value):
return self.sps_dist.pdf(value)
sample(self, num_samples=None, random_state=<module 'numpy.random' from '/home/runner/.cache/pypoetry/virtualenvs/parameterspace-9AYrJA9h-py3.8/lib/python3.8/site-packages/numpy/random/__init__.py'>)
Draw random samples from the prior.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num_samples |
|
[description] |
None |
Returns:
Type | Description |
---|---|
|
[descriptions] |
Source code in parameterspace/priors/truncated_normal.py
def sample(self, num_samples=None, random_state=npr):
return self.sps_dist.rvs(size=num_samples, random_state=random_state)