def plot_diagnostic(self, which):
f_n = self.var_review.get()
sol = self.all_results[f_n]["sol"]
try:
if which == "traces":
trace_plot = sol.plot_traces(save=False)
self.plot_window(trace_plot, "Parameter traces: "+f_n)
if which == "histo":
histo_plot = sol.plot_histograms(save=False)
self.plot_window(histo_plot, "Parameter histograms: "+f_n)
if which == "autocorr":
autocorr_plot = sol.plot_autocorrelation(save=False)
self.plot_window(autocorr_plot, "Parameter autocorrelation: "+f_n)
if which == "geweke":
geweke_plot = sol.plot_scores(save=False)
self.plot_window(geweke_plot, "Geweke scores: "+f_n)
if which == "summary":
summa_plot = sol.plot_summary(save=False)
self.plot_window(summa_plot, "Parameter summary: "+f_n)
if which == "deviance":
devi_plot = sol.plot_model_deviance(save=False)
self.plot_window(devi_plot, "Model deviance: "+f_n)
if which == "logp":
logp_plot = sol.plot_log_likelihood(save=False)
self.plot_window(logp_plot, "Log-likelihood: "+f_n)
if which == "hexbin":
try: self.top_bivar.destroy()
except: pass
hex_plot = sol.plot_hexbin(self.biv1.get(), self.biv2.get(), save=False)
self.plot_window(hex_plot, "Hexagonal binning: "+f_n)
if which == "KDE":
try: self.top_bivar.destroy()
except: pass
kde_plot = sol.plot_KDE(self.biv1.get(), self.biv2.get(), save=False)
self.plot_window(kde_plot, "Bivariate KDE: "+f_n)
stdout.flush()
except:
tkinter.messagebox.showwarning("Error analyzing results", "Error\nProblem with inversion results\nTry adding iterations",
parent=self.master)
评论列表
文章目录