<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://eclr.humanities.manchester.ac.uk/index.php?action=history&amp;feed=atom&amp;title=Bayes</id>
		<title>Bayes - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://eclr.humanities.manchester.ac.uk/index.php?action=history&amp;feed=atom&amp;title=Bayes"/>
		<link rel="alternate" type="text/html" href="http://eclr.humanities.manchester.ac.uk/index.php?title=Bayes&amp;action=history"/>
		<updated>2026-05-05T15:00:52Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.30.1</generator>

	<entry>
		<id>http://eclr.humanities.manchester.ac.uk/index.php?title=Bayes&amp;diff=3597&amp;oldid=prev</id>
		<title>Rb: /* Problem Setup */</title>
		<link rel="alternate" type="text/html" href="http://eclr.humanities.manchester.ac.uk/index.php?title=Bayes&amp;diff=3597&amp;oldid=prev"/>
				<updated>2015-01-26T21:31:05Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Problem Setup&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 21:31, 26 January 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l121&quot; &gt;Line 121:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 121:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;disp(&amp;#039;P(p&amp;gt;0.5)&amp;#039;);&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;disp(&amp;#039;P(p&amp;gt;0.5)&amp;#039;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;disp(sum(fp_post3(51:end)));&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;disp(sum(fp_post3(51:end)));&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[http://research.stlouisfed.org/wp/2011/2011-025.pdf 2011-025B]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;A significant part of this paper buids on a previous survey paper:&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;West, K.W. (2006) Forecast Evaluation, in: Handbook of Economic Forecasting, Volume 1, edited by G. Elliott, C. W.J. Granger, A. G. Timmermann&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;A review of the uses and abuses of the Diebold-Mariano Test has recently been provided by the man himself, [http://www.ssc.upenn.edu/~fdiebold/papers/paper113/Diebold_DM%20Test.pdf Francis Diebold].&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Rb</name></author>	</entry>

	<entry>
		<id>http://eclr.humanities.manchester.ac.uk/index.php?title=Bayes&amp;diff=3378&amp;oldid=prev</id>
		<title>Rb: /* Problem Setup */</title>
		<link rel="alternate" type="text/html" href="http://eclr.humanities.manchester.ac.uk/index.php?title=Bayes&amp;diff=3378&amp;oldid=prev"/>
				<updated>2014-12-07T20:06:01Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Problem Setup&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 20:06, 7 December 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l7&quot; &gt;Line 7:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In fact estimating a proportion is about the simplest problem you can tackle in the Bayesian estimation framework, but it makes the workings very obvious.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In fact estimating a proportion is about the simplest problem you can tackle in the Bayesian estimation framework, but it makes the workings very obvious.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The data used in the example can be downloaded from here: &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[&lt;/del&gt;[[media: HadCRUT4-gl.xlsx&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;]&lt;/del&gt;|&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[media: &lt;/del&gt;HadCRUT4-gl.xlsx&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;]&lt;/del&gt;]].&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The data used in the example can be downloaded from here: &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/ins&gt;[[media:HadCRUT4-gl.xlsx|HadCRUT4-gl.xlsx]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;At this stage you will have to use the comments in the code for explanations.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;At this stage you will have to use the comments in the code for explanations.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Rb</name></author>	</entry>

	<entry>
		<id>http://eclr.humanities.manchester.ac.uk/index.php?title=Bayes&amp;diff=3375&amp;oldid=prev</id>
		<title>Rb: Created page with &quot;= Problem Setup =  This section is yet to be written, but you could check out this [http://youtu.be/8QxiZY-MaGA YouTube clip] I produced to illustrate how a Bayesian Estimatio...&quot;</title>
		<link rel="alternate" type="text/html" href="http://eclr.humanities.manchester.ac.uk/index.php?title=Bayes&amp;diff=3375&amp;oldid=prev"/>
				<updated>2014-12-07T20:02:01Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;= Problem Setup =  This section is yet to be written, but you could check out this [http://youtu.be/8QxiZY-MaGA YouTube clip] I produced to illustrate how a Bayesian Estimatio...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Problem Setup =&lt;br /&gt;
&lt;br /&gt;
This section is yet to be written, but you could check out this [http://youtu.be/8QxiZY-MaGA YouTube clip] I produced to illustrate how a Bayesian Estimation of a proportion would work.&lt;br /&gt;
&lt;br /&gt;
The problem is to estimate the proportion of years in which the average global temperature increases. This is a slightly odd way to check whether there is a detectable global temperature trend, although there surely may be better ways to do this. But it is a nice example to illustrate how Bayesian estimation works.&lt;br /&gt;
&lt;br /&gt;
In fact estimating a proportion is about the simplest problem you can tackle in the Bayesian estimation framework, but it makes the workings very obvious.&lt;br /&gt;
&lt;br /&gt;
The data used in the example can be downloaded from here: [[[media: HadCRUT4-gl.xlsx]|[media: HadCRUT4-gl.xlsx]]].&lt;br /&gt;
&lt;br /&gt;
At this stage you will have to use the comments in the code for explanations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source&amp;gt;% Example: using HadCRUT4-gl.xlsx global temperature anomaly data&lt;br /&gt;
&lt;br /&gt;
% Estimate the following parameter: p, probability of an upward trend&lt;br /&gt;
&lt;br /&gt;
% For Bayesian Reasoning we need to start with a prior probability&lt;br /&gt;
% distribution: define p as the probability of having an up-tick&lt;br /&gt;
% We now need to specify a distribution for p, say f(p) = 1/101&lt;br /&gt;
% when we treat p as a discrete distribution that can take values&lt;br /&gt;
% of p = 0.00,0.01,0.02,...,1.00&lt;br /&gt;
&lt;br /&gt;
clc;&lt;br /&gt;
clear all;&lt;br /&gt;
&lt;br /&gt;
pval = (0:0.01:1)&amp;#039;; % values of p at which to evaluate probabilities&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%% load global temperature data&lt;br /&gt;
data = xlsread(&amp;#039;HadCRUT4-gl.xlsx&amp;#039;);&lt;br /&gt;
years = data(1:164,1);              % extract the years for which we have data&lt;br /&gt;
temp = data(1:164,2);               % extract the temperature data&lt;br /&gt;
diff = temp(2:end)-temp(1:end-1);   % calculate the change in temperature&lt;br /&gt;
ups = (diff&amp;gt;0);                     % dummy variable 1 if diff &amp;gt; 0, 0 otherwise&lt;br /&gt;
% ups = ups(124:end);                 % Select data from 1973 onwards only&lt;br /&gt;
n = size(ups,1);                    % number of observations&lt;br /&gt;
&lt;br /&gt;
plot(years,temp);&lt;br /&gt;
title(&amp;#039;Global Temperature Anamoly&amp;#039;);&lt;br /&gt;
%% Frequentist approach&lt;br /&gt;
&lt;br /&gt;
pbar = mean(ups);&lt;br /&gt;
sd_pbar = sqrt(pbar*(1-pbar)/n);&lt;br /&gt;
&lt;br /&gt;
%% Bayesian Updating&lt;br /&gt;
&lt;br /&gt;
% Prior 1: Normal (m1,sd1^2)&lt;br /&gt;
m1 = 0.5;&lt;br /&gt;
sd1 = 0.05;&lt;br /&gt;
fp_prior1 = normcdf(pval+0.005,m1,sd1);   % continuous&lt;br /&gt;
fp_prior1 = [0;fp_prior1(2:end)-fp_prior1(1:end-1)];   % discretised&lt;br /&gt;
&lt;br /&gt;
% Prior 2: Normal (m2,sd2^2)&lt;br /&gt;
m2 = 0.6;&lt;br /&gt;
sd2 = 0.05;&lt;br /&gt;
fp_prior2 = normcdf(pval+0.005,m2,sd2);   % continuous&lt;br /&gt;
fp_prior2 = [0;fp_prior2(2:end)-fp_prior2(1:end-1)];   % discretised&lt;br /&gt;
&lt;br /&gt;
% Prior 3: Uniform&lt;br /&gt;
fp_prior3 = ones(size(pval)).*(1/size(pval,1));&lt;br /&gt;
&lt;br /&gt;
subplot(2,1,1)&lt;br /&gt;
plot(pval,[fp_prior1 fp_prior2 fp_prior3]);&lt;br /&gt;
title(&amp;#039;Prior Distributions&amp;#039;);&lt;br /&gt;
axis([0 1 0 0.15]);&lt;br /&gt;
subplot(2,1,2)&lt;br /&gt;
% Let&amp;#039;s say we have a year with temp increase, then the probability at each pval, pval(i),&lt;br /&gt;
% is updated as follows&lt;br /&gt;
% P(pval(i)|up) = P(pval(i) and up)/P(up) = fp_prior(i)*pval(i)/P(up)&lt;br /&gt;
% where p(up) = sum over all j(fp_prior(j)*pval(j))&lt;br /&gt;
&lt;br /&gt;
for sim = 1:n&lt;br /&gt;
&lt;br /&gt;
    % Prior 1&lt;br /&gt;
    P_joint1 = fp_prior1.*pval.*ups(sim) + fp_prior1.*(1-pval).*(1-ups(sim));&lt;br /&gt;
    P_tick1  = sum(P_joint1);&lt;br /&gt;
    fp_post1 = P_joint1./P_tick1;   % this scales all probs such that they sum to 1&lt;br /&gt;
    bar(pval,fp_post1,&amp;#039;blue&amp;#039;);&lt;br /&gt;
    axis([0 1 0 0.15]);&lt;br /&gt;
    hold on&lt;br /&gt;
    fp_prior1 = fp_post1;&lt;br /&gt;
&lt;br /&gt;
    % Prior 2&lt;br /&gt;
    P_joint2 = fp_prior2.*pval.*ups(sim) + fp_prior2.*(1-pval).*(1-ups(sim));&lt;br /&gt;
    P_tick2  = sum(P_joint2);&lt;br /&gt;
    fp_post2 = P_joint2./P_tick2;   % this scales all probs such that they sum to 1&lt;br /&gt;
    bar(pval,fp_post2,&amp;#039;green&amp;#039;);&lt;br /&gt;
    axis([0 1 0 0.15]);&lt;br /&gt;
    hold on&lt;br /&gt;
    fp_prior2 = fp_post2;&lt;br /&gt;
&lt;br /&gt;
    % Prior 3&lt;br /&gt;
    P_joint3 = fp_prior3.*pval.*ups(sim) + fp_prior3.*(1-pval).*(1-ups(sim));&lt;br /&gt;
    P_tick3  = sum(P_joint3);&lt;br /&gt;
    fp_post3 = P_joint3./P_tick3;   % this scales all probs such that they sum to 1&lt;br /&gt;
    bar(pval,fp_post3,&amp;#039;red&amp;#039;);&lt;br /&gt;
    axis([0 1 0 0.15]);&lt;br /&gt;
    fp_prior3 = fp_post3;&lt;br /&gt;
&lt;br /&gt;
    title(&amp;#039;Posterior Distributions&amp;#039;);&lt;br /&gt;
    hold off;&lt;br /&gt;
&lt;br /&gt;
    if sim &amp;lt; 20;&lt;br /&gt;
&lt;br /&gt;
        pause(0.5);&lt;br /&gt;
    else&lt;br /&gt;
        pause(0.0003);&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
disp(&amp;#039;Bayes 1&amp;#039;);&lt;br /&gt;
disp(&amp;#039;P(p&amp;gt;0.5)&amp;#039;);&lt;br /&gt;
disp(sum(fp_post1(51:end)));&lt;br /&gt;
disp(&amp;#039;&amp;#039;);&lt;br /&gt;
disp(&amp;#039;Bayes 2&amp;#039;);&lt;br /&gt;
disp(&amp;#039;P(p&amp;gt;0.5)&amp;#039;);&lt;br /&gt;
disp(sum(fp_post2(51:end)));&lt;br /&gt;
disp(&amp;#039;&amp;#039;);&lt;br /&gt;
disp(&amp;#039;Bayes 3&amp;#039;);&lt;br /&gt;
disp(&amp;#039;P(p&amp;gt;0.5)&amp;#039;);&lt;br /&gt;
disp(sum(fp_post3(51:end)));&amp;lt;/source&amp;gt;&lt;br /&gt;
[http://research.stlouisfed.org/wp/2011/2011-025.pdf 2011-025B]&lt;br /&gt;
&lt;br /&gt;
A significant part of this paper buids on a previous survey paper:&lt;br /&gt;
&lt;br /&gt;
West, K.W. (2006) Forecast Evaluation, in: Handbook of Economic Forecasting, Volume 1, edited by G. Elliott, C. W.J. Granger, A. G. Timmermann&lt;br /&gt;
&lt;br /&gt;
A review of the uses and abuses of the Diebold-Mariano Test has recently been provided by the man himself, [http://www.ssc.upenn.edu/~fdiebold/papers/paper113/Diebold_DM%20Test.pdf Francis Diebold].&lt;/div&gt;</summary>
		<author><name>Rb</name></author>	</entry>

	</feed>