Beispiel #1
0
    def __repr__(self):

        d = {
            "01. Sampling module": self.sampling_module,
            "02. Sampler": self.sampler,
            "03. Number of samples": self.n_samples,
            "04. Number of output parameters": self.n_outputs,
            "05. Samples' shape": self.shape,
        }
        return formal_repr(self, d) + "\n06. Distribution parameters: " + dict_str(self.params) + \
                                      "\n07 Resulting statistics: " + dict_str(self.stats)
Beispiel #2
0
    def __repr__(self):

        d = {
            "01. Sampling module": self.sampling_module,
            "02. Sampler": self.sampler,
            "03. Number of samples": self.n_samples,
            "04. Number of output parameters": self.n_outputs,
            "05. Samples' shape": self.shape,
            "06. Random seed": self.random_seed,
        }
        return formal_repr(self, d) + \
        "\n07. Distribution parameters: " + dict_str(self.params) + \
        "\n08. Truncation limits: " + str([dict_str(d) for d in dicts_of_lists_to_lists_of_dicts(self.trunc_limits)]) + \
        "\n08. Resulting statistics: " + dict_str(self.stats)
    def __repr__(self):

        d = {
            "01. Method": self.method,
            "02. Second order calculation flag": self.calc_second_order,
            "03. Confidence level": self.conf_level,
            "05. Number of inputs": self.n_inputs,
            "06. Number of outputs": self.n_outputs,
            "07. Input names": self.input_names,
            "08. Output names": self.output_names,
            "09. Input bounds": self.input_bounds,
            "10. Problem": dict_str(self.problem),
            "11. Other parameters": dict_str(self.other_parameters),
        }
        return formal_repr(self, d)
Beispiel #4
0
            mu = 0.25
            std = 0.5
        elif distribution == "beta":
            mu = 0.5
            std = 0.25
        elif distribution == "binomial":
            mu = 1.0
            std = 1.0 / np.sqrt(2)
        elif distribution == "chisquare":
            mu = 1.0
            std = np.sqrt(2 * mu)
        else:
            mu = 0.5
            std = 0.5

        logger.info(dict_str({"mu": mu, "std": std}))

        p = mean_std_to_distribution_params(distribution, mu=mu, std=std)

        logger.info(str(p))

        logger.info("\nDistribution " + distribution + " to mu, std:")

        mu1, std1 = distribution_params_to_mean_std(distribution, **p)

        logger.info(dict_str({"mu": mu, "std": std}))

        if np.abs(mu - mu1) > 10**-6 or np.abs(std - std1) > 10**-6:
            raise ValueError("mu - mu1 = " + str(mu - mu1) + "std - std1 = " +
                             str(std - std1))
Beispiel #5
0
        if distribution == "poisson":
            mu = 0.25
            std = 0.5
        elif distribution == "beta":
            mu = 0.5
            std = 0.25
        elif distribution == "binomial":
            mu = 1.0
            std = 1.0 / np.sqrt(2)
        elif distribution == "chisquare":
            mu = 1.0
            std = np.sqrt(2 * mu)
        else:
            mu = 0.5
            std = 0.5

        LOG.info(dict_str({"mu": mu, "std": std}))

        p = mean_std_to_distribution_params(distribution, mu=mu, std=std)

        LOG.info(str(p))

        LOG.info("\nDistribution " + distribution + " to mu, std:")

        mu1, std1 = distribution_params_to_mean_std(distribution, **p)

        LOG.info(dict_str({"mu": mu, "std": std}))

        if np.abs(mu - mu1) > 10**-6 or np.abs(std - std1) > 10**-6:
            raise ValueError("mu - mu1 = " + str(mu - mu1) + "std - std1 = " +
                             str(std - std1))