- Timestamp:
- 06/15/13 18:43:09 (3 years ago)
- Location:
- branches
- Files:
-
- 21 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) -
branches/UQ/math/examples2/TEST_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 … … 94 94 # impose expectation on product measure 95 95 ##################### begin function-specific ##################### 96 E = float(c. get_expect(model))96 E = float(c.expect(model)) 97 97 if not (E <= float(target[0] + error[0])) \ 98 98 or not (float(target[0] - error[0]) <= E): … … 106 106 c = product_measure() 107 107 c.load(rv, npts) 108 E = float(c. get_expect(model))108 E = float(c.expect(model)) 109 109 if E > (target[0] + error[0]) or E < (target[0] - error[0]): 110 110 if debug: print "skipping expect: %s" % E … … 190 190 191 191 from numpy import array 192 from mystic.math.di rac_measure import product_measure192 from mystic.math.discrete import product_measure 193 193 c = product_measure() 194 194 c.load(solved,npts) … … 197 197 print "solved: [wz,z]\n%s" % array(zip(c[2].weights,c[2].coords)) 198 198 199 print "expect: %s" % str( c. get_expect(model) )199 print "expect: %s" % str( c.expect(model) ) 200 200 201 201 # EOF -
branches/UQ/math/legacy/MINMAX_StAlData.py
r585 r687 67 67 def maximize(params,npts,bounds): 68 68 69 from mystic.math.di rac_measure import scenario69 from mystic.math.discrete import scenario 70 70 from numpy import inf 71 71 target,error = params … … 104 104 ##################### begin function-specific ##################### 105 105 # impose norm on the weights of the discrete measures 106 from mystic.math.di rac_measure import norm_wts_constraintsFactory as factory106 from mystic.math.discrete import norm_wts_constraintsFactory as factory 107 107 constrain = factory(npts) 108 108 … … 167 167 nz = 1 #NOTE: SET THE NUMBER OF 'v' POINTS HERE! 168 168 npts = (nx,ny,nz) 169 from mystic.math. paramtransimport _npts169 from mystic.math.distance import _npts 170 170 _n = _npts(npts) 171 171 … … 229 229 230 230 from numpy import array 231 from mystic.math.di rac_measure import scenario231 from mystic.math.discrete import scenario 232 232 c = scenario() 233 233 c.load(solved,npts) -
branches/UQ/math/legacy/MM_OUQ_StAlData.py
r675 r687 75 75 def maximize(params,npts,bounds): 76 76 77 from mystic.math.di rac_measure import scenario77 from mystic.math.discrete import scenario 78 78 from numpy import inf 79 79 target,error = params … … 112 112 ##################### begin function-specific ##################### 113 113 # impose mean on the values of the product measure 114 from mystic.math.di rac_measure import mean_y_norm_wts_constraintsFactory as factory114 from mystic.math.discrete import mean_y_norm_wts_constraintsFactory as factory 115 115 constrain = factory((target[0],error[0]), npts) 116 116 … … 196 196 nz = 2 #NOTE: SET THE NUMBER OF 'v' POINTS HERE! 197 197 npts = (nx,ny,nz) 198 from mystic.math. paramtransimport _npts198 from mystic.math.distance import _npts 199 199 _n = _npts(npts) 200 200 … … 260 260 261 261 from numpy import array 262 from mystic.math.di rac_measure import scenario262 from mystic.math.discrete import scenario 263 263 c = scenario() 264 264 c.load(solved,npts) -
branches/UQ/math/legacy/TEST_OUQ_1dData.py
r585 r687 71 71 def maximize(params,npts,bounds): 72 72 73 from mystic.math.di rac_measure import scenario73 from mystic.math.discrete import scenario 74 74 from numpy import inf 75 75 target,error = params … … 108 108 ##################### begin function-specific ##################### 109 109 # impose mean on the values of the product measure 110 from mystic.math.di rac_measure import mean_y_norm_wts_constraintsFactory as factory110 from mystic.math.discrete import mean_y_norm_wts_constraintsFactory as factory 111 111 constrain = factory((target[0],error[0]), npts) 112 112 … … 192 192 nz = 1 #NOTE: SET THE NUMBER OF 'v' POINTS HERE! 193 193 npts = (nx,ny,nz) 194 from mystic.math. paramtransimport _npts194 from mystic.math.distance import _npts 195 195 _n = _npts(npts) 196 196 … … 256 256 257 257 from numpy import array 258 from mystic.math.di rac_measure import scenario258 from mystic.math.discrete import scenario 259 259 c = scenario() 260 260 c.load(solved,npts) -
branches/UQ/math/legacy/TEST_OUQ_1dSurr_CxCy.py
r588 r687 73 73 def maximize(params,npts,bounds,printmon=None,**kwds): 74 74 75 from mystic.math.di rac_measure import scenario75 from mystic.math.discrete import scenario 76 76 from numpy import inf 77 77 target,error = params … … 110 110 ##################### begin function-specific ##################### 111 111 # impose mean on the values of the product measure 112 from mystic.math.di rac_measure import mean_y_norm_wts_constraintsFactory as factory112 from mystic.math.discrete import mean_y_norm_wts_constraintsFactory as factory 113 113 constrain = factory((target[0],error[0]), npts) 114 114 … … 203 203 nz = 1 #NOTE: SET THE NUMBER OF 'v' POINTS HERE! 204 204 npts = (nx,ny,nz) 205 from mystic.math. paramtransimport _npts205 from mystic.math.distance import _npts 206 206 _n = _npts(npts) 207 207 … … 271 271 272 272 from numpy import array 273 from mystic.math.di rac_measure import scenario273 from mystic.math.discrete import scenario 274 274 c = scenario() 275 275 c.load(solved,npts) … … 294 294 try: _Cx = max(Cx) 295 295 except TypeError: _Cx = Cx 296 from mystic.math. paramtransimport graphical_distance296 from mystic.math.distance import graphical_distance 297 297 Ry = graphical_distance(model, c, ytol=Cy, xtol=Cx, cutoff=0.0, 298 298 imax=0, hausdorff=hausdorff) -
branches/UQ/math/legacy/TEST_OUQ_1dSurr_Cy.py
r586 r687 73 73 def maximize(params,npts,bounds,printmon=None,**kwds): 74 74 75 from mystic.math.di rac_measure import scenario75 from mystic.math.discrete import scenario 76 76 from numpy import inf 77 77 target,error = params … … 110 110 ##################### begin function-specific ##################### 111 111 # impose mean on the values of the product measure 112 from mystic.math.di rac_measure import mean_y_norm_wts_constraintsFactory as factory112 from mystic.math.discrete import mean_y_norm_wts_constraintsFactory as factory 113 113 constrain = factory((target[0],error[0]), npts) 114 114 … … 202 202 nz = 1 #NOTE: SET THE NUMBER OF 'v' POINTS HERE! 203 203 npts = (nx,ny,nz) 204 from mystic.math. paramtransimport _npts204 from mystic.math.distance import _npts 205 205 _n = _npts(npts) 206 206 … … 270 270 271 271 from numpy import array 272 from mystic.math.di rac_measure import scenario272 from mystic.math.discrete import scenario 273 273 c = scenario() 274 274 c.load(solved,npts) … … 292 292 try: _Cx = max(Cx) 293 293 except TypeError: _Cx = Cx 294 from mystic.math. paramtransimport graphical_distance294 from mystic.math.distance import graphical_distance 295 295 Ry = graphical_distance(model, c, ytol=Cy, xtol=Cx, cutoff=0.0, imax=0) 296 296 printmon.info("vertical_distance: %s <= %s" % (Ry, Cy + _Cx)) -
branches/UQ/math/legacy/TEST_OUQ_StAlData.py
r585 r687 71 71 def maximize(params,npts,bounds): 72 72 73 from mystic.math.di rac_measure import scenario73 from mystic.math.discrete import scenario 74 74 from numpy import inf 75 75 target,error = params … … 108 108 ##################### begin function-specific ##################### 109 109 # impose mean on the values of the product measure 110 from mystic.math.di rac_measure import mean_y_norm_wts_constraintsFactory as factory110 from mystic.math.discrete import mean_y_norm_wts_constraintsFactory as factory 111 111 constrain = factory((target[0],error[0]), npts) 112 112 … … 193 193 nz = 2 #NOTE: SET THE NUMBER OF 'v' POINTS HERE! 194 194 npts = (nx,ny,nz) 195 from mystic.math. paramtransimport _npts195 from mystic.math.distance import _npts 196 196 _n = _npts(npts) 197 197 … … 257 257 258 258 from numpy import array 259 from mystic.math.di rac_measure import scenario259 from mystic.math.discrete import scenario 260 260 c = scenario() 261 261 c.load(solved,npts) -
branches/UQ/math/legacy/TEST_OUQ_StStSurr_Cy.py
r585 r687 70 70 def maximize(params,npts,bounds): 71 71 72 from mystic.math.di rac_measure import scenario72 from mystic.math.discrete import scenario 73 73 from numpy import inf 74 74 target,error = params … … 107 107 ##################### begin function-specific ##################### 108 108 # impose mean on the values of the product measure 109 from mystic.math.di rac_measure import mean_y_norm_wts_constraintsFactory as factory109 from mystic.math.discrete import mean_y_norm_wts_constraintsFactory as factory 110 110 constrain = factory((target[0],error[0]), npts) 111 111 … … 194 194 nz = 1 #NOTE: SET THE NUMBER OF 'v' POINTS HERE! 195 195 npts = (nx,ny,nz) 196 from mystic.math. paramtransimport _npts196 from mystic.math.distance import _npts 197 197 _n = _npts(npts) 198 198 … … 257 257 258 258 from numpy import array 259 from mystic.math.di rac_measure import scenario259 from mystic.math.discrete import scenario 260 260 c = scenario() 261 261 c.load(solved,npts) … … 273 273 try: _Cx = max(Cx) 274 274 except TypeError: _Cx = Cx 275 from mystic.math. paramtransimport graphical_distance275 from mystic.math.distance import graphical_distance 276 276 Ry = graphical_distance(model, c, ytol=Cy, xtol=Cx, cutoff=0.0, imax=0) 277 277 print "vertical_distance: %s <= %s" % (Ry, Cy + _Cx) -
branches/UQ/math/legacy/envelope/Looper_BoLiSurr_Cy.py
r675 r687 98 98 def maximize(params,npts,bounds,initial=None,job='',printmon=None): 99 99 100 from mystic.math.di rac_measure import scenario100 from mystic.math.discrete import scenario 101 101 from numpy import inf 102 102 target,error = params … … 140 140 ##################### begin function-specific ##################### 141 141 # impose mean on the values of the product measure 142 from mystic.math.di rac_measure import mean_y_norm_wts_constraintsFactory as factory142 from mystic.math.discrete import mean_y_norm_wts_constraintsFactory as factory 143 143 constrain = factory((target[0],error[0]), npts) 144 144 … … 250 250 251 251 npts = (nx,ny,nz) 252 from mystic.math. paramtransimport _npts252 from mystic.math.distance import _npts 253 253 _n = _npts(npts) 254 254 … … 316 316 317 317 from numpy import array 318 from mystic.math.di rac_measure import scenario318 from mystic.math.discrete import scenario 319 319 c = scenario() 320 320 c.load(solved,npts) … … 333 333 # try: _Cx = max(Cx) 334 334 # except TypeError: _Cx = Cx 335 from mystic.math. paramtransimport graphical_distance335 from mystic.math.distance import graphical_distance 336 336 Ry = graphical_distance(model, c, ytol=Cy, xtol=Cx, cutoff=0.0, \ 337 337 imax=0, ipop=cde, hausdorff=hausdorff) -
branches/UQ/math/legacy/envelope/conf_hausd.py
r592 r687 36 36 37 37 # COMPUTING HAUSDORFF DISTANCES 38 from mystic.math. paramtransimport graphical_distance38 from mystic.math.distance import graphical_distance 39 39 d_hausdorff = graphical_distance(model, d, ytol=0, xtol=(2.5,2.5, 0.0), cutoff=0.0, imax=100, hausdorff=(5.0, 5.0, 0.0, 25.0)) 40 40 if debug: -
branches/UQ/math/legacy/envelope/envelope.py
r675 r687 15 15 debug = False 16 16 17 from mystic.math. paramtransimport infeasibility, _get_xy17 from mystic.math.distance import infeasibility, _get_xy 18 18 19 19 def graphical_distance(model, points, **kwds): -
branches/UQ/math/legacy/envelope/hausdorff.py
r621 r687 19 19 20 20 # build a scenario 21 from mystic.math.di rac_measure import scenario21 from mystic.math.discrete import scenario 22 22 c = scenario() 23 23 c.load(solved, npts) … … 53 53 #""" 54 54 55 #from mystic.math. paramtransimport graphical_distance55 #from mystic.math.distance import graphical_distance 56 56 from envelope import graphical_distance 57 57 from numpy import set_printoptions -
branches/UQ/math/legacy/envelope/sausage.py
r601 r687 18 18 exec("%s = %s" % (str(k),repr(v))) #XXX: HACK 19 19 20 from mystic.math.di rac_measure import scenario20 from mystic.math.discrete import scenario 21 21 c = scenario() 22 22 c.load(params, pts) … … 28 28 yo = asarray(c.values) 29 29 30 from mystic.math.di rac_measure import impose_valid30 from mystic.math.discrete import impose_valid 31 31 32 32 # fixed x values as bounds -
branches/UQ/math/legacy/test_ExampleDataset.py
r569 r687 31 31 32 32 # Check shortness 33 from mystic.math. paramtransimport lipschitz_distance, graphical_distance33 from mystic.math.distance import lipschitz_distance, graphical_distance 34 34 print("\nshort: %s" % ex1d_data.short()) 35 35 L = ex1d_data.lipschitz; -
branches/UQ/math/legacy/test_StAlDataset.py
r569 r687 21 21 22 22 # Check shortness 23 from mystic.math. paramtransimport lipschitz_distance, graphical_distance23 from mystic.math.distance import lipschitz_distance, graphical_distance 24 24 print("\nshort: %s" % st_al_data.short()) 25 25 L = st_al_data.lipschitz; -
branches/UQ/math/legacy/test_graph_dist.py
r588 r687 33 33 for i in d: print i 34 34 35 from mystic.math. paramtransimport graphical_distance35 from mystic.math.distance import graphical_distance 36 36 from numpy import set_printoptions 37 37 set_printoptions(suppress=True) -
branches/UQ/math/sausage/TEST_OUQ_1dSurr_diam.py
r588 r687 72 72 def maximize(params,npts,bounds): 73 73 74 from mystic.math.di rac_measure import scenario74 from mystic.math.discrete import scenario 75 75 from mystic.math import almostEqual 76 76 from numpy import inf … … 189 189 nz = 1 #NOTE: SET THE NUMBER OF 'v' POINTS HERE! 190 190 npts = (nx,ny,nz) 191 from mystic.math. paramtransimport _npts191 from mystic.math.distance import _npts 192 192 _n = _npts(npts) 193 193 … … 253 253 254 254 from numpy import array 255 from mystic.math.di rac_measure import scenario255 from mystic.math.discrete import scenario 256 256 c = scenario() 257 257 c.load(solved,npts) -
branches/UQ/math/sausage/TEST_OUQ_StStSurr.py
r588 r687 71 71 def maximize(params,npts,bounds): 72 72 73 from mystic.math.di rac_measure import scenario73 from mystic.math.discrete import scenario 74 74 from mystic.math import almostEqual 75 75 from numpy import inf … … 201 201 nz = 1 #NOTE: SET THE NUMBER OF 'v' POINTS HERE! 202 202 npts = (nx,ny,nz) 203 from mystic.math. paramtransimport _npts203 from mystic.math.distance import _npts 204 204 _n = _npts(npts) 205 205 … … 265 265 266 266 from numpy import array 267 from mystic.math.di rac_measure import scenario267 from mystic.math.discrete import scenario 268 268 c = scenario() 269 269 c.load(solved,npts) -
branches/collapse/TEST_OUQ_surrogate_diam_collapse.py
r576 r687 58 58 59 59 from mystic.math.measures import split_param 60 from mystic.math.di rac_measure import product_measure60 from mystic.math.discrete import product_measure 61 61 from mystic.math import almostEqual 62 62 from numpy import inf … … 84 84 # impose expectation on product measure 85 85 ##################### begin function-specific ##################### 86 E = float(c. get_expect(model))86 E = float(c.expect(model)) 87 87 if not (E <= float(target[0] + error[0])) \ 88 88 or not (float(target[0] - error[0]) <= E): … … 96 96 c = product_measure() 97 97 c.load(rv, npts) 98 E = float(c. get_expect(model))98 E = float(c.expect(model)) 99 99 if E > (target[0] + error[0]) or E < (target[0] - error[0]): 100 100 if debug: print "skipping expect: %s" % E … … 188 188 189 189 from numpy import array 190 from mystic.math.di rac_measure import product_measure190 from mystic.math.discrete import product_measure 191 191 c = product_measure() 192 192 c.load(solved,npts) … … 195 195 print "solved: [wz,z]\n%s" % array(zip(c[2].weights,c[2].coords)) 196 196 197 print "expect: %s" % str( c. get_expect(model) )197 print "expect: %s" % str( c.expect(model) ) 198 198 199 199 elapsed = (clock() - start) -
branches/collapse/collapse_code.py
r576 r687 37 37 38 38 def _set_weight_to_zero(rv, npts, axisW, indexW): 39 from mystic.math.di rac_measure import product_measure39 from mystic.math.discrete import product_measure 40 40 c = product_measure() 41 41 c.load(rv, npts) … … 44 44 45 45 def _set_same_positions(rv, npts, axisP, index1, index2): 46 from mystic.math.di rac_measure import product_measure46 from mystic.math.discrete import product_measure 47 47 c = product_measure() 48 48 c.load(rv, npts)
Note: See TracChangeset
for help on using the changeset viewer.