def setUp(self): """ Set up problem. """ if isinstance(self.data, samp.sample_set_base): if self.data._reference_value is not None: Q_ref = None else: Q_ref = self.Q_ref else: Q_ref = self.Q_ref self.data_prob = sFun.uniform_partition_uniform_distribution_rectangle_scaled( self.data, Q_ref, rect_scale=0.1, M=67, num_d_emulate=1E3) self.d_distr_samples = self.data_prob.get_values() self.rho_D_M = self.data_prob.get_probabilities() if type(self.Q_ref) != np.array: self.Q_ref = np.array([self.Q_ref]) if len(self.data_domain.shape) == 1: self.data_domain = np.expand_dims(self.data_domain, axis=0) self.rect_domain = np.zeros((self.data_domain.shape[0], 2)) r_width = 0.1*self.data_domain[:, 1] self.rect_domain[:, 0] = self.Q_ref - .5*r_width self.rect_domain[:, 1] = self.Q_ref + .5*r_width
''' Suggested changes for user: Try different ways of discretizing the probability measure on D defined as a uniform probability measure on a rectangle (since D is 2-dimensional) centered at Q_ref whose size is determined by scaling the circumscribing box of D. ''' randomDataDiscretization = False if randomDataDiscretization is False: simpleFunP.regular_partition_uniform_distribution_rectangle_scaled( data_set=my_discretization, Q_ref=Q_ref, rect_scale=0.25, cells_per_dimension = 3) else: simpleFunP.uniform_partition_uniform_distribution_rectangle_scaled( data_set=my_discretization, Q_ref=Q_ref, rect_scale=0.25, M=50, num_d_emulate=1E5) # calculate probablities calculateP.prob(my_discretization) ######################################## # Post-process the results ######################################## ''' Suggested changes for user: At this point, the only thing that should change in the plotP.* inputs should be either the nbins values or sigma (which influences the kernel density estimation with smaller values implying a density estimate that looks more like a histogram and larger values smoothing out the values
Try different ways of discretizing the probability measure on D defined as a uniform probability measure on a rectangle or interval depending on choice of QoI_num in myModel.py. ''' randomDataDiscretization = False if randomDataDiscretization is False: simpleFunP.regular_partition_uniform_distribution_rectangle_scaled( data_set=my_discretization, Q_ref=Q_ref, rect_scale=0.25, cells_per_dimension=3) else: simpleFunP.uniform_partition_uniform_distribution_rectangle_scaled( data_set=my_discretization, Q_ref=Q_ref, rect_scale=0.25, M=50, num_d_emulate=1E5) # calculate probabilities calculateP.prob(my_discretization) ######################################## # Post-process the results ######################################## ''' Suggested changes for user: At this point, the only thing that should change in the plotP.* inputs should be either the nbins values or sigma (which influences the kernel density estimation with smaller values implying a density estimate that