From 13e8a3413a484acd06ed02f850b69daa696f6f76 Mon Sep 17 00:00:00 2001 From: Peter Carbonetto Date: Fri, 26 Aug 2016 13:52:24 -0500 Subject: [PATCH] Added a script to generate plots for example4.m without the statistics toolbox. --- examples/example3_plots.m | 9 +++++---- examples/example4_plots.m | 29 +++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 examples/example4_plots.m diff --git a/examples/example3_plots.m b/examples/example3_plots.m index 9357b9f..d9b0f1c 100644 --- a/examples/example3_plots.m +++ b/examples/example3_plots.m @@ -1,7 +1,8 @@ -% Note: Only works in MATLAB 2014a or later since "histogram" function -% was introduced in that version of MATLAB. -se1=matfile('example3_se1.mat'); -se2=matfile('example3_se2.mat'); +% Run this script after example3.m. Note: This script only works in MATLAB +% 2014a or later since "histogram" function was introduced in that version +% of MATLAB. +se1 = matfile('example3_se1.mat'); +se2 = matfile('example3_se2.mat'); figure(1); subplot(2,2,1); diff --git a/examples/example4_plots.m b/examples/example4_plots.m new file mode 100644 index 0000000..995410f --- /dev/null +++ b/examples/example4_plots.m @@ -0,0 +1,29 @@ +% Run this script after running example4.m. +load('example4-theta04-theta2-100trials.mat'); + +figure(1); +clf; +subplot(2,2,1); +bplot([alpha_n_diff mu_n_diff s_n_diff]); +set(gca,'YLim',[0 0.002]); +set(gca,'XTick',1:3,'XTickLabel',{'\alpha','\mu','s'},'FontSize',14); +ylabel('maximum absolute difference'); +title('Null models'); + +subplot(2,2,2); +bplot([alpha_e_diff mu_e_diff s_e_diff]) +set(gca,'YLim',[0 0.002]); +set(gca,'XTick',1:3,'XTickLabel',{'\alpha','\mu','s'},'FontSize',14); +ylabel('maximum absolute difference'); +title('Enrichment models'); + +subplot(2,2,3); +scatter(log10(bf(:, 1)), log10(bf(:, 2)),'b','*'); +hold on +plot([-5 30],[-5 30],'-','Color','red'); +hold off +% ozline = refline([1 0]); +% ozline.Color = 'r'; +xlabel('Log10 Bayes factors from VARBVS','Interpreter','none'); +ylabel('Log10 Bayes factors from RSS-VARBVSR','Interpreter','none'); +title('');