Closed paulthebaker closed 2 years ago
Merging #322 (870ecfc) into master (b9d7b38) will increase coverage by
0.27%
. The diff coverage is96.77%
.
@@ Coverage Diff @@
## master #322 +/- ##
==========================================
+ Coverage 88.06% 88.33% +0.27%
==========================================
Files 13 13
Lines 2982 3010 +28
==========================================
+ Hits 2626 2659 +33
+ Misses 356 351 -5
Impacted Files | Coverage Δ | |
---|---|---|
enterprise/signals/parameter.py | 84.05% <96.77%> (+3.81%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update b9d7b38...870ecfc. Read the comment docs.
This should now correctly handle meta-parameters, by wrapping the initial normalization computation in a try
/ except
statement. If any of the four parameters are Parameter
instances, this computation raises a ValueError
and _norm=None
. The normalization must then be computed each time get_pdf
is called.
There is also a new test that instantiates a TruncNormal
with mu
as a Uniform
instance and calls get_pdf
.
This implements a truncated normal parameter as
enterprise.signals.parameter.TruncNormal
. The truncated normal distribution matches the usual normal distribution up to normalization within a finite domain, and is zero outside of that domain.This parameter class can be used to avoid the error described in #321.
TruncNormal
handles scalar and vector parameters, including vectors where each element has a unique mean, deviation, and domain. UnlikeNormal
, it cannot handle a full multivariate distribution defined by a covariance matrix.This example code block shows the prior function and output of the sampler in agreement: