Changeset 687 for branches/UQ/math/examples2/TEST4d_OUQ_surrogate_diam.py
- Timestamp:
- 06/15/13 18:43:09 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UQ/math/examples2/TEST4d_OUQ_surrogate_diam.py
r575 r687 68 68 69 69 from mystic.math.measures import split_param 70 from mystic.math.di rac_measure import product_measure70 from mystic.math.discrete import product_measure 71 71 from mystic.math import almostEqual 72 72 from numpy import inf … … 114 114 # impose expectation on product measure 115 115 ##################### begin function-specific ##################### 116 E = float(c. get_expect(model))116 E = float(c.expect(model)) 117 117 if not (E <= float(target[0] + error[0])) \ 118 118 or not (float(target[0] - error[0]) <= E): … … 130 130 #XXX: apply 'filters' to catch errors in constraints solver (necessary ?) 131 131 ##################### begin function-specific ##################### 132 E = float(c. get_expect(model))132 E = float(c.expect(model)) 133 133 if E > (target[0] + error[0]) or E < (target[0] - error[0]): 134 134 if debug: print "skipping expect: %s" % E … … 238 238 239 239 from numpy import array 240 from mystic.math.di rac_measure import product_measure240 from mystic.math.discrete import product_measure 241 241 c = product_measure() 242 242 c.load(solved,npts) … … 246 246 247 247 # XXX: 4D-expect 248 print "expect: %s" % str( c. get_expect(model) )248 print "expect: %s" % str( c.expect(model) ) 249 249 print "var (x): %s" % str( c[0].var ) # var(h) 250 250 print "mean(x): %s" % str( c[0].mean ) # mean(h)
Note: See TracChangeset
for help on using the changeset viewer.