Exemplo n.º 1
0
    def __str__(self):
        # # Plot marginals
        # for item in self.p.params:
        #     plot.marginal_plot(item, path=self.working_path)
        #
        # # Plot joints
        # for item in self.p.margin_ax:
        #     plot.plot_joint(self, self.p.params[item[0]], self.p.params[item[1]])

        # fullplot
        print(("Reconstructed likelihood shape before plot: ",
               self.likelihood.shape))
        plot.fullplot(self)

        return "Plot Done!\n" \
               "(fitted_sigma, fit_err, relative_deviation, acc, sharper, broader)\n" + str(self.analyse_result())\
               + "\n KLD: " + str(self.KL)
Exemplo n.º 2
0
        inference.run_sim(multi_comp, noise_sigma)

    inference.run_evaluation()

    # Do statistics for the current inference
    Ra_stat[i, 0], Ra_stat[i, 1], Ra_stat[i, 2], Ra_stat[
        i, 3], Ra_stat[4], Ra_stat[5] = stat(Ra)
    gpas_stat[i, 0], gpas_stat[i, 1], gpas_stat[i, 2], gpas_stat[
        i, 3], gpas_stat[4], gpas_stat[5] = stat(gpas)
    cm_stat[i, 0], cm_stat[i, 1], cm_stat[i, 2], cm_stat[
        i, 3], cm_stat[4], cm_stat[5] = stat(cm)

    # Plot some single joint distribution
    if i == num_of_iter - 1:
        print(inference)
        fullplot(inference)
        plot_joint(inference, Ra, gpas)
        plot_joint(inference, Ra, cm)
        plot_joint(inference, cm, gpas)

    print("\n\n")

runningTime = (time.time() - startTime) / 60
lasted = "The Ra-gpas-cm ball-and-stick simulation was running for %f minutes\n" % runningTime
configuration = "--\n"
setup1 = 'Multi compartment simulation; White noise sigma=7; ramp stimulus; Ra parameter; dt=0.1\n'
setup2 = 'Multi compartment simulation; White noise sigma=7; ramp stimulus; gpas parameter; dt=0.1\n'
setup3 = 'Multi compartment simulation; White noise sigma=7; ramp stimulus; cm parameter; dt=0.1\n'
header1 = "Number of simulations: " + str(
    num_of_iter) + '\n' + setup1 + configuration + lasted
header2 = "Number of simulations: " + str(
Exemplo n.º 3
0

if __name__ == "__main__":
    # load_statistics(50, ["Ra", "cm", "gpas"], "/Users/Dani/TDK/parameter_estim/stim_protocol2/ramp/loglikelihood",
    #                "/Users/Dani/TDK/parameter_estim/stim_protocol2/ramp")

    cm = np.loadtxt(
        "/Users/Dani/TDK/parameter_estim/stim_protocol2/zap/100/loglikelihood/cm(0).txt",
        dtype=str)
    gpas = np.loadtxt(
        "/Users/Dani/TDK/parameter_estim/stim_protocol2/zap/100/loglikelihood/gpas(0).txt",
        dtype=str)
    Ra = np.loadtxt(
        "/Users/Dani/TDK/parameter_estim/stim_protocol2/zap/100/loglikelihood/Ra(0).txt",
        dtype=str)
    ll = np.loadtxt(
        "/Users/Dani/TDK/parameter_estim/stim_protocol2/zap/100/loglikelihood/loglikelihood(0).txt"
    )

    inf = load_inference(
        ll, "/Users/Dani/TDK/parameter_estim/stim_protocol2/zap/100", Ra, cm,
        gpas)
    inf.run_evaluation()
    print(inf)
    from module.plot import fullplot, plot_joint

    plot_joint(inf, inf.p.params[0], inf.p.params[1])
    plot_joint(inf, inf.p.params[0], inf.p.params[2])
    plot_joint(inf, inf.p.params[1], inf.p.params[2])
    fullplot(inf)