tadd general histograms with quartiles - cosmo - front and backend for Markov-Chain Monte Carlo inversion of cosmogenic nuclide concentrations
git clone git://src.adamsgaard.dk/cosmo
Log
Files
Refs
README
LICENSE
---
commit dab7ed7cd53163e444bc2f8d5310ac1b4a2b36d3
parent 6728f85140437a9c1e2020adbc0d5899e748655d
Author: Anders Damsgaard 
Date:   Mon,  9 Nov 2015 13:56:15 +0100

add general histograms with quartiles

Diffstat:
  M index.php                           |      40 +++++++++++++++++++++++++++++++
  M matlab/generate_plots.m             |      20 +++++++++++++++++---

2 files changed, 57 insertions(+), 3 deletions(-)
---
diff --git a/index.php b/index.php
t@@ -76,6 +76,46 @@ if (isset($_GET['wait_id']) && !empty($_GET['wait_id'])) {
                 
+ + Generalized model parameter values +
+
+

The histograms show the distribution of (a) + interglacial erosion rate, (b) glacial erosion rate, (c) + timing of last deglaciation, and (d) + d18Othreshold levels that provide + the best fit to the supplied TCN concentrations. + The vertical axis indicates the number of + simulations included in each bin out of the 10,000 + simulations that followed the MCMC burn-in phase from each + MCMC walker. The solid magenta lines denote the median + values (second quartile), while the dashed magenta lines + denote the lower and upper quartiles (25th and 75th + percentiles, respectively).

+
+ +
+ + + + +
+ +
+
+
+ Model parameter values per inversion walker
diff --git a/matlab/generate_plots.m b/matlab/generate_plots.m
t@@ -210,7 +210,7 @@ for i1 = 1:M % for each model parameter
     subplot(M,Nwalkers,isub)
     %Nhistc=histc(Ss{iwalk}.ms(i1,:),xbins{i1});
     %bar(xbins{i1},Nhistc,'histc')
-    histogram(Ss{iwalk}.ms(i1,:), xbins{i1}, 'Normalization', 'probability');
+    histogram(Ss{iwalk}.ms(i1,:), xbins{i1});
     
     if i1 == 1
         title(['MCMC walker ' num2str(iwalk)])
t@@ -329,12 +329,26 @@ for i1 = 1:M % for each model parameter
     for iwalker=1:Nwalkers
         data = [data, Ss{iwalker}.ms(i1,:)];
     end
-    Nhistc=histc(data, xbins{i1});
-    bar(xbins{i1},Nhistc,'histc')
+    
+    hold on
+    %Nhistc=histc(data, xbins{i1});
+    %bar(xbins{i1},Nhistc,'histc')
+    histogram(data, xbins{i1});
 
+    % 2nd quartile = median = 50th percentile
     med = median(data);
     plot([med, med], get(gca,'YLim'), 'm-')
     
+    % 1st quartile = 25th percentile
+    prctile25 = prctile(data, 25);
+    plot([prctile25, prctile25], get(gca,'YLim'), 'm--')
+    
+    % 3rd quartile = 75th percentile
+    prctile75 = prctile(data, 75);
+    plot([prctile75, prctile75], get(gca,'YLim'), 'm--')
+    
+    hold off
+    
     if i1 == 1
         xlabel('Interglacial erosion rate [mm/yr]')
         text(0.02,0.98,'a', 'Units', ...