Fix sampling when mean/covs = nan

Bug #1167863 reported by matley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenQuake Risk Library
Fix Released
Critical
matley

Bug Description

Sampling a LogNormalDistribution when both means and coefficient of variations are set to 0 gives wrong results.

When some of the covs are equal to zero, the corresponding losses should not be changed. Example given:

d = LogNormalDistribution()

d.init(1, 1)

d.sample(np.array([10, 3, 0, 0]), np.array([0, 0.3, 0.1, 0]), None) -> [10, 3.14, 0, 0]

where 3.14 is the number 3 perturbed when both mean/cov > 0

Please, note that the bug is not occurring when all the covs = 0 because in that case we are not sampling at all.

Revision history for this message
matley (matley) wrote :
matley (matley)
Changed in oq-risklib:
milestone: none → 0.1
Changed in oq-risklib:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.