- Timestamp:
- 11/12/14 07:37:47 (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
mystic/_math/measures.py
r763 r768 511 511 return list(weights * inf) # protect against ZeroDivision 512 512 if float(mass): 513 return list(weights / (w/mass)**(1./n)) #FIXME: not "mean-preserving" 513 if w/mass < 0.0: 514 return list(-weights / (-w/mass)**(1./n)) #FIXME: not "mean-preserving" 515 return list(weights / (w/mass)**(1./n)) #FIXME: not "mean-preserving" 514 516 # force selected member to satisfy product = 0.0 515 517 if not zsum: … … 520 522 n = n-1 521 523 mass = zmass 522 return list(weights[:-1]/(w/mass)**(1./n))+[0.] #FIXME: not "mean-preserving" 524 if w/mass >= 0.0: 525 return list(weights[:-1]/(w/mass)**(1./n))+[0.]#FIXME: not "mean-preserving" 526 return list(-weights[:-1]/(-w/mass)**(1./n))+[0.]#FIXME: not "mean-preserving" 523 527 524 528
Note: See TracChangeset
for help on using the changeset viewer.