def pmin_sampled(mean, var, n_samples=1000, rng=None):
 if (rng is None):
  rng = numpy.random.RandomState(232342)
 samples = ((rng.randn(n_samples, len(mean)) * numpy.sqrt(var)) + mean)
 winners = (samples.T == samples.min(axis=1)).T
 wincounts = winners.sum(axis=0)
 assert (wincounts.shape == mean.shape)
 return old_div(wincounts.astype('float64'), wincounts.sum())

def pmin_sampled ( mean , var , n_samples = 1000 , rng = None ) : if ( rng is None ) : rng = numpy . random . RandomState ( 232342 ) samples = ( ( rng . randn ( n_samples , len ( mean ) ) * numpy . sqrt ( var ) ) + mean ) winners = ( samples . T == samples . min ( axis = 1 ) ) . T wincounts = winners . sum ( axis = 0 ) assert ( wincounts . shape == mean . shape ) return old_div ( wincounts . astype ( 'float64' ) , wincounts . sum ( ) )
probability that each gaussian-dist r .