<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://evolutionandgames.nl/wiki/skins/common/feed.css?207"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>Evolution and Games - User contributions [en]</title>
		<link>http://evolutionandgames.nl/wiki/index.php?title=Special:Contributions/Matthijs.van.veelen</link>
		<description>From Evolution and Games</description>
		<language>en</language>
		<generator>MediaWiki 1.15.3</generator>
		<lastBuildDate>Thu, 22 Oct 2026 11:29:59 GMT</lastBuildDate>
		<item>
			<title>Price</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* Extra links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Evolution is all about transitions. One generation gives birth to the next, which gives birth to yet another generation, in an endless chain of transitions. These transitions don't just go anywhere; some transitions are more likely than others. First of all we beget offspring that is likely to bear some similarity with ourselves.  And how likely we are to get offspring at all, and how many, tends to depend on certain heritable characteristics. The relative likelihood of some transitions and the relative improbability of others imply that we can make informed guesses as to where this endless chain of transitions came from and where it is going. &lt;br /&gt;
&lt;br /&gt;
The Price equation zooms in on transitions from one generation to the next. This suggests that it could be a fundamental tool for understanding this&lt;br /&gt;
process of evolution. It was formulated by George Richard Price in 1970 [http://www.nature.com/nature/journal/v227/n5257/abs/227520a0.html in an article in Nature], and acclaimed by some, maybe even quite a few, to be a fundamental ingredient for models of evolution ([http://dx.doi.org/10.1016/j.cub.2008.01.005 Gardner], [http://dx.doi.org/10.1006/jtbi.1995.0148 Frank], [http://dx.doi.org/10.1006/jtbi.2002.3015 Grafen]). We think not. The reason why it is hard to identify it as such is that it is all about probability theory and statistics, and those two topics are just not that easy. The following tutorial will help by looking at what proper probability theory or statistics would do and compare that to what the Price equation does to numbers that represent those transitions. There is [http://dx.doi.org/10.1016/j.jtbi.2005.04.026 an article with the same message], but this tutorial makes it simpler, by allowing you to play around with models, data and samples yourself. At some points you may find that the steps the tutorial takes are evident and all too easy, but it is possible that after a few steps, as simple as they are, you may nonetheless feel confused enough to make you want to retrace your steps and be happy, the second time around, that they are that simple. Or not, in which case you will just have an easy journey to a deep understanding why the Price equation is not what some say it is.&lt;br /&gt;
&lt;br /&gt;
==Price 1.0: A very simple model ==&lt;br /&gt;
We will begin with the simplest real model that we can think of. No sex, no shrinking or expanding populations, no frequency dependence, no&lt;br /&gt;
complications whatsoever. Just two individuals that are ready to reproduce. Asexually. This gives us a version of the Price equation that is even&lt;br /&gt;
simpler than the first version by Price himself. And it will give us probability theory and statistics that is relatively nice and easy too, and therefore an excellent start that helps us get acquainted to the joys of rigour and precision.&lt;br /&gt;
&lt;br /&gt;
[[Price 1.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 1.0 Applet | Go straight to the software]]&lt;br /&gt;
&lt;br /&gt;
== Price 2.0: A model with sexual reproduction ==&lt;br /&gt;
&lt;br /&gt;
If we add sexual reproduction, everything gets slightly more complicated, the proper statistics as well as the Price equation. This makes&lt;br /&gt;
the statistics much more fun, and it makes the failure of the Price equation to be of any help even more salient. We like to keep it relatively simple though, so for the moment we do not assume actual different sexes, but we do assume that every individual is diploid.&lt;br /&gt;
&lt;br /&gt;
[[Price 2.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 2.0 Applet | Go straight to the software]]&lt;br /&gt;
&lt;br /&gt;
== Price 3.0: A model with frequency dependence ==&lt;br /&gt;
&lt;br /&gt;
We go back to the asexual model, but now we will take a model with frequency dependence. This will be a bit more complicated, but we can still use a basic, well known model. They are paired randomly, and play a game in those pairs. The game gives them payoffs according to a payoff matrix&lt;br /&gt;
&lt;br /&gt;
[[Price 3.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 3.0 Applet | Go straight to the software]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extra links ==&lt;br /&gt;
&lt;br /&gt;
* John Maynard Smith [http://www.webofstories.com/play/7297 talks about the Price equation] and how this approach always felt unnatural to him. Since most of us remember a feeling of doubt when first confronted with the Price equation, it may be a relief to hear him say 'I'm not going to tell you what Price's theorem is, because I don't actually understand it'.&lt;/div&gt;</description>
			<pubDate>Mon, 04 Oct 2010 16:58:23 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price</comments>		</item>
		<item>
			<title>Price</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* Extra links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Evolution is all about transitions. One generation gives birth to the next, which gives birth to yet another generation, in an endless chain of transitions. These transitions don't just go anywhere; some transitions are more likely than others. First of all we beget offspring that is likely to bear some similarity with ourselves.  And how likely we are to get offspring at all, and how many, tends to depend on certain heritable characteristics. The relative likelihood of some transitions and the relative improbability of others imply that we can make informed guesses as to where this endless chain of transitions came from and where it is going. &lt;br /&gt;
&lt;br /&gt;
The Price equation zooms in on transitions from one generation to the next. This suggests that it could be a fundamental tool for understanding this&lt;br /&gt;
process of evolution. It was formulated by George Richard Price in 1970 [http://www.nature.com/nature/journal/v227/n5257/abs/227520a0.html in an article in Nature], and acclaimed by some, maybe even quite a few, to be a fundamental ingredient for models of evolution ([http://dx.doi.org/10.1016/j.cub.2008.01.005 Gardner], [http://dx.doi.org/10.1006/jtbi.1995.0148 Frank], [http://dx.doi.org/10.1006/jtbi.2002.3015 Grafen]). We think not. The reason why it is hard to identify it as such is that it is all about probability theory and statistics, and those two topics are just not that easy. The following tutorial will help by looking at what proper probability theory or statistics would do and compare that to what the Price equation does to numbers that represent those transitions. There is [http://dx.doi.org/10.1016/j.jtbi.2005.04.026 an article with the same message], but this tutorial makes it simpler, by allowing you to play around with models, data and samples yourself. At some points you may find that the steps the tutorial takes are evident and all too easy, but it is possible that after a few steps, as simple as they are, you may nonetheless feel confused enough to make you want to retrace your steps and be happy, the second time around, that they are that simple. Or not, in which case you will just have an easy journey to a deep understanding why the Price equation is not what some say it is.&lt;br /&gt;
&lt;br /&gt;
==Price 1.0: A very simple model ==&lt;br /&gt;
We will begin with the simplest real model that we can think of. No sex, no shrinking or expanding populations, no frequency dependence, no&lt;br /&gt;
complications whatsoever. Just two individuals that are ready to reproduce. Asexually. This gives us a version of the Price equation that is even&lt;br /&gt;
simpler than the first version by Price himself. And it will give us probability theory and statistics that is relatively nice and easy too, and therefore an excellent start that helps us get acquainted to the joys of rigour and precision.&lt;br /&gt;
&lt;br /&gt;
[[Price 1.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 1.0 Applet | Go straight to the software]]&lt;br /&gt;
&lt;br /&gt;
== Price 2.0: A model with sexual reproduction ==&lt;br /&gt;
&lt;br /&gt;
If we add sexual reproduction, everything gets slightly more complicated, the proper statistics as well as the Price equation. This makes&lt;br /&gt;
the statistics much more fun, and it makes the failure of the Price equation to be of any help even more salient. We like to keep it relatively simple though, so for the moment we do not assume actual different sexes, but we do assume that every individual is diploid.&lt;br /&gt;
&lt;br /&gt;
[[Price 2.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 2.0 Applet | Go straight to the software]]&lt;br /&gt;
&lt;br /&gt;
== Price 3.0: A model with frequency dependence ==&lt;br /&gt;
&lt;br /&gt;
We go back to the asexual model, but now we will take a model with frequency dependence. This will be a bit more complicated, but we can still use a basic, well known model. They are paired randomly, and play a game in those pairs. The game gives them payoffs according to a payoff matrix&lt;br /&gt;
&lt;br /&gt;
[[Price 3.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 3.0 Applet | Go straight to the software]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extra links ==&lt;br /&gt;
&lt;br /&gt;
* John Maynard Smith [http://www.webofstories.com/play/7297 talks about the Price equation] and how this approach always felt unnatural to him. Since most of us remember a feeling of doubt about the Price equation, it may be a relief to hear him say 'I'm not going to tell you what Price's theorem is, because I don't actually understand it'.&lt;/div&gt;</description>
			<pubDate>Mon, 04 Oct 2010 16:57:31 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price</comments>		</item>
		<item>
			<title>Price 1.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_1.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* What would a probability theorist do? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A very simple model ==&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 2 individuals. We depart from a  population in which individual no 1 has &amp;quot;the&amp;quot; gene, while the other, individual no 2, does not. In Price equation terms, that means that the variable &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt;, which denotes the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; becomes: &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The next generation of 2 individuals is drawn in a very simple way. First we draw the first, and then we draw the second. That makes it a Wright-Fisher process. At both draws the new individual could be the offspring of individual no 1 or of individual no 2. Reproduction is asexual, hence the offspring is a perfect copy of its parent. Now here comes the important thing. We assume that at both draws, the probability of no 1 from the parent population - the one with the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt;, while the probability of no 2 from the parent population - the one without the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;1-p&amp;lt;/math&amp;gt;. That gives us four possible transitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Price1Setting.jpg|400px|center|thumb|Four possible transitions]]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What the new generation will be is a random variable. What the current generation is, is not; the current generation is simply given. We can however think of a ''hypothetical'' chance experiment such that, in combination with the actual random transition, we get two random variables, between which we can define a covariance. So here is the recipe. &lt;br /&gt;
&lt;br /&gt;
1) Draw one of the individuals from the parent population (this is the hypothetical random variable).&lt;br /&gt;
&lt;br /&gt;
2) Draw the next generation (this is the actual random thing that happens in the the transition).&lt;br /&gt;
&lt;br /&gt;
The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is now defined as the genotype of the parent. That is a simple, albeit hypothetical random variable: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left(&lt;br /&gt;
X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt;, which is the number of offspring that the parent that has been drawn begets. This is a slightly more complicated random variable, because the chances depend on which one of the two possible parents has been chosen. So we get a (not too long) list of conditional probabilities. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=0 | X=0\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1 | X=0\right) = 2p \left( 1-p\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=2 | X=0\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The other conditional probabilities are the reverse, because the parent of a new individual is the one if it is not the other, and vice versa.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=0|X=1\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1|X=1\right) =2p\left( 1-p\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=2|X=1\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  &amp;lt;math&amp;gt;X &amp;lt;/math&amp;gt; and  &amp;lt;math&amp;gt;Y &amp;lt;/math&amp;gt; are pretty well defined, so we can also compute the covariance of these two actual random variables.&lt;br /&gt;
&lt;br /&gt;
Let us first look at expectations...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{E}\left[ X\right]=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ X\right] =\sum_{x=0,1}x\mathbb{P}\left( X=x\right) =\mathbb{P}\left( X=1\right) =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For obvious symmetry reasons, the expectation of &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; is 1; the total number of offspring is 2, and either one could be the parent, so ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =1&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =\sum_{x=0,1}\sum_{y=0,1,2}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{y=1,2}\sum_{x=0,1}y\mathbb{P}\left( X=x\right) \mathbb{P}\left(Y=y|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \left( \frac{1}{2}\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot 2p\left( 1-p\right) \right) +2\cdot \left( \frac{1}{2}\cdot p^{2}+\frac{1}{2}\cdot \left( 1-p\right) ^{2}\right) = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
... and ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] = p &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,1}\sum_{y=0,1,2}xy\mathbb{P}\left( X=x,Y=y\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(because &amp;lt;math&amp;gt;xy=0&amp;lt;/math&amp;gt; if either &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;y=0&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\sum_{x=1}\sum_{y=1,2}xy\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1,Y=1\right) +2\cdot \mathbb{P}\left(X=1,Y=2\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1\right) \cdot \mathbb{P}\left(Y=1|X=1\right) +2\cdot \mathbb{P}\left( X=1\right) \mathbb{P}\left(Y=2|X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \frac{1}{2}\cdot 2p\left( 1-p\right) +2\cdot \frac{1}{2}\cdot p^{2}= &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=p\left( 1-p\right) +p^{2}= p&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance is then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] &lt;br /&gt;
\mathbb{E}\left[ Y\right] =p-\frac{1}{2}\cdot 1=p-\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this very simple model ==&lt;br /&gt;
&lt;br /&gt;
An interesting question would be: is it good to have the gene? &lt;br /&gt;
&lt;br /&gt;
Or, if we do statistics: suppose we know that the process has this form, but we  don't know the value of ''p''. Then the question becomes: is ''p&amp;gt;1/2'', or, equivalently, is ''Cov( X,Y) &amp;gt;0''? Below we will try to answer that question. But first we will look at what the Price equation does to all of this.&lt;br /&gt;
&lt;br /&gt;
For a given transition, the Price equation constitutes an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N}\sum_{i}q_{i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; (For this particular model this quantity is 0.5).&lt;br /&gt;
&lt;br /&gt;
The frequency of the gene in the offspring population is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation 1.0 then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this simple case for N = 2 this amounts to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i}}{2}\right] &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
The point where confusion starts, is that George Price named the right hand side of this equation ''Cov(z,q)''. The claim of the Price equation - which we contend - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. The central issue here is that this ''Cov(z,q)'' is discussed as if it were a real covariance. Is that correct? &lt;br /&gt;
&lt;br /&gt;
Try yourself!&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial1.Tutorial1.class&amp;quot;  height=&amp;quot;400&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency ''Q'' can go up by 1/2, remain what it is, or go down by 1/2. The value of this so-called ''Covariance'' just follows that change in frequency (and because it is not a real covariance, we will use quotation marks from now on). This creates an illusion of understanding, because whatever happens, the covariance changes along with the outcome of the chance experiment. In other words: '''the data explain the data'''. &lt;br /&gt;
&lt;br /&gt;
This is, of course, not OK; the true and well-defined covariance is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) = p-\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This does not depend on the realisation. Cov(X,Y) defines the properties of the chance experiment, and the realisation of this chance experiment defines &amp;quot;Cov(z,q)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==What would a probability theorist do?==&lt;br /&gt;
&lt;br /&gt;
A probability theorist would try to figure out the transition probabilities for the suggested model. That is exactly what we did in the [[#A very simple model | description of the model]], where we determined the transition probabilities and &amp;lt;math&amp;gt;Cov(X,Y)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== What would a statistician do? ==&lt;br /&gt;
&lt;br /&gt;
If you are interested in statistics, which is only natural if you care for evolution, and you do not know the true model that generates the transitions, then you would want to try to answer the question what ''p'' is. Is ''p&amp;gt;1/2''? Then having the gene is good for reproduction. Is ''p&amp;lt;1/2''? Then not. Is ''p=1/2''? Then it is good nor bad. So how do we find out? Well, the thing with statistics is that you will never find out for sure. All we can do is try to find ways to estimate this ''p'', or design tests on if and how ''p'' differs from ''1/2'', that will help us make statements about the true model with some confidence. Here are a few such statements.&lt;br /&gt;
&lt;br /&gt;
===Estimation of p===&lt;br /&gt;
&lt;br /&gt;
One of the reasons that so many are convinced of the value of the Price equation is that it ''almost'' hits the nail on the head (even though it misses the head completely). So here we go with what sometimes feels as an indication that the Price equation is not so wrong after all. If you sense this in yourself, just return to the interactive part above.&lt;br /&gt;
&lt;br /&gt;
If you draw a new generation, then that new generation comes with a &amp;quot;Cov(z,q)&amp;quot; . With probability &amp;lt;math&amp;gt;p^{2}&amp;lt;/math&amp;gt; you draw  two 1's, which implies  &amp;quot;Cov(z,q)&amp;quot;=+1/2. With probability &amp;lt;math&amp;gt;(1-p) ^{2}&amp;lt;/math&amp;gt; you draw  two 0's, which implies &amp;quot;Cov(z,q)&amp;quot;=-1/2. So&amp;quot;Cov(z,q)&amp;quot; is actually a random variable itself, the characteristics of which we can look at. Two natural characteristics are its expected value and its variance. Now the expectation of this so-called variance is, luckily,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}. &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i} }{2}\right] = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=\sum_{z_{1}=0,1,2}\left[ \frac{z_{1}q_{1}}{2}-\frac{q_{1}}{2}\right] &lt;br /&gt;
\mathbb{P}\left( Z_{1}=z_{1}\right) = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=-\frac{1}{2}\cdot \left( 1-p\right) ^{2}+0\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot p^{2}=p-\frac{1}{2}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the realisation varies quite a bit, as we have seen in interactive part above. This is reflected in the variance of &amp;quot;Cov(z,q)&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] = \frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \left( ^{\prime \prime }Cov\left( z,q\right) ^{\prime&lt;br /&gt;
\prime }\right) ^{2}\right] -\mathbb{E}^{2}\left[ \left( ^{\prime \prime}Cov\left( z,q\right) ^{\prime \prime }\right) \right] =\frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This variance can be reduced though if we take a large sample. Suppose that we have individuals ''i=1,...,n'' with the gene, and individuals ''i=n+1,...,2n''&lt;br /&gt;
without it. Now we draw the next generation in the same way as before, which looks a bit more general; ''2n'' individuals are drawn, and at every draw&lt;br /&gt;
individual ''i'' has a probability with which it is drawn to reproduce. For ''i=1,...,n'' this probability is &amp;lt;math&amp;gt;\frac{p_{1}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
For ''i=n+1,...,2n'' this probability is &amp;lt;math&amp;gt;\frac{p_{0}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. For this transition, one can show that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =p-\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\lim_{n\rightarrow \infty }Var\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we indeed define &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime \prime }Cov\left( z,q\right)^{\prime \prime }&amp;lt;/math&amp;gt;  as &amp;lt;math&amp;gt;\frac{1}{2n}\left(\sum_{i=1}^{2n}z_{i}q_{i}- \sum_{i=1}^{2n}q_{i}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }+\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is an unbiased estimator of ''p'' - because &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The quantity &amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }&amp;lt;/math&amp;gt; is also regularly referred to as the ''sample'' covariance. It is very important to realise that this is not the true covariance; the covariance is a fixed property of two random variables, while the sample covariance is a random variable itself.&lt;br /&gt;
&lt;br /&gt;
===Testing properties of p ===&lt;br /&gt;
&lt;br /&gt;
The ''sample'' covariance is typically also used as input for in tests of the type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{0} : p=\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{1} : p\neq \frac{1}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here?== &lt;br /&gt;
&lt;br /&gt;
Not. For determining the properties of the model, the Price equation did not help, and in fact cannot even be of use. We found the transition&lt;br /&gt;
probabilities just by doing probability calculations. For doing statistics the Price equation did not help either. And yes, the Price equation applied to one actual draw does have the sample covariance of that draw in it, and the sample covariance is a useful thing, but we do not need the Price&lt;br /&gt;
equation for knowing that the sample covariance is useful. The sample covariance has been around since the 1880's, when Karl Pearson (1857 – 1936) introduced it, along with the distinction between covariance and sample covariance. It was there well before George Price&lt;br /&gt;
was born, and it is used in parameter estimation and hypothesis testing in all other fields of science, where no one has ever heard of G.R. Price. And, most importantly, using the sample covariance is obviously not the same as using the Price equation. It is using the sample covariance.&lt;/div&gt;</description>
			<pubDate>Mon, 27 Sep 2010 13:19:30 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_1.0</comments>		</item>
		<item>
			<title>Price 1.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_1.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* Estimation of p */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A very simple model ==&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 2 individuals. We depart from a  population in which individual no 1 has &amp;quot;the&amp;quot; gene, while the other, individual no 2, does not. In Price equation terms, that means that the variable &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt;, which denotes the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; becomes: &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The next generation of 2 individuals is drawn in a very simple way. First we draw the first, and then we draw the second. That makes it a Wright-Fisher process. At both draws the new individual could be the offspring of individual no 1 or of individual no 2. Reproduction is asexual, hence the offspring is a perfect copy of its parent. Now here comes the important thing. We assume that at both draws, the probability of no 1 from the parent population - the one with the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt;, while the probability of no 2 from the parent population - the one without the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;1-p&amp;lt;/math&amp;gt;. That gives us four possible transitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Price1Setting.jpg|400px|center|thumb|Four possible transitions]]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What the new generation will be is a random variable. What the current generation is, is not; the current generation is simply given. We can however think of a ''hypothetical'' chance experiment such that, in combination with the actual random transition, we get two random variables, between which we can define a covariance. So here is the recipe. &lt;br /&gt;
&lt;br /&gt;
1) Draw one of the individuals from the parent population (this is the hypothetical random variable).&lt;br /&gt;
&lt;br /&gt;
2) Draw the next generation (this is the actual random thing that happens in the the transition).&lt;br /&gt;
&lt;br /&gt;
The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is now defined as the genotype of the parent. That is a simple, albeit hypothetical random variable: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left(&lt;br /&gt;
X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt;, which is the number of offspring that the parent that has been drawn begets. This is a slightly more complicated random variable, because the chances depend on which one of the two possible parents has been chosen. So we get a (not too long) list of conditional probabilities. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=0 | X=0\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1 | X=0\right) = 2p \left( 1-p\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=2 | X=0\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The other conditional probabilities are the reverse, because the parent of a new individual is the one if it is not the other, and vice versa.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=0|X=1\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1|X=1\right) =2p\left( 1-p\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=2|X=1\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  &amp;lt;math&amp;gt;X &amp;lt;/math&amp;gt; and  &amp;lt;math&amp;gt;Y &amp;lt;/math&amp;gt; are pretty well defined, so we can also compute the covariance of these two actual random variables.&lt;br /&gt;
&lt;br /&gt;
Let us first look at expectations...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{E}\left[ X\right]=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ X\right] =\sum_{x=0,1}x\mathbb{P}\left( X=x\right) =\mathbb{P}\left( X=1\right) =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For obvious symmetry reasons, the expectation of &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; is 1; the total number of offspring is 2, and either one could be the parent, so ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =1&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =\sum_{x=0,1}\sum_{y=0,1,2}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{y=1,2}\sum_{x=0,1}y\mathbb{P}\left( X=x\right) \mathbb{P}\left(Y=y|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \left( \frac{1}{2}\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot 2p\left( 1-p\right) \right) +2\cdot \left( \frac{1}{2}\cdot p^{2}+\frac{1}{2}\cdot \left( 1-p\right) ^{2}\right) = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
... and ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] = p &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,1}\sum_{y=0,1,2}xy\mathbb{P}\left( X=x,Y=y\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(because &amp;lt;math&amp;gt;xy=0&amp;lt;/math&amp;gt; if either &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;y=0&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\sum_{x=1}\sum_{y=1,2}xy\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1,Y=1\right) +2\cdot \mathbb{P}\left(X=1,Y=2\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1\right) \cdot \mathbb{P}\left(Y=1|X=1\right) +2\cdot \mathbb{P}\left( X=1\right) \mathbb{P}\left(Y=2|X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \frac{1}{2}\cdot 2p\left( 1-p\right) +2\cdot \frac{1}{2}\cdot p^{2}= &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=p\left( 1-p\right) +p^{2}= p&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance is then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] &lt;br /&gt;
\mathbb{E}\left[ Y\right] =p-\frac{1}{2}\cdot 1=p-\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this very simple model ==&lt;br /&gt;
&lt;br /&gt;
An interesting question would be: is it good to have the gene? &lt;br /&gt;
&lt;br /&gt;
Or, if we do statistics: suppose we know that the process has this form, but we  don't know the value of ''p''. Then the question becomes: is ''p&amp;gt;1/2'', or, equivalently, is ''Cov( X,Y) &amp;gt;0''? Below we will try to answer that question. But first we will look at what the Price equation does to all of this.&lt;br /&gt;
&lt;br /&gt;
For a given transition, the Price equation constitutes an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N}\sum_{i}q_{i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; (For this particular model this quantity is 0.5).&lt;br /&gt;
&lt;br /&gt;
The frequency of the gene in the offspring population is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation 1.0 then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this simple case for N = 2 this amounts to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i}}{2}\right] &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
The point where confusion starts, is that George Price named the right hand side of this equation ''Cov(z,q)''. The claim of the Price equation - which we contend - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. The central issue here is that this ''Cov(z,q)'' is discussed as if it were a real covariance. Is that correct? &lt;br /&gt;
&lt;br /&gt;
Try yourself!&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial1.Tutorial1.class&amp;quot;  height=&amp;quot;400&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency ''Q'' can go up by 1/2, remain what it is, or go down by 1/2. The value of this so-called ''Covariance'' just follows that change in frequency (and because it is not a real covariance, we will use quotation marks from now on). This creates an illusion of understanding, because whatever happens, the covariance changes along with the outcome of the chance experiment. In other words: '''the data explain the data'''. &lt;br /&gt;
&lt;br /&gt;
This is, of course, not OK; the true and well-defined covariance is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) = p-\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This does not depend on the realisation. Cov(X,Y) defines the properties of the chance experiment, and the realisation of this chance experiment defines &amp;quot;Cov(z,q)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==What would a probability theorist do?==&lt;br /&gt;
&lt;br /&gt;
A probability theorist would try to figure out the transition probabilities for the suggested model. That is exactly what we did in the [[A very simple model | description of the model]], where we determined the transition probabilities and &amp;lt;math&amp;gt;Cov(X,Y)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== What would a statistician do? ==&lt;br /&gt;
&lt;br /&gt;
If you are interested in statistics, which is only natural if you care for evolution, and you do not know the true model that generates the transitions, then you would want to try to answer the question what ''p'' is. Is ''p&amp;gt;1/2''? Then having the gene is good for reproduction. Is ''p&amp;lt;1/2''? Then not. Is ''p=1/2''? Then it is good nor bad. So how do we find out? Well, the thing with statistics is that you will never find out for sure. All we can do is try to find ways to estimate this ''p'', or design tests on if and how ''p'' differs from ''1/2'', that will help us make statements about the true model with some confidence. Here are a few such statements.&lt;br /&gt;
&lt;br /&gt;
===Estimation of p===&lt;br /&gt;
&lt;br /&gt;
One of the reasons that so many are convinced of the value of the Price equation is that it ''almost'' hits the nail on the head (even though it misses the head completely). So here we go with what sometimes feels as an indication that the Price equation is not so wrong after all. If you sense this in yourself, just return to the interactive part above.&lt;br /&gt;
&lt;br /&gt;
If you draw a new generation, then that new generation comes with a &amp;quot;Cov(z,q)&amp;quot; . With probability &amp;lt;math&amp;gt;p^{2}&amp;lt;/math&amp;gt; you draw  two 1's, which implies  &amp;quot;Cov(z,q)&amp;quot;=+1/2. With probability &amp;lt;math&amp;gt;(1-p) ^{2}&amp;lt;/math&amp;gt; you draw  two 0's, which implies &amp;quot;Cov(z,q)&amp;quot;=-1/2. So&amp;quot;Cov(z,q)&amp;quot; is actually a random variable itself, the characteristics of which we can look at. Two natural characteristics are its expected value and its variance. Now the expectation of this so-called variance is, luckily,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}. &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i} }{2}\right] = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=\sum_{z_{1}=0,1,2}\left[ \frac{z_{1}q_{1}}{2}-\frac{q_{1}}{2}\right] &lt;br /&gt;
\mathbb{P}\left( Z_{1}=z_{1}\right) = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=-\frac{1}{2}\cdot \left( 1-p\right) ^{2}+0\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot p^{2}=p-\frac{1}{2}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the realisation varies quite a bit, as we have seen in interactive part above. This is reflected in the variance of &amp;quot;Cov(z,q)&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] = \frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \left( ^{\prime \prime }Cov\left( z,q\right) ^{\prime&lt;br /&gt;
\prime }\right) ^{2}\right] -\mathbb{E}^{2}\left[ \left( ^{\prime \prime}Cov\left( z,q\right) ^{\prime \prime }\right) \right] =\frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This variance can be reduced though if we take a large sample. Suppose that we have individuals ''i=1,...,n'' with the gene, and individuals ''i=n+1,...,2n''&lt;br /&gt;
without it. Now we draw the next generation in the same way as before, which looks a bit more general; ''2n'' individuals are drawn, and at every draw&lt;br /&gt;
individual ''i'' has a probability with which it is drawn to reproduce. For ''i=1,...,n'' this probability is &amp;lt;math&amp;gt;\frac{p_{1}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
For ''i=n+1,...,2n'' this probability is &amp;lt;math&amp;gt;\frac{p_{0}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. For this transition, one can show that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =p-\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\lim_{n\rightarrow \infty }Var\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we indeed define &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime \prime }Cov\left( z,q\right)^{\prime \prime }&amp;lt;/math&amp;gt;  as &amp;lt;math&amp;gt;\frac{1}{2n}\left(\sum_{i=1}^{2n}z_{i}q_{i}- \sum_{i=1}^{2n}q_{i}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }+\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is an unbiased estimator of ''p'' - because &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The quantity &amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }&amp;lt;/math&amp;gt; is also regularly referred to as the ''sample'' covariance. It is very important to realise that this is not the true covariance; the covariance is a fixed property of two random variables, while the sample covariance is a random variable itself.&lt;br /&gt;
&lt;br /&gt;
===Testing properties of p ===&lt;br /&gt;
&lt;br /&gt;
The ''sample'' covariance is typically also used as input for in tests of the type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{0} : p=\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{1} : p\neq \frac{1}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here?== &lt;br /&gt;
&lt;br /&gt;
Not. For determining the properties of the model, the Price equation did not help, and in fact cannot even be of use. We found the transition&lt;br /&gt;
probabilities just by doing probability calculations. For doing statistics the Price equation did not help either. And yes, the Price equation applied to one actual draw does have the sample covariance of that draw in it, and the sample covariance is a useful thing, but we do not need the Price&lt;br /&gt;
equation for knowing that the sample covariance is useful. The sample covariance has been around since the 1880's, when Karl Pearson (1857 – 1936) introduced it, along with the distinction between covariance and sample covariance. It was there well before George Price&lt;br /&gt;
was born, and it is used in parameter estimation and hypothesis testing in all other fields of science, where no one has ever heard of G.R. Price. And, most importantly, using the sample covariance is obviously not the same as using the Price equation. It is using the sample covariance.&lt;/div&gt;</description>
			<pubDate>Mon, 27 Sep 2010 08:54:54 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_1.0</comments>		</item>
		<item>
			<title>Price 1.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_1.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* What would a statistician do? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A very simple model ==&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 2 individuals. We depart from a  population in which individual no 1 has &amp;quot;the&amp;quot; gene, while the other, individual no 2, does not. In Price equation terms, that means that the variable &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt;, which denotes the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; becomes: &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The next generation of 2 individuals is drawn in a very simple way. First we draw the first, and then we draw the second. That makes it a Wright-Fisher process. At both draws the new individual could be the offspring of individual no 1 or of individual no 2. Reproduction is asexual, hence the offspring is a perfect copy of its parent. Now here comes the important thing. We assume that at both draws, the probability of no 1 from the parent population - the one with the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt;, while the probability of no 2 from the parent population - the one without the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;1-p&amp;lt;/math&amp;gt;. That gives us four possible transitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Price1Setting.jpg|400px|center|thumb|Four possible transitions]]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What the new generation will be is a random variable. What the current generation is, is not; the current generation is simply given. We can however think of a ''hypothetical'' chance experiment such that, in combination with the actual random transition, we get two random variables, between which we can define a covariance. So here is the recipe. &lt;br /&gt;
&lt;br /&gt;
1) Draw one of the individuals from the parent population (this is the hypothetical random variable).&lt;br /&gt;
&lt;br /&gt;
2) Draw the next generation (this is the actual random thing that happens in the the transition).&lt;br /&gt;
&lt;br /&gt;
The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is now defined as the genotype of the parent. That is a simple, albeit hypothetical random variable: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left(&lt;br /&gt;
X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt;, which is the number of offspring that the parent that has been drawn begets. This is a slightly more complicated random variable, because the chances depend on which one of the two possible parents has been chosen. So we get a (not too long) list of conditional probabilities. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=0 | X=0\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1 | X=0\right) = 2p \left( 1-p\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=2 | X=0\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The other conditional probabilities are the reverse, because the parent of a new individual is the one if it is not the other, and vice versa.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=0|X=1\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1|X=1\right) =2p\left( 1-p\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=2|X=1\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  &amp;lt;math&amp;gt;X &amp;lt;/math&amp;gt; and  &amp;lt;math&amp;gt;Y &amp;lt;/math&amp;gt; are pretty well defined, so we can also compute the covariance of these two actual random variables.&lt;br /&gt;
&lt;br /&gt;
Let us first look at expectations...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{E}\left[ X\right]=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ X\right] =\sum_{x=0,1}x\mathbb{P}\left( X=x\right) =\mathbb{P}\left( X=1\right) =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For obvious symmetry reasons, the expectation of &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; is 1; the total number of offspring is 2, and either one could be the parent, so ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =1&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =\sum_{x=0,1}\sum_{y=0,1,2}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{y=1,2}\sum_{x=0,1}y\mathbb{P}\left( X=x\right) \mathbb{P}\left(Y=y|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \left( \frac{1}{2}\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot 2p\left( 1-p\right) \right) +2\cdot \left( \frac{1}{2}\cdot p^{2}+\frac{1}{2}\cdot \left( 1-p\right) ^{2}\right) = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
... and ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] = p &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,1}\sum_{y=0,1,2}xy\mathbb{P}\left( X=x,Y=y\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(because &amp;lt;math&amp;gt;xy=0&amp;lt;/math&amp;gt; if either &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;y=0&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\sum_{x=1}\sum_{y=1,2}xy\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1,Y=1\right) +2\cdot \mathbb{P}\left(X=1,Y=2\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1\right) \cdot \mathbb{P}\left(Y=1|X=1\right) +2\cdot \mathbb{P}\left( X=1\right) \mathbb{P}\left(Y=2|X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \frac{1}{2}\cdot 2p\left( 1-p\right) +2\cdot \frac{1}{2}\cdot p^{2}= &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=p\left( 1-p\right) +p^{2}= p&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance is then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] &lt;br /&gt;
\mathbb{E}\left[ Y\right] =p-\frac{1}{2}\cdot 1=p-\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this very simple model ==&lt;br /&gt;
&lt;br /&gt;
An interesting question would be: is it good to have the gene? &lt;br /&gt;
&lt;br /&gt;
Or, if we do statistics: suppose we know that the process has this form, but we  don't know the value of ''p''. Then the question becomes: is ''p&amp;gt;1/2'', or, equivalently, is ''Cov( X,Y) &amp;gt;0''? Below we will try to answer that question. But first we will look at what the Price equation does to all of this.&lt;br /&gt;
&lt;br /&gt;
For a given transition, the Price equation constitutes an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N}\sum_{i}q_{i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; (For this particular model this quantity is 0.5).&lt;br /&gt;
&lt;br /&gt;
The frequency of the gene in the offspring population is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation 1.0 then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this simple case for N = 2 this amounts to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i}}{2}\right] &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
The point where confusion starts, is that George Price named the right hand side of this equation ''Cov(z,q)''. The claim of the Price equation - which we contend - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. The central issue here is that this ''Cov(z,q)'' is discussed as if it were a real covariance. Is that correct? &lt;br /&gt;
&lt;br /&gt;
Try yourself!&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial1.Tutorial1.class&amp;quot;  height=&amp;quot;400&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency ''Q'' can go up by 1/2, remain what it is, or go down by 1/2. The value of this so-called ''Covariance'' just follows that change in frequency (and because it is not a real covariance, we will use quotation marks from now on). This creates an illusion of understanding, because whatever happens, the covariance changes along with the outcome of the chance experiment. In other words: '''the data explain the data'''. &lt;br /&gt;
&lt;br /&gt;
This is, of course, not OK; the true and well-defined covariance is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) = p-\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This does not depend on the realisation. Cov(X,Y) defines the properties of the chance experiment, and the realisation of this chance experiment defines &amp;quot;Cov(z,q)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==What would a probability theorist do?==&lt;br /&gt;
&lt;br /&gt;
A probability theorist would try to figure out the transition probabilities for the suggested model. That is exactly what we did in the [[A very simple model | description of the model]], where we determined the transition probabilities and &amp;lt;math&amp;gt;Cov(X,Y)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== What would a statistician do? ==&lt;br /&gt;
&lt;br /&gt;
If you are interested in statistics, which is only natural if you care for evolution, and you do not know the true model that generates the transitions, then you would want to try to answer the question what ''p'' is. Is ''p&amp;gt;1/2''? Then having the gene is good for reproduction. Is ''p&amp;lt;1/2''? Then not. Is ''p=1/2''? Then it is good nor bad. So how do we find out? Well, the thing with statistics is that you will never find out for sure. All we can do is try to find ways to estimate this ''p'', or design tests on if and how ''p'' differs from ''1/2'', that will help us make statements about the true model with some confidence. Here are a few such statements.&lt;br /&gt;
&lt;br /&gt;
===Estimation of p===&lt;br /&gt;
&lt;br /&gt;
One of the reasons that so many are convinced of the value of the Price equation is that it ''almost'' hits the nail on the head (even though it misses the head completely). So here we go with what sometimes feels as an indication that the Price equation is not so wrong after all. If you sense this in yourself, just return to the interactive part above.&lt;br /&gt;
&lt;br /&gt;
If you draw a new generation, then that new generation comes with a &amp;quot;Cov(z,q)&amp;quot; . With probability &amp;lt;math&amp;gt;p^{2}&amp;lt;/math&amp;gt; you draw  two 1's, which implies  &amp;quot;Cov(z,q)&amp;quot;=+1/2. With probability &amp;lt;math&amp;gt;(1-p) ^{2}&amp;lt;/math&amp;gt; you draw  two 0's, which implies &amp;quot;Cov(z,q)&amp;quot;=-1/2. So&amp;quot;Cov(z,q)&amp;quot; is actually a random variable itself, the characteristics of which we can look at. Two natural characteristics are its expected value and its variance. Now the expectation of this so-called variance is, luckily,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}. &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i} }{2}\right] = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=\sum_{z_{1}=0,1,2}\left[ \frac{z_{1}q_{1}}{2}-\frac{q_{1}}{2}\right] &lt;br /&gt;
\mathbb{P}\left( Z_{1}=z_{1}\right) = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=-\frac{1}{2}\cdot \left( 1-p\right) ^{2}+0\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot p^{2}=p-\frac{1}{2}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the realisation varies quite a bit, as we have seen in interactive part above. This is reflected in the variance of &amp;quot;Cov(z,q)&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] = \frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \left( ^{\prime \prime }Cov\left( z,q\right) ^{\prime&lt;br /&gt;
\prime }\right) ^{2}\right] -\mathbb{E}^{2}\left[ \left( ^{\prime \prime}Cov\left( z,q\right) ^{\prime \prime }\right) \right] =\frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This variance can be reduced though if we take a large sample. Suppose that we have individuals ''i=1,...,n'' with the gene, and individuals ''i=n+1,...,2n''&lt;br /&gt;
without it. Now we draw the next generation in the same way as before, which looks a bit more general; ''2n'' individuals are drawn, and at every draw&lt;br /&gt;
individual ''i'' has a probability with which it is drawn to reproduce. For ''i=1,...,n'' this probability is &amp;lt;math&amp;gt;\frac{p_{1}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
For ''i=n+1,...,2n'' this probability is &amp;lt;math&amp;gt;\frac{p_{0}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. For this transition, one can show that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =p-\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\lim_{n\rightarrow \infty }Var\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we indeed define &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime \prime }Cov\left( z,q\right)^{\prime \prime }&amp;lt;/math&amp;gt;  as &amp;lt;math&amp;gt;\frac{1}{2n}\left(\sum_{i=1}^{2n}z_{i}q_{i}- \sum_{i=1}^{2n}q_{i}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }+\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is an unbiased estimator of ''p'' - because &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The quantity &amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }&amp;lt;/math&amp;gt; is also regularly referred to as the ''sample'' covariance, which is not the true covariance (the covariance is a fixed property of two random variables, the sample covariance is a random variable itself).&lt;br /&gt;
&lt;br /&gt;
===Testing properties of p ===&lt;br /&gt;
&lt;br /&gt;
The ''sample'' covariance is typically also used as input for in tests of the type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{0} : p=\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{1} : p\neq \frac{1}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here?== &lt;br /&gt;
&lt;br /&gt;
Not. For determining the properties of the model, the Price equation did not help, and in fact cannot even be of use. We found the transition&lt;br /&gt;
probabilities just by doing probability calculations. For doing statistics the Price equation did not help either. And yes, the Price equation applied to one actual draw does have the sample covariance of that draw in it, and the sample covariance is a useful thing, but we do not need the Price&lt;br /&gt;
equation for knowing that the sample covariance is useful. The sample covariance has been around since the 1880's, when Karl Pearson (1857 – 1936) introduced it, along with the distinction between covariance and sample covariance. It was there well before George Price&lt;br /&gt;
was born, and it is used in parameter estimation and hypothesis testing in all other fields of science, where no one has ever heard of G.R. Price. And, most importantly, using the sample covariance is obviously not the same as using the Price equation. It is using the sample covariance.&lt;/div&gt;</description>
			<pubDate>Mon, 27 Sep 2010 08:52:09 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_1.0</comments>		</item>
		<item>
			<title>Price 1.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_1.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* What would a probability theorist do? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A very simple model ==&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 2 individuals. We depart from a  population in which individual no 1 has &amp;quot;the&amp;quot; gene, while the other, individual no 2, does not. In Price equation terms, that means that the variable &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt;, which denotes the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; becomes: &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The next generation of 2 individuals is drawn in a very simple way. First we draw the first, and then we draw the second. That makes it a Wright-Fisher process. At both draws the new individual could be the offspring of individual no 1 or of individual no 2. Reproduction is asexual, hence the offspring is a perfect copy of its parent. Now here comes the important thing. We assume that at both draws, the probability of no 1 from the parent population - the one with the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt;, while the probability of no 2 from the parent population - the one without the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;1-p&amp;lt;/math&amp;gt;. That gives us four possible transitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Price1Setting.jpg|400px|center|thumb|Four possible transitions]]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What the new generation will be is a random variable. What the current generation is, is not; the current generation is simply given. We can however think of a ''hypothetical'' chance experiment such that, in combination with the actual random transition, we get two random variables, between which we can define a covariance. So here is the recipe. &lt;br /&gt;
&lt;br /&gt;
1) Draw one of the individuals from the parent population (this is the hypothetical random variable).&lt;br /&gt;
&lt;br /&gt;
2) Draw the next generation (this is the actual random thing that happens in the the transition).&lt;br /&gt;
&lt;br /&gt;
The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is now defined as the genotype of the parent. That is a simple, albeit hypothetical random variable: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left(&lt;br /&gt;
X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt;, which is the number of offspring that the parent that has been drawn begets. This is a slightly more complicated random variable, because the chances depend on which one of the two possible parents has been chosen. So we get a (not too long) list of conditional probabilities. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=0 | X=0\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1 | X=0\right) = 2p \left( 1-p\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=2 | X=0\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The other conditional probabilities are the reverse, because the parent of a new individual is the one if it is not the other, and vice versa.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=0|X=1\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1|X=1\right) =2p\left( 1-p\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=2|X=1\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  &amp;lt;math&amp;gt;X &amp;lt;/math&amp;gt; and  &amp;lt;math&amp;gt;Y &amp;lt;/math&amp;gt; are pretty well defined, so we can also compute the covariance of these two actual random variables.&lt;br /&gt;
&lt;br /&gt;
Let us first look at expectations...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{E}\left[ X\right]=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ X\right] =\sum_{x=0,1}x\mathbb{P}\left( X=x\right) =\mathbb{P}\left( X=1\right) =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For obvious symmetry reasons, the expectation of &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; is 1; the total number of offspring is 2, and either one could be the parent, so ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =1&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =\sum_{x=0,1}\sum_{y=0,1,2}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{y=1,2}\sum_{x=0,1}y\mathbb{P}\left( X=x\right) \mathbb{P}\left(Y=y|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \left( \frac{1}{2}\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot 2p\left( 1-p\right) \right) +2\cdot \left( \frac{1}{2}\cdot p^{2}+\frac{1}{2}\cdot \left( 1-p\right) ^{2}\right) = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
... and ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] = p &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,1}\sum_{y=0,1,2}xy\mathbb{P}\left( X=x,Y=y\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(because &amp;lt;math&amp;gt;xy=0&amp;lt;/math&amp;gt; if either &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;y=0&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\sum_{x=1}\sum_{y=1,2}xy\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1,Y=1\right) +2\cdot \mathbb{P}\left(X=1,Y=2\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1\right) \cdot \mathbb{P}\left(Y=1|X=1\right) +2\cdot \mathbb{P}\left( X=1\right) \mathbb{P}\left(Y=2|X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \frac{1}{2}\cdot 2p\left( 1-p\right) +2\cdot \frac{1}{2}\cdot p^{2}= &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=p\left( 1-p\right) +p^{2}= p&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance is then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] &lt;br /&gt;
\mathbb{E}\left[ Y\right] =p-\frac{1}{2}\cdot 1=p-\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this very simple model ==&lt;br /&gt;
&lt;br /&gt;
An interesting question would be: is it good to have the gene? &lt;br /&gt;
&lt;br /&gt;
Or, if we do statistics: suppose we know that the process has this form, but we  don't know the value of ''p''. Then the question becomes: is ''p&amp;gt;1/2'', or, equivalently, is ''Cov( X,Y) &amp;gt;0''? Below we will try to answer that question. But first we will look at what the Price equation does to all of this.&lt;br /&gt;
&lt;br /&gt;
For a given transition, the Price equation constitutes an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N}\sum_{i}q_{i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; (For this particular model this quantity is 0.5).&lt;br /&gt;
&lt;br /&gt;
The frequency of the gene in the offspring population is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation 1.0 then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this simple case for N = 2 this amounts to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i}}{2}\right] &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
The point where confusion starts, is that George Price named the right hand side of this equation ''Cov(z,q)''. The claim of the Price equation - which we contend - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. The central issue here is that this ''Cov(z,q)'' is discussed as if it were a real covariance. Is that correct? &lt;br /&gt;
&lt;br /&gt;
Try yourself!&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial1.Tutorial1.class&amp;quot;  height=&amp;quot;400&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency ''Q'' can go up by 1/2, remain what it is, or go down by 1/2. The value of this so-called ''Covariance'' just follows that change in frequency (and because it is not a real covariance, we will use quotation marks from now on). This creates an illusion of understanding, because whatever happens, the covariance changes along with the outcome of the chance experiment. In other words: '''the data explain the data'''. &lt;br /&gt;
&lt;br /&gt;
This is, of course, not OK; the true and well-defined covariance is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) = p-\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This does not depend on the realisation. Cov(X,Y) defines the properties of the chance experiment, and the realisation of this chance experiment defines &amp;quot;Cov(z,q)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==What would a probability theorist do?==&lt;br /&gt;
&lt;br /&gt;
A probability theorist would try to figure out the transition probabilities for the suggested model. That is exactly what we did in the [[A very simple model | description of the model]], where we determined the transition probabilities and &amp;lt;math&amp;gt;Cov(X,Y)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== What would a statistician do? ==&lt;br /&gt;
&lt;br /&gt;
If you are interested in statistics, which is only natural if you care for evolution, and you do not know the true model that generates the transitions, then you would want to try to answer the question what ''p'' is. Is ''p&amp;gt;1/2''? Then having the gene is good for reproduction. Is ''p&amp;lt;1/2''? Then not. &lt;br /&gt;
&lt;br /&gt;
Is ''p=1/2''? Then it is good nor bad. So how do we find out? Well, the thing with statistics is that you will never find out for sure. All we can do is try to find ways to estimate this ''p'', or design tests on if and how ''p'' differs from ''1/2'', that will help us make statements about the true model with some confidence. Here are a few such statements.&lt;br /&gt;
&lt;br /&gt;
===Estimation of p===&lt;br /&gt;
&lt;br /&gt;
One of the reasons that so many are convinced of the value of the Price equation is that it ''almost'' hits the nail on the head (even though it misses the head completely). So here we go with what sometimes feels as an indication that the Price equation is not so wrong after all. If you sense this in yourself, just return to the interactive part above.&lt;br /&gt;
&lt;br /&gt;
If you draw a new generation, then that new generation comes with a &amp;quot;Cov(z,q)&amp;quot; . With probability &amp;lt;math&amp;gt;p^{2}&amp;lt;/math&amp;gt; you draw  two 1's, which implies  &amp;quot;Cov(z,q)&amp;quot;=+1/2. With probability &amp;lt;math&amp;gt;(1-p) ^{2}&amp;lt;/math&amp;gt; you draw  two 0's, which implies &amp;quot;Cov(z,q)&amp;quot;=-1/2. So&amp;quot;Cov(z,q)&amp;quot; is actually a random variable itself, the characteristics of which we can look at. Two natural characteristics are its expected value and its variance. Now the expectation of this so-called variance is, luckily,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}. &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i} }{2}\right] = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=\sum_{z_{1}=0,1,2}\left[ \frac{z_{1}q_{1}}{2}-\frac{q_{1}}{2}\right] &lt;br /&gt;
\mathbb{P}\left( Z_{1}=z_{1}\right) = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=-\frac{1}{2}\cdot \left( 1-p\right) ^{2}+0\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot p^{2}=p-\frac{1}{2}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the realisation varies quite a bit, as we have seen in interactive part above. This is reflected in the variance of &amp;quot;Cov(z,q)&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] = \frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \left( ^{\prime \prime }Cov\left( z,q\right) ^{\prime&lt;br /&gt;
\prime }\right) ^{2}\right] -\mathbb{E}^{2}\left[ \left( ^{\prime \prime}Cov\left( z,q\right) ^{\prime \prime }\right) \right] =\frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This variance can be reduced though if we take a large sample. Suppose that we have individuals ''i=1,...,n'' with the gene, and individuals ''i=n+1,...,2n''&lt;br /&gt;
without it. Now we draw the next generation in the same way as before, which looks a bit more general; ''2n'' individuals are drawn, and at every draw&lt;br /&gt;
individual ''i'' has a probability with which it is drawn to reproduce. For ''i=1,...,n'' this probability is &amp;lt;math&amp;gt;\frac{p_{1}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
For ''i=n+1,...,2n'' this probability is &amp;lt;math&amp;gt;\frac{p_{0}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. For this transition, one can show that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =p-\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\lim_{n\rightarrow \infty }Var\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we indeed define &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime \prime }Cov\left( z,q\right)^{\prime \prime }&amp;lt;/math&amp;gt;  as &amp;lt;math&amp;gt;\frac{1}{2n}\left(\sum_{i=1}^{2n}z_{i}q_{i}- \sum_{i=1}^{2n}q_{i}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }+\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is an unbiased estimator of ''p'' - because &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The quantity &amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }&amp;lt;/math&amp;gt; is also regularly referred to as the ''sample'' covariance, which is not the true covariance (the covariance is a fixed property of two random variables, the sample covariance is a random variable itself).&lt;br /&gt;
&lt;br /&gt;
===Testing properties of p ===&lt;br /&gt;
&lt;br /&gt;
The ''sample'' covariance is typically also used as input for in tests of the type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{0} : p=\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{1} : p\neq \frac{1}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here?== &lt;br /&gt;
&lt;br /&gt;
Not. For determining the properties of the model, the Price equation did not help, and in fact cannot even be of use. We found the transition&lt;br /&gt;
probabilities just by doing probability calculations. For doing statistics the Price equation did not help either. And yes, the Price equation applied to one actual draw does have the sample covariance of that draw in it, and the sample covariance is a useful thing, but we do not need the Price&lt;br /&gt;
equation for knowing that the sample covariance is useful. The sample covariance has been around since the 1880's, when Karl Pearson (1857 – 1936) introduced it, along with the distinction between covariance and sample covariance. It was there well before George Price&lt;br /&gt;
was born, and it is used in parameter estimation and hypothesis testing in all other fields of science, where no one has ever heard of G.R. Price. And, most importantly, using the sample covariance is obviously not the same as using the Price equation. It is using the sample covariance.&lt;/div&gt;</description>
			<pubDate>Mon, 27 Sep 2010 08:51:03 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_1.0</comments>		</item>
		<item>
			<title>Price 1.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_1.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* What would a probability theorist do? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A very simple model ==&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 2 individuals. We depart from a  population in which individual no 1 has &amp;quot;the&amp;quot; gene, while the other, individual no 2, does not. In Price equation terms, that means that the variable &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt;, which denotes the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; becomes: &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The next generation of 2 individuals is drawn in a very simple way. First we draw the first, and then we draw the second. That makes it a Wright-Fisher process. At both draws the new individual could be the offspring of individual no 1 or of individual no 2. Reproduction is asexual, hence the offspring is a perfect copy of its parent. Now here comes the important thing. We assume that at both draws, the probability of no 1 from the parent population - the one with the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt;, while the probability of no 2 from the parent population - the one without the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;1-p&amp;lt;/math&amp;gt;. That gives us four possible transitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Price1Setting.jpg|400px|center|thumb|Four possible transitions]]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What the new generation will be is a random variable. What the current generation is, is not; the current generation is simply given. We can however think of a ''hypothetical'' chance experiment such that, in combination with the actual random transition, we get two random variables, between which we can define a covariance. So here is the recipe. &lt;br /&gt;
&lt;br /&gt;
1) Draw one of the individuals from the parent population (this is the hypothetical random variable).&lt;br /&gt;
&lt;br /&gt;
2) Draw the next generation (this is the actual random thing that happens in the the transition).&lt;br /&gt;
&lt;br /&gt;
The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is now defined as the genotype of the parent. That is a simple, albeit hypothetical random variable: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left(&lt;br /&gt;
X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt;, which is the number of offspring that the parent that has been drawn begets. This is a slightly more complicated random variable, because the chances depend on which one of the two possible parents has been chosen. So we get a (not too long) list of conditional probabilities. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=0 | X=0\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1 | X=0\right) = 2p \left( 1-p\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=2 | X=0\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The other conditional probabilities are the reverse, because the parent of a new individual is the one if it is not the other, and vice versa.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=0|X=1\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1|X=1\right) =2p\left( 1-p\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=2|X=1\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  &amp;lt;math&amp;gt;X &amp;lt;/math&amp;gt; and  &amp;lt;math&amp;gt;Y &amp;lt;/math&amp;gt; are pretty well defined, so we can also compute the covariance of these two actual random variables.&lt;br /&gt;
&lt;br /&gt;
Let us first look at expectations...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{E}\left[ X\right]=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ X\right] =\sum_{x=0,1}x\mathbb{P}\left( X=x\right) =\mathbb{P}\left( X=1\right) =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For obvious symmetry reasons, the expectation of &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; is 1; the total number of offspring is 2, and either one could be the parent, so ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =1&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =\sum_{x=0,1}\sum_{y=0,1,2}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{y=1,2}\sum_{x=0,1}y\mathbb{P}\left( X=x\right) \mathbb{P}\left(Y=y|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \left( \frac{1}{2}\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot 2p\left( 1-p\right) \right) +2\cdot \left( \frac{1}{2}\cdot p^{2}+\frac{1}{2}\cdot \left( 1-p\right) ^{2}\right) = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
... and ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] = p &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,1}\sum_{y=0,1,2}xy\mathbb{P}\left( X=x,Y=y\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(because &amp;lt;math&amp;gt;xy=0&amp;lt;/math&amp;gt; if either &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;y=0&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\sum_{x=1}\sum_{y=1,2}xy\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1,Y=1\right) +2\cdot \mathbb{P}\left(X=1,Y=2\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1\right) \cdot \mathbb{P}\left(Y=1|X=1\right) +2\cdot \mathbb{P}\left( X=1\right) \mathbb{P}\left(Y=2|X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \frac{1}{2}\cdot 2p\left( 1-p\right) +2\cdot \frac{1}{2}\cdot p^{2}= &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=p\left( 1-p\right) +p^{2}= p&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance is then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] &lt;br /&gt;
\mathbb{E}\left[ Y\right] =p-\frac{1}{2}\cdot 1=p-\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this very simple model ==&lt;br /&gt;
&lt;br /&gt;
An interesting question would be: is it good to have the gene? &lt;br /&gt;
&lt;br /&gt;
Or, if we do statistics: suppose we know that the process has this form, but we  don't know the value of ''p''. Then the question becomes: is ''p&amp;gt;1/2'', or, equivalently, is ''Cov( X,Y) &amp;gt;0''? Below we will try to answer that question. But first we will look at what the Price equation does to all of this.&lt;br /&gt;
&lt;br /&gt;
For a given transition, the Price equation constitutes an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N}\sum_{i}q_{i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; (For this particular model this quantity is 0.5).&lt;br /&gt;
&lt;br /&gt;
The frequency of the gene in the offspring population is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation 1.0 then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this simple case for N = 2 this amounts to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i}}{2}\right] &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
The point where confusion starts, is that George Price named the right hand side of this equation ''Cov(z,q)''. The claim of the Price equation - which we contend - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. The central issue here is that this ''Cov(z,q)'' is discussed as if it were a real covariance. Is that correct? &lt;br /&gt;
&lt;br /&gt;
Try yourself!&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial1.Tutorial1.class&amp;quot;  height=&amp;quot;400&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency ''Q'' can go up by 1/2, remain what it is, or go down by 1/2. The value of this so-called ''Covariance'' just follows that change in frequency (and because it is not a real covariance, we will use quotation marks from now on). This creates an illusion of understanding, because whatever happens, the covariance changes along with the outcome of the chance experiment. In other words: '''the data explain the data'''. &lt;br /&gt;
&lt;br /&gt;
This is, of course, not OK; the true and well-defined covariance is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) = p-\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This does not depend on the realisation. Cov(X,Y) defines the properties of the chance experiment, and the realisation of this chance experiment defines &amp;quot;Cov(z,q)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==What would a probability theorist do?==&lt;br /&gt;
&lt;br /&gt;
A probability theorist would try to figure out the transition probabilities for the suggested model. That is exactly what we did in the description of the model, where we determined the trasition probabilities and.&lt;br /&gt;
&lt;br /&gt;
== What would a statistician do? ==&lt;br /&gt;
&lt;br /&gt;
If you are interested in statistics, which is only natural if you care for evolution, and you do not know the true model that generates the transitions, then you would want to try to answer the question what ''p'' is. Is ''p&amp;gt;1/2''? Then having the gene is good for reproduction. Is ''p&amp;lt;1/2''? Then not. &lt;br /&gt;
&lt;br /&gt;
Is ''p=1/2''? Then it is good nor bad. So how do we find out? Well, the thing with statistics is that you will never find out for sure. All we can do is try to find ways to estimate this ''p'', or design tests on if and how ''p'' differs from ''1/2'', that will help us make statements about the true model with some confidence. Here are a few such statements.&lt;br /&gt;
&lt;br /&gt;
===Estimation of p===&lt;br /&gt;
&lt;br /&gt;
One of the reasons that so many are convinced of the value of the Price equation is that it ''almost'' hits the nail on the head (even though it misses the head completely). So here we go with what sometimes feels as an indication that the Price equation is not so wrong after all. If you sense this in yourself, just return to the interactive part above.&lt;br /&gt;
&lt;br /&gt;
If you draw a new generation, then that new generation comes with a &amp;quot;Cov(z,q)&amp;quot; . With probability &amp;lt;math&amp;gt;p^{2}&amp;lt;/math&amp;gt; you draw  two 1's, which implies  &amp;quot;Cov(z,q)&amp;quot;=+1/2. With probability &amp;lt;math&amp;gt;(1-p) ^{2}&amp;lt;/math&amp;gt; you draw  two 0's, which implies &amp;quot;Cov(z,q)&amp;quot;=-1/2. So&amp;quot;Cov(z,q)&amp;quot; is actually a random variable itself, the characteristics of which we can look at. Two natural characteristics are its expected value and its variance. Now the expectation of this so-called variance is, luckily,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}. &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i} }{2}\right] = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=\sum_{z_{1}=0,1,2}\left[ \frac{z_{1}q_{1}}{2}-\frac{q_{1}}{2}\right] &lt;br /&gt;
\mathbb{P}\left( Z_{1}=z_{1}\right) = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=-\frac{1}{2}\cdot \left( 1-p\right) ^{2}+0\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot p^{2}=p-\frac{1}{2}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the realisation varies quite a bit, as we have seen in interactive part above. This is reflected in the variance of &amp;quot;Cov(z,q)&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] = \frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \left( ^{\prime \prime }Cov\left( z,q\right) ^{\prime&lt;br /&gt;
\prime }\right) ^{2}\right] -\mathbb{E}^{2}\left[ \left( ^{\prime \prime}Cov\left( z,q\right) ^{\prime \prime }\right) \right] =\frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This variance can be reduced though if we take a large sample. Suppose that we have individuals ''i=1,...,n'' with the gene, and individuals ''i=n+1,...,2n''&lt;br /&gt;
without it. Now we draw the next generation in the same way as before, which looks a bit more general; ''2n'' individuals are drawn, and at every draw&lt;br /&gt;
individual ''i'' has a probability with which it is drawn to reproduce. For ''i=1,...,n'' this probability is &amp;lt;math&amp;gt;\frac{p_{1}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
For ''i=n+1,...,2n'' this probability is &amp;lt;math&amp;gt;\frac{p_{0}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. For this transition, one can show that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =p-\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\lim_{n\rightarrow \infty }Var\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we indeed define &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime \prime }Cov\left( z,q\right)^{\prime \prime }&amp;lt;/math&amp;gt;  as &amp;lt;math&amp;gt;\frac{1}{2n}\left(\sum_{i=1}^{2n}z_{i}q_{i}- \sum_{i=1}^{2n}q_{i}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }+\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is an unbiased estimator of ''p'' - because &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The quantity &amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }&amp;lt;/math&amp;gt; is also regularly referred to as the ''sample'' covariance, which is not the true covariance (the covariance is a fixed property of two random variables, the sample covariance is a random variable itself).&lt;br /&gt;
&lt;br /&gt;
===Testing properties of p ===&lt;br /&gt;
&lt;br /&gt;
The ''sample'' covariance is typically also used as input for in tests of the type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{0} : p=\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{1} : p\neq \frac{1}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here?== &lt;br /&gt;
&lt;br /&gt;
Not. For determining the properties of the model, the Price equation did not help, and in fact cannot even be of use. We found the transition&lt;br /&gt;
probabilities just by doing probability calculations. For doing statistics the Price equation did not help either. And yes, the Price equation applied to one actual draw does have the sample covariance of that draw in it, and the sample covariance is a useful thing, but we do not need the Price&lt;br /&gt;
equation for knowing that the sample covariance is useful. The sample covariance has been around since the 1880's, when Karl Pearson (1857 – 1936) introduced it, along with the distinction between covariance and sample covariance. It was there well before George Price&lt;br /&gt;
was born, and it is used in parameter estimation and hypothesis testing in all other fields of science, where no one has ever heard of G.R. Price. And, most importantly, using the sample covariance is obviously not the same as using the Price equation. It is using the sample covariance.&lt;/div&gt;</description>
			<pubDate>Mon, 27 Sep 2010 08:46:30 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_1.0</comments>		</item>
		<item>
			<title>Price 1.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_1.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* What would a probability theorist do? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A very simple model ==&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 2 individuals. We depart from a  population in which individual no 1 has &amp;quot;the&amp;quot; gene, while the other, individual no 2, does not. In Price equation terms, that means that the variable &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt;, which denotes the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; becomes: &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The next generation of 2 individuals is drawn in a very simple way. First we draw the first, and then we draw the second. That makes it a Wright-Fisher process. At both draws the new individual could be the offspring of individual no 1 or of individual no 2. Reproduction is asexual, hence the offspring is a perfect copy of its parent. Now here comes the important thing. We assume that at both draws, the probability of no 1 from the parent population - the one with the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt;, while the probability of no 2 from the parent population - the one without the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;1-p&amp;lt;/math&amp;gt;. That gives us four possible transitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Price1Setting.jpg|400px|center|thumb|Four possible transitions]]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What the new generation will be is a random variable. What the current generation is, is not; the current generation is simply given. We can however think of a ''hypothetical'' chance experiment such that, in combination with the actual random transition, we get two random variables, between which we can define a covariance. So here is the recipe. &lt;br /&gt;
&lt;br /&gt;
1) Draw one of the individuals from the parent population (this is the hypothetical random variable).&lt;br /&gt;
&lt;br /&gt;
2) Draw the next generation (this is the actual random thing that happens in the the transition).&lt;br /&gt;
&lt;br /&gt;
The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is now defined as the genotype of the parent. That is a simple, albeit hypothetical random variable: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left(&lt;br /&gt;
X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt;, which is the number of offspring that the parent that has been drawn begets. This is a slightly more complicated random variable, because the chances depend on which one of the two possible parents has been chosen. So we get a (not too long) list of conditional probabilities. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=0 | X=0\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1 | X=0\right) = 2p \left( 1-p\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=2 | X=0\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The other conditional probabilities are the reverse, because the parent of a new individual is the one if it is not the other, and vice versa.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=0|X=1\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1|X=1\right) =2p\left( 1-p\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=2|X=1\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  &amp;lt;math&amp;gt;X &amp;lt;/math&amp;gt; and  &amp;lt;math&amp;gt;Y &amp;lt;/math&amp;gt; are pretty well defined, so we can also compute the covariance of these two actual random variables.&lt;br /&gt;
&lt;br /&gt;
Let us first look at expectations...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{E}\left[ X\right]=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ X\right] =\sum_{x=0,1}x\mathbb{P}\left( X=x\right) =\mathbb{P}\left( X=1\right) =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For obvious symmetry reasons, the expectation of &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; is 1; the total number of offspring is 2, and either one could be the parent, so ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =1&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =\sum_{x=0,1}\sum_{y=0,1,2}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{y=1,2}\sum_{x=0,1}y\mathbb{P}\left( X=x\right) \mathbb{P}\left(Y=y|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \left( \frac{1}{2}\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot 2p\left( 1-p\right) \right) +2\cdot \left( \frac{1}{2}\cdot p^{2}+\frac{1}{2}\cdot \left( 1-p\right) ^{2}\right) = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
... and ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] = p &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,1}\sum_{y=0,1,2}xy\mathbb{P}\left( X=x,Y=y\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(because &amp;lt;math&amp;gt;xy=0&amp;lt;/math&amp;gt; if either &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;y=0&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\sum_{x=1}\sum_{y=1,2}xy\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1,Y=1\right) +2\cdot \mathbb{P}\left(X=1,Y=2\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1\right) \cdot \mathbb{P}\left(Y=1|X=1\right) +2\cdot \mathbb{P}\left( X=1\right) \mathbb{P}\left(Y=2|X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \frac{1}{2}\cdot 2p\left( 1-p\right) +2\cdot \frac{1}{2}\cdot p^{2}= &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=p\left( 1-p\right) +p^{2}= p&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance is then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] &lt;br /&gt;
\mathbb{E}\left[ Y\right] =p-\frac{1}{2}\cdot 1=p-\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this very simple model ==&lt;br /&gt;
&lt;br /&gt;
An interesting question would be: is it good to have the gene? &lt;br /&gt;
&lt;br /&gt;
Or, if we do statistics: suppose we know that the process has this form, but we  don't know the value of ''p''. Then the question becomes: is ''p&amp;gt;1/2'', or, equivalently, is ''Cov( X,Y) &amp;gt;0''? Below we will try to answer that question. But first we will look at what the Price equation does to all of this.&lt;br /&gt;
&lt;br /&gt;
For a given transition, the Price equation constitutes an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N}\sum_{i}q_{i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; (For this particular model this quantity is 0.5).&lt;br /&gt;
&lt;br /&gt;
The frequency of the gene in the offspring population is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation 1.0 then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this simple case for N = 2 this amounts to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i}}{2}\right] &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
The point where confusion starts, is that George Price named the right hand side of this equation ''Cov(z,q)''. The claim of the Price equation - which we contend - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. The central issue here is that this ''Cov(z,q)'' is discussed as if it were a real covariance. Is that correct? &lt;br /&gt;
&lt;br /&gt;
Try yourself!&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial1.Tutorial1.class&amp;quot;  height=&amp;quot;400&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency ''Q'' can go up by 1/2, remain what it is, or go down by 1/2. The value of this so-called ''Covariance'' just follows that change in frequency (and because it is not a real covariance, we will use quotation marks from now on). This creates an illusion of understanding, because whatever happens, the covariance changes along with the outcome of the chance experiment. In other words: '''the data explain the data'''. &lt;br /&gt;
&lt;br /&gt;
This is, of course, not OK; the true and well-defined covariance is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) = p-\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This does not depend on the realisation. Cov(X,Y) defines the properties of the chance experiment, and the realisation of this chance experiment defines &amp;quot;Cov(z,q)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==What would a probability theorist do?==&lt;br /&gt;
&lt;br /&gt;
A probability theorist would try to figure out the transition probabilities for the suggested model. It seems that you are a proper probability theorist, because that is what you just did.  Congrats!&lt;br /&gt;
&lt;br /&gt;
== What would a statistician do? ==&lt;br /&gt;
&lt;br /&gt;
If you are interested in statistics, which is only natural if you care for evolution, and you do not know the true model that generates the transitions, then you would want to try to answer the question what ''p'' is. Is ''p&amp;gt;1/2''? Then having the gene is good for reproduction. Is ''p&amp;lt;1/2''? Then not. &lt;br /&gt;
&lt;br /&gt;
Is ''p=1/2''? Then it is good nor bad. So how do we find out? Well, the thing with statistics is that you will never find out for sure. All we can do is try to find ways to estimate this ''p'', or design tests on if and how ''p'' differs from ''1/2'', that will help us make statements about the true model with some confidence. Here are a few such statements.&lt;br /&gt;
&lt;br /&gt;
===Estimation of p===&lt;br /&gt;
&lt;br /&gt;
One of the reasons that so many are convinced of the value of the Price equation is that it ''almost'' hits the nail on the head (even though it misses the head completely). So here we go with what sometimes feels as an indication that the Price equation is not so wrong after all. If you sense this in yourself, just return to the interactive part above.&lt;br /&gt;
&lt;br /&gt;
If you draw a new generation, then that new generation comes with a &amp;quot;Cov(z,q)&amp;quot; . With probability &amp;lt;math&amp;gt;p^{2}&amp;lt;/math&amp;gt; you draw  two 1's, which implies  &amp;quot;Cov(z,q)&amp;quot;=+1/2. With probability &amp;lt;math&amp;gt;(1-p) ^{2}&amp;lt;/math&amp;gt; you draw  two 0's, which implies &amp;quot;Cov(z,q)&amp;quot;=-1/2. So&amp;quot;Cov(z,q)&amp;quot; is actually a random variable itself, the characteristics of which we can look at. Two natural characteristics are its expected value and its variance. Now the expectation of this so-called variance is, luckily,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}. &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i} }{2}\right] = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=\sum_{z_{1}=0,1,2}\left[ \frac{z_{1}q_{1}}{2}-\frac{q_{1}}{2}\right] &lt;br /&gt;
\mathbb{P}\left( Z_{1}=z_{1}\right) = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=-\frac{1}{2}\cdot \left( 1-p\right) ^{2}+0\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot p^{2}=p-\frac{1}{2}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the realisation varies quite a bit, as we have seen in interactive part above. This is reflected in the variance of &amp;quot;Cov(z,q)&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] = \frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \left( ^{\prime \prime }Cov\left( z,q\right) ^{\prime&lt;br /&gt;
\prime }\right) ^{2}\right] -\mathbb{E}^{2}\left[ \left( ^{\prime \prime}Cov\left( z,q\right) ^{\prime \prime }\right) \right] =\frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This variance can be reduced though if we take a large sample. Suppose that we have individuals ''i=1,...,n'' with the gene, and individuals ''i=n+1,...,2n''&lt;br /&gt;
without it. Now we draw the next generation in the same way as before, which looks a bit more general; ''2n'' individuals are drawn, and at every draw&lt;br /&gt;
individual ''i'' has a probability with which it is drawn to reproduce. For ''i=1,...,n'' this probability is &amp;lt;math&amp;gt;\frac{p_{1}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
For ''i=n+1,...,2n'' this probability is &amp;lt;math&amp;gt;\frac{p_{0}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. For this transition, one can show that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =p-\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\lim_{n\rightarrow \infty }Var\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we indeed define &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime \prime }Cov\left( z,q\right)^{\prime \prime }&amp;lt;/math&amp;gt;  as &amp;lt;math&amp;gt;\frac{1}{2n}\left(\sum_{i=1}^{2n}z_{i}q_{i}- \sum_{i=1}^{2n}q_{i}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }+\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is an unbiased estimator of ''p'' - because &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The quantity &amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }&amp;lt;/math&amp;gt; is also regularly referred to as the ''sample'' covariance, which is not the true covariance (the covariance is a fixed property of two random variables, the sample covariance is a random variable itself).&lt;br /&gt;
&lt;br /&gt;
===Testing properties of p ===&lt;br /&gt;
&lt;br /&gt;
The ''sample'' covariance is typically also used as input for in tests of the type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{0} : p=\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{1} : p\neq \frac{1}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here?== &lt;br /&gt;
&lt;br /&gt;
Not. For determining the properties of the model, the Price equation did not help, and in fact cannot even be of use. We found the transition&lt;br /&gt;
probabilities just by doing probability calculations. For doing statistics the Price equation did not help either. And yes, the Price equation applied to one actual draw does have the sample covariance of that draw in it, and the sample covariance is a useful thing, but we do not need the Price&lt;br /&gt;
equation for knowing that the sample covariance is useful. The sample covariance has been around since the 1880's, when Karl Pearson (1857 – 1936) introduced it, along with the distinction between covariance and sample covariance. It was there well before George Price&lt;br /&gt;
was born, and it is used in parameter estimation and hypothesis testing in all other fields of science, where no one has ever heard of G.R. Price. And, most importantly, using the sample covariance is obviously not the same as using the Price equation. It is using the sample covariance.&lt;/div&gt;</description>
			<pubDate>Mon, 27 Sep 2010 08:24:22 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_1.0</comments>		</item>
		<item>
			<title>Price 1.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_1.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* A very simple model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A very simple model ==&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 2 individuals. We depart from a  population in which individual no 1 has &amp;quot;the&amp;quot; gene, while the other, individual no 2, does not. In Price equation terms, that means that the variable &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt;, which denotes the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; becomes: &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The next generation of 2 individuals is drawn in a very simple way. First we draw the first, and then we draw the second. That makes it a Wright-Fisher process. At both draws the new individual could be the offspring of individual no 1 or of individual no 2. Reproduction is asexual, hence the offspring is a perfect copy of its parent. Now here comes the important thing. We assume that at both draws, the probability of no 1 from the parent population - the one with the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt;, while the probability of no 2 from the parent population - the one without the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;1-p&amp;lt;/math&amp;gt;. That gives us four possible transitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Price1Setting.jpg|400px|center|thumb|Four possible transitions]]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What the new generation will be is a random variable. What the current generation is, is not; the current generation is simply given. We can however think of a ''hypothetical'' chance experiment such that, in combination with the actual random transition, we get two random variables, between which we can define a covariance. So here is the recipe. &lt;br /&gt;
&lt;br /&gt;
1) Draw one of the individuals from the parent population (this is the hypothetical random variable).&lt;br /&gt;
&lt;br /&gt;
2) Draw the next generation (this is the actual random thing that happens in the the transition).&lt;br /&gt;
&lt;br /&gt;
The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is now defined as the genotype of the parent. That is a simple, albeit hypothetical random variable: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left(&lt;br /&gt;
X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt;, which is the number of offspring that the parent that has been drawn begets. This is a slightly more complicated random variable, because the chances depend on which one of the two possible parents has been chosen. So we get a (not too long) list of conditional probabilities. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=0 | X=0\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1 | X=0\right) = 2p \left( 1-p\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=2 | X=0\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The other conditional probabilities are the reverse, because the parent of a new individual is the one if it is not the other, and vice versa.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=0|X=1\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1|X=1\right) =2p\left( 1-p\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=2|X=1\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  &amp;lt;math&amp;gt;X &amp;lt;/math&amp;gt; and  &amp;lt;math&amp;gt;Y &amp;lt;/math&amp;gt; are pretty well defined, so we can also compute the covariance of these two actual random variables.&lt;br /&gt;
&lt;br /&gt;
Let us first look at expectations...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{E}\left[ X\right]=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ X\right] =\sum_{x=0,1}x\mathbb{P}\left( X=x\right) =\mathbb{P}\left( X=1\right) =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For obvious symmetry reasons, the expectation of &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; is 1; the total number of offspring is 2, and either one could be the parent, so ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =1&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =\sum_{x=0,1}\sum_{y=0,1,2}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{y=1,2}\sum_{x=0,1}y\mathbb{P}\left( X=x\right) \mathbb{P}\left(Y=y|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \left( \frac{1}{2}\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot 2p\left( 1-p\right) \right) +2\cdot \left( \frac{1}{2}\cdot p^{2}+\frac{1}{2}\cdot \left( 1-p\right) ^{2}\right) = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
... and ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] = p &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,1}\sum_{y=0,1,2}xy\mathbb{P}\left( X=x,Y=y\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(because &amp;lt;math&amp;gt;xy=0&amp;lt;/math&amp;gt; if either &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;y=0&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\sum_{x=1}\sum_{y=1,2}xy\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1,Y=1\right) +2\cdot \mathbb{P}\left(X=1,Y=2\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1\right) \cdot \mathbb{P}\left(Y=1|X=1\right) +2\cdot \mathbb{P}\left( X=1\right) \mathbb{P}\left(Y=2|X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \frac{1}{2}\cdot 2p\left( 1-p\right) +2\cdot \frac{1}{2}\cdot p^{2}= &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=p\left( 1-p\right) +p^{2}= p&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance is then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] &lt;br /&gt;
\mathbb{E}\left[ Y\right] =p-\frac{1}{2}\cdot 1=p-\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this very simple model ==&lt;br /&gt;
&lt;br /&gt;
An interesting question would be: is it good to have the gene? &lt;br /&gt;
&lt;br /&gt;
Or, if we do statistics: suppose we know that the process has this form, but we  don't know the value of ''p''. Then the question becomes: is ''p&amp;gt;1/2'', or, equivalently, is ''Cov( X,Y) &amp;gt;0''? Below we will try to answer that question. But first we will look at what the Price equation does to all of this.&lt;br /&gt;
&lt;br /&gt;
For a given transition, the Price equation constitutes an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N}\sum_{i}q_{i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; (For this particular model this quantity is 0.5).&lt;br /&gt;
&lt;br /&gt;
The frequency of the gene in the offspring population is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation 1.0 then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this simple case for N = 2 this amounts to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i}}{2}\right] &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
The point where confusion starts, is that George Price named the right hand side of this equation ''Cov(z,q)''. The claim of the Price equation - which we contend - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. The central issue here is that this ''Cov(z,q)'' is discussed as if it were a real covariance. Is that correct? &lt;br /&gt;
&lt;br /&gt;
Try yourself!&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial1.Tutorial1.class&amp;quot;  height=&amp;quot;400&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency ''Q'' can go up by 1/2, remain what it is, or go down by 1/2. The value of this so-called ''Covariance'' just follows that change in frequency (and because it is not a real covariance, we will use quotation marks from now on). This creates an illusion of understanding, because whatever happens, the covariance changes along with the outcome of the chance experiment. In other words: '''the data explain the data'''. &lt;br /&gt;
&lt;br /&gt;
This is, of course, not OK; the true and well-defined covariance is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) = p-\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This does not depend on the realisation. Cov(X,Y) defines the properties of the chance experiment, and the realisation of this chance experiment defines &amp;quot;Cov(z,q)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==What would a probability theorist do?==&lt;br /&gt;
&lt;br /&gt;
Try to figure out the transition probabilities for the suggested model. It seems that you are a proper probability theorist, because that is what you just did.  Congrats!&lt;br /&gt;
&lt;br /&gt;
== What would a statistician do? ==&lt;br /&gt;
&lt;br /&gt;
If you are interested in statistics, which is only natural if you care for evolution, and you do not know the true model that generates the transitions, then you would want to try to answer the question what ''p'' is. Is ''p&amp;gt;1/2''? Then having the gene is good for reproduction. Is ''p&amp;lt;1/2''? Then not. &lt;br /&gt;
&lt;br /&gt;
Is ''p=1/2''? Then it is good nor bad. So how do we find out? Well, the thing with statistics is that you will never find out for sure. All we can do is try to find ways to estimate this ''p'', or design tests on if and how ''p'' differs from ''1/2'', that will help us make statements about the true model with some confidence. Here are a few such statements.&lt;br /&gt;
&lt;br /&gt;
===Estimation of p===&lt;br /&gt;
&lt;br /&gt;
One of the reasons that so many are convinced of the value of the Price equation is that it ''almost'' hits the nail on the head (even though it misses the head completely). So here we go with what sometimes feels as an indication that the Price equation is not so wrong after all. If you sense this in yourself, just return to the interactive part above.&lt;br /&gt;
&lt;br /&gt;
If you draw a new generation, then that new generation comes with a &amp;quot;Cov(z,q)&amp;quot; . With probability &amp;lt;math&amp;gt;p^{2}&amp;lt;/math&amp;gt; you draw  two 1's, which implies  &amp;quot;Cov(z,q)&amp;quot;=+1/2. With probability &amp;lt;math&amp;gt;(1-p) ^{2}&amp;lt;/math&amp;gt; you draw  two 0's, which implies &amp;quot;Cov(z,q)&amp;quot;=-1/2. So&amp;quot;Cov(z,q)&amp;quot; is actually a random variable itself, the characteristics of which we can look at. Two natural characteristics are its expected value and its variance. Now the expectation of this so-called variance is, luckily,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}. &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i} }{2}\right] = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=\sum_{z_{1}=0,1,2}\left[ \frac{z_{1}q_{1}}{2}-\frac{q_{1}}{2}\right] &lt;br /&gt;
\mathbb{P}\left( Z_{1}=z_{1}\right) = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=-\frac{1}{2}\cdot \left( 1-p\right) ^{2}+0\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot p^{2}=p-\frac{1}{2}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the realisation varies quite a bit, as we have seen in interactive part above. This is reflected in the variance of &amp;quot;Cov(z,q)&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] = \frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \left( ^{\prime \prime }Cov\left( z,q\right) ^{\prime&lt;br /&gt;
\prime }\right) ^{2}\right] -\mathbb{E}^{2}\left[ \left( ^{\prime \prime}Cov\left( z,q\right) ^{\prime \prime }\right) \right] =\frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This variance can be reduced though if we take a large sample. Suppose that we have individuals ''i=1,...,n'' with the gene, and individuals ''i=n+1,...,2n''&lt;br /&gt;
without it. Now we draw the next generation in the same way as before, which looks a bit more general; ''2n'' individuals are drawn, and at every draw&lt;br /&gt;
individual ''i'' has a probability with which it is drawn to reproduce. For ''i=1,...,n'' this probability is &amp;lt;math&amp;gt;\frac{p_{1}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
For ''i=n+1,...,2n'' this probability is &amp;lt;math&amp;gt;\frac{p_{0}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. For this transition, one can show that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =p-\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\lim_{n\rightarrow \infty }Var\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we indeed define &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime \prime }Cov\left( z,q\right)^{\prime \prime }&amp;lt;/math&amp;gt;  as &amp;lt;math&amp;gt;\frac{1}{2n}\left(\sum_{i=1}^{2n}z_{i}q_{i}- \sum_{i=1}^{2n}q_{i}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }+\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is an unbiased estimator of ''p'' - because &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The quantity &amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }&amp;lt;/math&amp;gt; is also regularly referred to as the ''sample'' covariance, which is not the true covariance (the covariance is a fixed property of two random variables, the sample covariance is a random variable itself).&lt;br /&gt;
&lt;br /&gt;
===Testing properties of p ===&lt;br /&gt;
&lt;br /&gt;
The ''sample'' covariance is typically also used as input for in tests of the type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{0} : p=\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{1} : p\neq \frac{1}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here?== &lt;br /&gt;
&lt;br /&gt;
Not. For determining the properties of the model, the Price equation did not help, and in fact cannot even be of use. We found the transition&lt;br /&gt;
probabilities just by doing probability calculations. For doing statistics the Price equation did not help either. And yes, the Price equation applied to one actual draw does have the sample covariance of that draw in it, and the sample covariance is a useful thing, but we do not need the Price&lt;br /&gt;
equation for knowing that the sample covariance is useful. The sample covariance has been around since the 1880's, when Karl Pearson (1857 – 1936) introduced it, along with the distinction between covariance and sample covariance. It was there well before George Price&lt;br /&gt;
was born, and it is used in parameter estimation and hypothesis testing in all other fields of science, where no one has ever heard of G.R. Price. And, most importantly, using the sample covariance is obviously not the same as using the Price equation. It is using the sample covariance.&lt;/div&gt;</description>
			<pubDate>Mon, 27 Sep 2010 08:20:09 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_1.0</comments>		</item>
		<item>
			<title>Price 1.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_1.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* A very simple model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A very simple model ==&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 2 individuals. We depart from a  population in which individual no 1 has &amp;quot;the&amp;quot; gene, while the other, individual no 2, does not. In Price equation terms, that means that the variable &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt;, which denotes the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; becomes: &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The next generation of 2 individuals is drawn in a very simple way. First we draw the first, and then we draw the second. That makes it a Wright-Fisher process. At both draws the new individual could be the offspring of individual no 1 or of individual no 2. Reproduction is asexual, hence the offspring is a perfect copy of its parent. Now here comes the important thing. We assume that at both draws, the probability of no 1 from the parent population - the one with the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt;, while the probability of no 2 from the parent population - the one without the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;1-p&amp;lt;/math&amp;gt;. That gives us four possible transitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Price1Setting.jpg|400px|center|thumb|Four possible transitions]]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What the new generation will be is a random variable. What the current generation is, is not; the current generation is simply given. We can however think of a ''hypothetical'' chance experiment such that, in combination with the actual random transition, we get two random variables, between which we can define a covariance. So here is the recipe. &lt;br /&gt;
&lt;br /&gt;
1) Draw one of the individuals from the parent population (this is the hypothetical random variable).&lt;br /&gt;
&lt;br /&gt;
2) Draw the next generation (this is the actual random thing that happens in the the transition).&lt;br /&gt;
&lt;br /&gt;
The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is now defined as the genotype of the parent. That is a simple, albeit hypothetical random variable: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left(&lt;br /&gt;
X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt;, which is the number of offspring that the parent that has been drawn begets. This is a slightly more complicated random variable, because the chances depend on which one of the two possible parents has been chosen. So we get a (not too long) list of conditional probabilities. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=0 | X=0\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1 | X=0\right) = 2p \left( 1-p\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=2 | X=0\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The other conditional probabilities are the reverse, because the parent of a new individual is the one if it is not the other, and vice versa.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=0|X=1\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1|X=1\right) =2p\left( 1-p\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=2|X=1\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  &amp;lt;math&amp;gt;X &amp;lt;/math&amp;gt; and  &amp;lt;math&amp;gt;Y &amp;lt;/math&amp;gt; are pretty well defined, so we can also compute the covariance of these two actual random variables.&lt;br /&gt;
&lt;br /&gt;
Let us first look at expectations...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{E}\left[ X\right]=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ X\right] =\sum_{x=0,1}x\mathbb{P}\left( X=x\right) =\mathbb{P}\left( X=1\right) =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For obvious symmetry reasons; the total number of offspring is 2, and either one could be the parent, so ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =1&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =\sum_{x=0,1}\sum_{y=0,1,2}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{y=1,2}\sum_{x=0,1}y\mathbb{P}\left( X=x\right) \mathbb{P}\left(Y=y|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \left( \frac{1}{2}\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot 2p\left( 1-p\right) \right) +2\cdot \left( \frac{1}{2}\cdot p^{2}+\frac{1}{2}\cdot \left( 1-p\right) ^{2}\right) = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
... and ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] = p &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,1}\sum_{y=0,1,2}xy\mathbb{P}\left( X=x,Y=y\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(because &amp;lt;math&amp;gt;xy=0&amp;lt;/math&amp;gt; if either &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;y=0&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\sum_{x=1}\sum_{y=1,2}xy\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1,Y=1\right) +2\cdot \mathbb{P}\left(X=1,Y=2\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1\right) \cdot \mathbb{P}\left(Y=1|X=1\right) +2\cdot \mathbb{P}\left( X=1\right) \mathbb{P}\left(Y=2|X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \frac{1}{2}\cdot 2p\left( 1-p\right) +2\cdot \frac{1}{2}\cdot p^{2}= &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=p\left( 1-p\right) +p^{2}= p&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance is then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] &lt;br /&gt;
\mathbb{E}\left[ Y\right] =p-\frac{1}{2}\cdot 1=p-\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this very simple model ==&lt;br /&gt;
&lt;br /&gt;
An interesting question would be: is it good to have the gene? &lt;br /&gt;
&lt;br /&gt;
Or, if we do statistics: suppose we know that the process has this form, but we  don't know the value of ''p''. Then the question becomes: is ''p&amp;gt;1/2'', or, equivalently, is ''Cov( X,Y) &amp;gt;0''? Below we will try to answer that question. But first we will look at what the Price equation does to all of this.&lt;br /&gt;
&lt;br /&gt;
For a given transition, the Price equation constitutes an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N}\sum_{i}q_{i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; (For this particular model this quantity is 0.5).&lt;br /&gt;
&lt;br /&gt;
The frequency of the gene in the offspring population is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation 1.0 then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this simple case for N = 2 this amounts to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i}}{2}\right] &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
The point where confusion starts, is that George Price named the right hand side of this equation ''Cov(z,q)''. The claim of the Price equation - which we contend - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. The central issue here is that this ''Cov(z,q)'' is discussed as if it were a real covariance. Is that correct? &lt;br /&gt;
&lt;br /&gt;
Try yourself!&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial1.Tutorial1.class&amp;quot;  height=&amp;quot;400&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency ''Q'' can go up by 1/2, remain what it is, or go down by 1/2. The value of this so-called ''Covariance'' just follows that change in frequency (and because it is not a real covariance, we will use quotation marks from now on). This creates an illusion of understanding, because whatever happens, the covariance changes along with the outcome of the chance experiment. In other words: '''the data explain the data'''. &lt;br /&gt;
&lt;br /&gt;
This is, of course, not OK; the true and well-defined covariance is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) = p-\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This does not depend on the realisation. Cov(X,Y) defines the properties of the chance experiment, and the realisation of this chance experiment defines &amp;quot;Cov(z,q)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==What would a probability theorist do?==&lt;br /&gt;
&lt;br /&gt;
Try to figure out the transition probabilities for the suggested model. It seems that you are a proper probability theorist, because that is what you just did.  Congrats!&lt;br /&gt;
&lt;br /&gt;
== What would a statistician do? ==&lt;br /&gt;
&lt;br /&gt;
If you are interested in statistics, which is only natural if you care for evolution, and you do not know the true model that generates the transitions, then you would want to try to answer the question what ''p'' is. Is ''p&amp;gt;1/2''? Then having the gene is good for reproduction. Is ''p&amp;lt;1/2''? Then not. &lt;br /&gt;
&lt;br /&gt;
Is ''p=1/2''? Then it is good nor bad. So how do we find out? Well, the thing with statistics is that you will never find out for sure. All we can do is try to find ways to estimate this ''p'', or design tests on if and how ''p'' differs from ''1/2'', that will help us make statements about the true model with some confidence. Here are a few such statements.&lt;br /&gt;
&lt;br /&gt;
===Estimation of p===&lt;br /&gt;
&lt;br /&gt;
One of the reasons that so many are convinced of the value of the Price equation is that it ''almost'' hits the nail on the head (even though it misses the head completely). So here we go with what sometimes feels as an indication that the Price equation is not so wrong after all. If you sense this in yourself, just return to the interactive part above.&lt;br /&gt;
&lt;br /&gt;
If you draw a new generation, then that new generation comes with a &amp;quot;Cov(z,q)&amp;quot; . With probability &amp;lt;math&amp;gt;p^{2}&amp;lt;/math&amp;gt; you draw  two 1's, which implies  &amp;quot;Cov(z,q)&amp;quot;=+1/2. With probability &amp;lt;math&amp;gt;(1-p) ^{2}&amp;lt;/math&amp;gt; you draw  two 0's, which implies &amp;quot;Cov(z,q)&amp;quot;=-1/2. So&amp;quot;Cov(z,q)&amp;quot; is actually a random variable itself, the characteristics of which we can look at. Two natural characteristics are its expected value and its variance. Now the expectation of this so-called variance is, luckily,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}. &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i} }{2}\right] = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=\sum_{z_{1}=0,1,2}\left[ \frac{z_{1}q_{1}}{2}-\frac{q_{1}}{2}\right] &lt;br /&gt;
\mathbb{P}\left( Z_{1}=z_{1}\right) = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=-\frac{1}{2}\cdot \left( 1-p\right) ^{2}+0\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot p^{2}=p-\frac{1}{2}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the realisation varies quite a bit, as we have seen in interactive part above. This is reflected in the variance of &amp;quot;Cov(z,q)&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] = \frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \left( ^{\prime \prime }Cov\left( z,q\right) ^{\prime&lt;br /&gt;
\prime }\right) ^{2}\right] -\mathbb{E}^{2}\left[ \left( ^{\prime \prime}Cov\left( z,q\right) ^{\prime \prime }\right) \right] =\frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This variance can be reduced though if we take a large sample. Suppose that we have individuals ''i=1,...,n'' with the gene, and individuals ''i=n+1,...,2n''&lt;br /&gt;
without it. Now we draw the next generation in the same way as before, which looks a bit more general; ''2n'' individuals are drawn, and at every draw&lt;br /&gt;
individual ''i'' has a probability with which it is drawn to reproduce. For ''i=1,...,n'' this probability is &amp;lt;math&amp;gt;\frac{p_{1}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
For ''i=n+1,...,2n'' this probability is &amp;lt;math&amp;gt;\frac{p_{0}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. For this transition, one can show that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =p-\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\lim_{n\rightarrow \infty }Var\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we indeed define &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime \prime }Cov\left( z,q\right)^{\prime \prime }&amp;lt;/math&amp;gt;  as &amp;lt;math&amp;gt;\frac{1}{2n}\left(\sum_{i=1}^{2n}z_{i}q_{i}- \sum_{i=1}^{2n}q_{i}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }+\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is an unbiased estimator of ''p'' - because &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The quantity &amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }&amp;lt;/math&amp;gt; is also regularly referred to as the ''sample'' covariance, which is not the true covariance (the covariance is a fixed property of two random variables, the sample covariance is a random variable itself).&lt;br /&gt;
&lt;br /&gt;
===Testing properties of p ===&lt;br /&gt;
&lt;br /&gt;
The ''sample'' covariance is typically also used as input for in tests of the type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{0} : p=\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{1} : p\neq \frac{1}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here?== &lt;br /&gt;
&lt;br /&gt;
Not. For determining the properties of the model, the Price equation did not help, and in fact cannot even be of use. We found the transition&lt;br /&gt;
probabilities just by doing probability calculations. For doing statistics the Price equation did not help either. And yes, the Price equation applied to one actual draw does have the sample covariance of that draw in it, and the sample covariance is a useful thing, but we do not need the Price&lt;br /&gt;
equation for knowing that the sample covariance is useful. The sample covariance has been around since the 1880's, when Karl Pearson (1857 – 1936) introduced it, along with the distinction between covariance and sample covariance. It was there well before George Price&lt;br /&gt;
was born, and it is used in parameter estimation and hypothesis testing in all other fields of science, where no one has ever heard of G.R. Price. And, most importantly, using the sample covariance is obviously not the same as using the Price equation. It is using the sample covariance.&lt;/div&gt;</description>
			<pubDate>Mon, 27 Sep 2010 08:17:02 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_1.0</comments>		</item>
		<item>
			<title>Main Page</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Main_Page</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;5&amp;quot; style=&amp;quot;width:100%; border:1px solid #A3B1BF; vertical-align:top; background-color:#F5FAFF; color:#000; margin:15px 0 0 0&amp;quot;&lt;br /&gt;
! &amp;lt;h2 style=&amp;quot;margin:0; background-color:#E6E6E6; font-size:14pt; border:1px solid #A3B1BF; text-align:center; color:#000; padding:0.2em 0.4em;&amp;quot;&amp;gt;'''Evolution and Games'''&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;color:#000&amp;quot; | [[Image:wikiBar.jpg|center|665px]]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
We study the evolution of behavior using mathematical and computational models. You will find here a series of tutorials and software related to papers in this area. Use the '''Navigation''' panel on the left side to make your way on the website. &lt;br /&gt;
&lt;br /&gt;
This wiki is mantained by [http://staff.feweb.vu.nl/j.garcia/index.html Julian Garcia]  and [http://www1.fee.uva.nl/creed/people/veelen/index.shtml Matthijs van Veelen].&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{|cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;5&amp;quot; style=&amp;quot;width:100%; border:1px solid #A3B1BF; vertical-align:top; background-color:#F5FAFF; color:#000; margin:15px 0 0 0&amp;quot;&lt;br /&gt;
! &amp;lt;h2 style=&amp;quot;margin:0; background-color:#E6E6E6; font-size:14pt; border:1px solid #A3B1BF; text-align:center; color:#000; padding:0.2em 0.4em;&amp;quot;&amp;gt;'''Available tutorials'''&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[Price|How to quit the Price equation]]'''.&lt;br /&gt;
&lt;br /&gt;
* '''[[Sociality|It takes grouping and cooperation to get sociality]]'''.&lt;br /&gt;
&lt;br /&gt;
* '''[[Parochialism|Evolution of parochial altruism by multilevel selection]]'''.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{|cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;5&amp;quot; style=&amp;quot;width:100%; border:1px solid #A3B1BF; vertical-align:top; background-color:#F5FAFF; color:#000; margin:15px 0 0 0&amp;quot;&lt;br /&gt;
! &amp;lt;h2 style=&amp;quot;margin:0; background-color:#E6E6E6; font-size:14pt; border:1px solid #A3B1BF; text-align:center; color:#000; padding:0.2em 0.4em;&amp;quot;&amp;gt;'''Under construction... '''&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[Construction| In and Out of Equilibrium: Evolution in Repeated Games with Discounting]]'''.&lt;br /&gt;
&lt;br /&gt;
* '''[[Construction|Repeated Games and Population Structure]]'''.&lt;br /&gt;
&lt;br /&gt;
* '''[[Construction | Adaptive Dynamics and Population Structure]]'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{|cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;5&amp;quot; style=&amp;quot;width:100%; border:1px solid #A3B1BF; vertical-align:top; background-color:#F5FAFF; color:#000; margin:15px 0 0 0&amp;quot;&lt;br /&gt;
! &amp;lt;h2 style=&amp;quot;margin:0; background-color:#E6E6E6; font-size:14pt; border:1px solid #A3B1BF; text-align:center; color:#000; padding:0.2em 0.4em;&amp;quot;&amp;gt;'''What do I need in my computer '''&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Most of the software is written in Java 5.0. See [[How to use the software]] for more details. Some parts of this website also require a working applet plugin in your browser.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{|cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;5&amp;quot; style=&amp;quot;width:100%; border:1px solid #A3B1BF; vertical-align:top; background-color:#F5FAFF; color:#000; margin:15px 0 0 0&amp;quot;&lt;br /&gt;
! &amp;lt;h2 style=&amp;quot;margin:0; background-color:#E6E6E6; font-size:14pt; border:1px solid #A3B1BF; text-align:center; color:#000; padding:0.2em 0.4em;&amp;quot;&amp;gt;'''Contact and Info'''&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
[http://staff.feweb.vu.nl/j.garcia/index.html Julián García] : j dot garcia at feweb dot vu dot nl&lt;br /&gt;
&lt;br /&gt;
[http://www1.fee.uva.nl/creed/people/veelen/index.shtml Matthijs van Veelen] c dot m dot veelen at uva dot nl&lt;br /&gt;
&lt;br /&gt;
This website has been kindly funded by [http://www1.fee.uva.nl/creed/ CREED - University of Amsterdam]&lt;br /&gt;
&lt;br /&gt;
This website was inspired by [http://www.univie.ac.at/virtuallabs/ Virtual Labs] by Christoph Hauert and Karl Sigmund.  &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 11:13:47 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Main_Page</comments>		</item>
		<item>
			<title>Price 3.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_3.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* What would a proper statistician do? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A model with frequency dependence ==&lt;br /&gt;
&lt;br /&gt;
We go back to the asexual model, but now we will take a model with frequency dependence. This will be a bit more complicated, but we can still use a basic, well known model. Suppose there are $N$ individuals. They are paired randomly, and play a game in those pairs. The game gives them payoffs according to the following payoff matrix&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{ccc}&lt;br /&gt;
&amp;amp; A &amp;amp; B \\ &lt;br /&gt;
A &amp;amp; 1 &amp;amp; 0 \\ &lt;br /&gt;
B &amp;amp; 0 &amp;amp; 1&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;q_{i}=1&amp;lt;/math&amp;gt;, then that means that individual $i$ plays strategy &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;q_{i}=0&amp;lt;/math&amp;gt; means that individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; plays strategy &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;. Depending on the match, each individual gets a payoff &amp;lt;math&amp;gt;\pi _{i}&amp;lt;/math&amp;gt;. The next generation&lt;br /&gt;
is drawn, as before, one individual at a time. But now the probability that &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; is drawn as a parent depends on the payoff, and not just on the own genotype.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{P}\left( i\text{ is chosen}\right) =\frac{\alpha \pi _{i}+\beta }{\sum_{j=1}^{N}\left( \alpha \pi _{j}+\beta \right) } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We do the same procedure as before, but with a few different starting points.&lt;br /&gt;
&lt;br /&gt;
== An ''A'' mutant in a population of ''B'''s  ==&lt;br /&gt;
&lt;br /&gt;
Suppose &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;q_{i}=0&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;i=2,...,N&amp;lt;/math&amp;gt;. The probability of any individual &amp;lt;math&amp;gt;i=2,...,N&amp;lt;/math&amp;gt; to be matched with individual &amp;lt;math&amp;gt;1&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;1/(N-1)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The probability with which an individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{i}=1&amp;lt;/math&amp;gt;, who is matched to an individual &amp;lt;math&amp;gt;j&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{j}=0&amp;lt;/math&amp;gt;,  is chosen is:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
p_{1,0,1}=\frac{\beta }{\left( N-2\right) \alpha +N\beta } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The probability with which an individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{i}=0&amp;lt;/math&amp;gt;, who is matched to an individual &amp;lt;math&amp;gt;j&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{j}=0&amp;lt;/math&amp;gt;,  is chosen is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
p_{0,0,1}=\frac{\alpha +\beta }{\left( N-2\right) \alpha +N\beta } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The probability with which an individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{i}=0&amp;lt;/math&amp;gt;, who is matched to an individual &amp;lt;math&amp;gt;j&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{j}=1&amp;lt;/math&amp;gt;,  is chosen is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
p_{0,1,1}=\frac{\beta }{\left( N-2\right) \alpha +N\beta } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can also compute the covariance of these two actual random variables. Let us start by computing expectations...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\frac{1}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\sum_{x=0,1}x\mathbb{P}\left( X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\mathbb{P}\left( X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For symmetry reasons...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ Y\right] =1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ XY\right] =\frac{\beta }{\left( N-2\right) \alpha +N\beta }&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,1}\sum_{y=0}^{N}xy\mathbb{P}\left(X=x,Y=y\right) \text{ (because }xy=0\text{ if either }x=0\text{ or }y=0\text{)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{y=0}^{N}y\mathbb{P}\left( X=1,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{k=0}^{N}y\mathbb{P}\left( X=1\right) \mathbb{P}\left(Y=k|X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{N}\sum_{k=0}^{N}k\binom{N}{k}\left( p_{1,0,1}\right) ^{k}\left(1-p_{1,0,1}\right) ^{N-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=p_{1,0,1}= &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\beta }{\left( N-2\right) \alpha +N\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Covariance is thus...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right]  \mathbb{E}\left[ Y\right] =\frac{\beta }{\left( N-2\right) \alpha +N\beta }-\frac{1}{N} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A ''B'' mutant in a population of ''A'''s  ==&lt;br /&gt;
&lt;br /&gt;
Suppose &amp;lt;math&amp;gt;q_{1}=0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;q_{i}=1&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;i=2,...,N&amp;lt;/math&amp;gt;. The probability of any individual &amp;lt;math&amp;gt;i=2,...,N&amp;lt;/math&amp;gt; to be matched with individual &amp;lt;math&amp;gt;1&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;1/(N-1)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The probability with which an individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{i}=0&amp;lt;/math&amp;gt;, who is matched to an individual &amp;lt;math&amp;gt;j&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{j}=1&amp;lt;/math&amp;gt;...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{0,1,N-1}=\frac{\beta }{\left( N-2\right) \alpha +N\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The probability with which an individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{i}=1&amp;lt;/math&amp;gt;, who is matched to an individual &amp;lt;math&amp;gt;j&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{j}=1&amp;lt;/math&amp;gt;...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
p_{1,1,N-1}=\frac{\alpha +\beta }{\left( N-2\right) \alpha +N\beta } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The probability with which an individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{i}=1&amp;lt;/math&amp;gt;, who is matched to an individual &amp;lt;math&amp;gt;j&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{j}=0&amp;lt;/math&amp;gt;...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
p_{1,0,N-1}=\frac{\beta }{\left( N-2\right) \alpha +N\beta } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=0\right) =\binom{N}{k}\left( p_{0,1,N-1}\right)^{k}\left( 1-p_{0,1,N-1}\right) ^{N-k}=&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=1\right) =\frac{1}{N-1}\binom{N}{k}\left(p_{1,0,N-1}\right) ^{k}\left( 1-p_{1,0,N-1}\right) ^{N-k}+\frac{N-2}{N-1}\binom{N}{k}\left( p_{1,1,N-1}\right) ^{k}\left( 1-p_{1,1,N-1}\right) ^{N-k}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is pretty well defined, so we can also compute the covariance of these two actual random variables. Let us start with the expectations...&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\frac{N-1}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\sum_{x=0,1}x\mathbb{P}\left( X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\mathbb{P}\left( X=1\right) = \frac{N-1}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For symmetry reasons...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ Y\right] =1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] = \frac{\left( N-2\right) \alpha +\left( N-1\right) \beta }{\left(N-2\right) \alpha +N\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,1}\sum_{y=0}^{N}xy\mathbb{P}\left(X=x,Y=y\right) \text{ (because }xy=0\text{ if either }x=0\text{ or }y=0\text{)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{y=0}^{N}y\mathbb{P}\left( X=1,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{k=0}^{N}y\mathbb{P}\left( X=1\right) \mathbb{P}\left(Y=k|X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N-1}{N}\sum_{k=0}^{N}\left[ \frac{1}{N-1}k\binom{N}{k}\left(p_{1,0,N-1}\right) ^{k}\left( 1-p_{1,0,N-1}\right) ^{N-k}+\frac{N-2}{N-1}k\binom{N}{k}\left( p_{1,1,N-1}\right) ^{k}\left( 1-p_{1,1,N-1}\right) ^{N-k}\right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=p_{1,0,N-1}+\left( N-2\right) p_{1,1,N-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\beta }{\left( N-2\right) \alpha +N\beta }+\left( N-2\right) \frac{\alpha +\beta }{\left( N-2\right) \alpha +N\beta }= &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\left( N-2\right) \alpha +\left( N-1\right) \beta }{\left(N-2\right) \alpha +N\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] \mathbb{E}\left[ Y\right] =\frac{\left( N-2\right) \alpha +\left( N-1\right)\beta }{\left( N-2\right) \alpha +N\beta }-\frac{N-1}{N} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comparing the two covariances == &lt;br /&gt;
&lt;br /&gt;
If we compare these two covariances, for instance for &amp;lt;math&amp;gt;\beta =0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\alpha =1&amp;lt;/math&amp;gt;, then in the first case &amp;lt;math&amp;gt;Cov(X,Y) =-1/N&amp;lt;/math&amp;gt;, while in the second case &amp;lt;math&amp;gt;Cov( X,Y) =+1/N&amp;lt;/math&amp;gt;. This should not feel strange; it is a coordination game, and if everyone plays &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;, then playing &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; is a bad idea, but if everyone else plays &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; too, then playing &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; is  a good idea. The model covariance is therefore not constant, and changes with the frequency of strategy &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this very simple model ==&lt;br /&gt;
&lt;br /&gt;
Here we have a nested sampling procedure; you can choose a starting point (by clicking on each individual in the parent population), keep it fixed, and draw a few transitions. Then change your starting point, and draw a few transitions from there. You will notice that the Price equation varies with every transition, along with the ''likelyhood'' of the different transitions that depend on the initial population.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial3.Tutorial3.class&amp;quot;  height=&amp;quot;480&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What would a probability theorist do? == &lt;br /&gt;
&lt;br /&gt;
Try to figure out the transition probabilities for the suggested model as a function of the current state.&lt;br /&gt;
&lt;br /&gt;
== What would a statistician do? ==&lt;br /&gt;
&lt;br /&gt;
Sample often for different starting points. Fit data to the model, estimate &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\beta &amp;lt;/math&amp;gt;. Test if the payoff matrix is as assumed.&lt;br /&gt;
&lt;br /&gt;
==  So how does the Price equation help here? ==&lt;br /&gt;
&lt;br /&gt;
Not. Can't think of anything remotely useful about the Price equation. The extra problem here is the frequency dependence. Sometimes this is referred&lt;br /&gt;
to as the problem that the Price Equation is not dynamically sufficient. That is a step in the right direction, but still inaccurate, because it only describes one of the symptoms, and not the cause. It is the ''model'' we have here that gives us, after a bit of computing, the transition probabilities for all  frequencies of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, and thereby all properties of the dynamical system. The ''models'' in versions 1.0 and 2.0 just concerned transitions leaving from one given starting point. A ''model'' can therefore be described as dynamically sufficient or insufficient. Because the Price equation can only deal with one step at at time, it tends to inspire people to think of implicit assumptions that pertain to dynamically insufficient models. That, however, does not mean that the Price Equation cannot be used in combination with a dynamically sufficient model. It can; as shown in the applet above. But the question is: used for what? And the answer is: for nothing.&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 11:08:32 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_3.0</comments>		</item>
		<item>
			<title>Price 3.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_3.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* What would a probability theorist do? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A model with frequency dependence ==&lt;br /&gt;
&lt;br /&gt;
We go back to the asexual model, but now we will take a model with frequency dependence. This will be a bit more complicated, but we can still use a basic, well known model. Suppose there are $N$ individuals. They are paired randomly, and play a game in those pairs. The game gives them payoffs according to the following payoff matrix&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{ccc}&lt;br /&gt;
&amp;amp; A &amp;amp; B \\ &lt;br /&gt;
A &amp;amp; 1 &amp;amp; 0 \\ &lt;br /&gt;
B &amp;amp; 0 &amp;amp; 1&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;q_{i}=1&amp;lt;/math&amp;gt;, then that means that individual $i$ plays strategy &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;q_{i}=0&amp;lt;/math&amp;gt; means that individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; plays strategy &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;. Depending on the match, each individual gets a payoff &amp;lt;math&amp;gt;\pi _{i}&amp;lt;/math&amp;gt;. The next generation&lt;br /&gt;
is drawn, as before, one individual at a time. But now the probability that &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; is drawn as a parent depends on the payoff, and not just on the own genotype.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{P}\left( i\text{ is chosen}\right) =\frac{\alpha \pi _{i}+\beta }{\sum_{j=1}^{N}\left( \alpha \pi _{j}+\beta \right) } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We do the same procedure as before, but with a few different starting points.&lt;br /&gt;
&lt;br /&gt;
== An ''A'' mutant in a population of ''B'''s  ==&lt;br /&gt;
&lt;br /&gt;
Suppose &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;q_{i}=0&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;i=2,...,N&amp;lt;/math&amp;gt;. The probability of any individual &amp;lt;math&amp;gt;i=2,...,N&amp;lt;/math&amp;gt; to be matched with individual &amp;lt;math&amp;gt;1&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;1/(N-1)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The probability with which an individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{i}=1&amp;lt;/math&amp;gt;, who is matched to an individual &amp;lt;math&amp;gt;j&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{j}=0&amp;lt;/math&amp;gt;,  is chosen is:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
p_{1,0,1}=\frac{\beta }{\left( N-2\right) \alpha +N\beta } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The probability with which an individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{i}=0&amp;lt;/math&amp;gt;, who is matched to an individual &amp;lt;math&amp;gt;j&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{j}=0&amp;lt;/math&amp;gt;,  is chosen is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
p_{0,0,1}=\frac{\alpha +\beta }{\left( N-2\right) \alpha +N\beta } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The probability with which an individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{i}=0&amp;lt;/math&amp;gt;, who is matched to an individual &amp;lt;math&amp;gt;j&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{j}=1&amp;lt;/math&amp;gt;,  is chosen is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
p_{0,1,1}=\frac{\beta }{\left( N-2\right) \alpha +N\beta } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can also compute the covariance of these two actual random variables. Let us start by computing expectations...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\frac{1}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\sum_{x=0,1}x\mathbb{P}\left( X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\mathbb{P}\left( X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For symmetry reasons...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ Y\right] =1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ XY\right] =\frac{\beta }{\left( N-2\right) \alpha +N\beta }&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,1}\sum_{y=0}^{N}xy\mathbb{P}\left(X=x,Y=y\right) \text{ (because }xy=0\text{ if either }x=0\text{ or }y=0\text{)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{y=0}^{N}y\mathbb{P}\left( X=1,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{k=0}^{N}y\mathbb{P}\left( X=1\right) \mathbb{P}\left(Y=k|X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{N}\sum_{k=0}^{N}k\binom{N}{k}\left( p_{1,0,1}\right) ^{k}\left(1-p_{1,0,1}\right) ^{N-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=p_{1,0,1}= &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\beta }{\left( N-2\right) \alpha +N\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Covariance is thus...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right]  \mathbb{E}\left[ Y\right] =\frac{\beta }{\left( N-2\right) \alpha +N\beta }-\frac{1}{N} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A ''B'' mutant in a population of ''A'''s  ==&lt;br /&gt;
&lt;br /&gt;
Suppose &amp;lt;math&amp;gt;q_{1}=0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;q_{i}=1&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;i=2,...,N&amp;lt;/math&amp;gt;. The probability of any individual &amp;lt;math&amp;gt;i=2,...,N&amp;lt;/math&amp;gt; to be matched with individual &amp;lt;math&amp;gt;1&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;1/(N-1)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The probability with which an individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{i}=0&amp;lt;/math&amp;gt;, who is matched to an individual &amp;lt;math&amp;gt;j&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{j}=1&amp;lt;/math&amp;gt;...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{0,1,N-1}=\frac{\beta }{\left( N-2\right) \alpha +N\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The probability with which an individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{i}=1&amp;lt;/math&amp;gt;, who is matched to an individual &amp;lt;math&amp;gt;j&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{j}=1&amp;lt;/math&amp;gt;...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
p_{1,1,N-1}=\frac{\alpha +\beta }{\left( N-2\right) \alpha +N\beta } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The probability with which an individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{i}=1&amp;lt;/math&amp;gt;, who is matched to an individual &amp;lt;math&amp;gt;j&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{j}=0&amp;lt;/math&amp;gt;...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
p_{1,0,N-1}=\frac{\beta }{\left( N-2\right) \alpha +N\beta } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=0\right) =\binom{N}{k}\left( p_{0,1,N-1}\right)^{k}\left( 1-p_{0,1,N-1}\right) ^{N-k}=&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=1\right) =\frac{1}{N-1}\binom{N}{k}\left(p_{1,0,N-1}\right) ^{k}\left( 1-p_{1,0,N-1}\right) ^{N-k}+\frac{N-2}{N-1}\binom{N}{k}\left( p_{1,1,N-1}\right) ^{k}\left( 1-p_{1,1,N-1}\right) ^{N-k}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is pretty well defined, so we can also compute the covariance of these two actual random variables. Let us start with the expectations...&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\frac{N-1}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\sum_{x=0,1}x\mathbb{P}\left( X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\mathbb{P}\left( X=1\right) = \frac{N-1}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For symmetry reasons...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ Y\right] =1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] = \frac{\left( N-2\right) \alpha +\left( N-1\right) \beta }{\left(N-2\right) \alpha +N\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,1}\sum_{y=0}^{N}xy\mathbb{P}\left(X=x,Y=y\right) \text{ (because }xy=0\text{ if either }x=0\text{ or }y=0\text{)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{y=0}^{N}y\mathbb{P}\left( X=1,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{k=0}^{N}y\mathbb{P}\left( X=1\right) \mathbb{P}\left(Y=k|X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N-1}{N}\sum_{k=0}^{N}\left[ \frac{1}{N-1}k\binom{N}{k}\left(p_{1,0,N-1}\right) ^{k}\left( 1-p_{1,0,N-1}\right) ^{N-k}+\frac{N-2}{N-1}k\binom{N}{k}\left( p_{1,1,N-1}\right) ^{k}\left( 1-p_{1,1,N-1}\right) ^{N-k}\right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=p_{1,0,N-1}+\left( N-2\right) p_{1,1,N-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\beta }{\left( N-2\right) \alpha +N\beta }+\left( N-2\right) \frac{\alpha +\beta }{\left( N-2\right) \alpha +N\beta }= &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\left( N-2\right) \alpha +\left( N-1\right) \beta }{\left(N-2\right) \alpha +N\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] \mathbb{E}\left[ Y\right] =\frac{\left( N-2\right) \alpha +\left( N-1\right)\beta }{\left( N-2\right) \alpha +N\beta }-\frac{N-1}{N} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comparing the two covariances == &lt;br /&gt;
&lt;br /&gt;
If we compare these two covariances, for instance for &amp;lt;math&amp;gt;\beta =0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\alpha =1&amp;lt;/math&amp;gt;, then in the first case &amp;lt;math&amp;gt;Cov(X,Y) =-1/N&amp;lt;/math&amp;gt;, while in the second case &amp;lt;math&amp;gt;Cov( X,Y) =+1/N&amp;lt;/math&amp;gt;. This should not feel strange; it is a coordination game, and if everyone plays &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;, then playing &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; is a bad idea, but if everyone else plays &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; too, then playing &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; is  a good idea. The model covariance is therefore not constant, and changes with the frequency of strategy &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this very simple model ==&lt;br /&gt;
&lt;br /&gt;
Here we have a nested sampling procedure; you can choose a starting point (by clicking on each individual in the parent population), keep it fixed, and draw a few transitions. Then change your starting point, and draw a few transitions from there. You will notice that the Price equation varies with every transition, along with the ''likelyhood'' of the different transitions that depend on the initial population.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial3.Tutorial3.class&amp;quot;  height=&amp;quot;480&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What would a probability theorist do? == &lt;br /&gt;
&lt;br /&gt;
Try to figure out the transition probabilities for the suggested model as a function of the current state.&lt;br /&gt;
&lt;br /&gt;
== What would a proper statistician do? ==&lt;br /&gt;
&lt;br /&gt;
Sample often for different starting points. Fit data to the model, estimate &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\beta &amp;lt;/math&amp;gt;. Test if the payoff matrix is as assumed.&lt;br /&gt;
&lt;br /&gt;
==  So how does the Price equation help here? ==&lt;br /&gt;
&lt;br /&gt;
Not. Can't think of anything remotely useful about the Price equation. The extra problem here is the frequency dependence. Sometimes this is referred&lt;br /&gt;
to as the problem that the Price Equation is not dynamically sufficient. That is a step in the right direction, but still inaccurate, because it only describes one of the symptoms, and not the cause. It is the ''model'' we have here that gives us, after a bit of computing, the transition probabilities for all  frequencies of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, and thereby all properties of the dynamical system. The ''models'' in versions 1.0 and 2.0 just concerned transitions leaving from one given starting point. A ''model'' can therefore be described as dynamically sufficient or insufficient. Because the Price equation can only deal with one step at at time, it tends to inspire people to think of implicit assumptions that pertain to dynamically insufficient models. That, however, does not mean that the Price Equation cannot be used in combination with a dynamically sufficient model. It can; as shown in the applet above. But the question is: used for what? And the answer is: for nothing.&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 11:08:23 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_3.0</comments>		</item>
		<item>
			<title>Price 3.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_3.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* What would a proper probability theorist do? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A model with frequency dependence ==&lt;br /&gt;
&lt;br /&gt;
We go back to the asexual model, but now we will take a model with frequency dependence. This will be a bit more complicated, but we can still use a basic, well known model. Suppose there are $N$ individuals. They are paired randomly, and play a game in those pairs. The game gives them payoffs according to the following payoff matrix&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{ccc}&lt;br /&gt;
&amp;amp; A &amp;amp; B \\ &lt;br /&gt;
A &amp;amp; 1 &amp;amp; 0 \\ &lt;br /&gt;
B &amp;amp; 0 &amp;amp; 1&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;q_{i}=1&amp;lt;/math&amp;gt;, then that means that individual $i$ plays strategy &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;q_{i}=0&amp;lt;/math&amp;gt; means that individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; plays strategy &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;. Depending on the match, each individual gets a payoff &amp;lt;math&amp;gt;\pi _{i}&amp;lt;/math&amp;gt;. The next generation&lt;br /&gt;
is drawn, as before, one individual at a time. But now the probability that &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; is drawn as a parent depends on the payoff, and not just on the own genotype.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{P}\left( i\text{ is chosen}\right) =\frac{\alpha \pi _{i}+\beta }{\sum_{j=1}^{N}\left( \alpha \pi _{j}+\beta \right) } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We do the same procedure as before, but with a few different starting points.&lt;br /&gt;
&lt;br /&gt;
== An ''A'' mutant in a population of ''B'''s  ==&lt;br /&gt;
&lt;br /&gt;
Suppose &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;q_{i}=0&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;i=2,...,N&amp;lt;/math&amp;gt;. The probability of any individual &amp;lt;math&amp;gt;i=2,...,N&amp;lt;/math&amp;gt; to be matched with individual &amp;lt;math&amp;gt;1&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;1/(N-1)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The probability with which an individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{i}=1&amp;lt;/math&amp;gt;, who is matched to an individual &amp;lt;math&amp;gt;j&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{j}=0&amp;lt;/math&amp;gt;,  is chosen is:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
p_{1,0,1}=\frac{\beta }{\left( N-2\right) \alpha +N\beta } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The probability with which an individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{i}=0&amp;lt;/math&amp;gt;, who is matched to an individual &amp;lt;math&amp;gt;j&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{j}=0&amp;lt;/math&amp;gt;,  is chosen is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
p_{0,0,1}=\frac{\alpha +\beta }{\left( N-2\right) \alpha +N\beta } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The probability with which an individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{i}=0&amp;lt;/math&amp;gt;, who is matched to an individual &amp;lt;math&amp;gt;j&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{j}=1&amp;lt;/math&amp;gt;,  is chosen is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
p_{0,1,1}=\frac{\beta }{\left( N-2\right) \alpha +N\beta } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can also compute the covariance of these two actual random variables. Let us start by computing expectations...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\frac{1}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\sum_{x=0,1}x\mathbb{P}\left( X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\mathbb{P}\left( X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For symmetry reasons...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ Y\right] =1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ XY\right] =\frac{\beta }{\left( N-2\right) \alpha +N\beta }&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,1}\sum_{y=0}^{N}xy\mathbb{P}\left(X=x,Y=y\right) \text{ (because }xy=0\text{ if either }x=0\text{ or }y=0\text{)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{y=0}^{N}y\mathbb{P}\left( X=1,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{k=0}^{N}y\mathbb{P}\left( X=1\right) \mathbb{P}\left(Y=k|X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{N}\sum_{k=0}^{N}k\binom{N}{k}\left( p_{1,0,1}\right) ^{k}\left(1-p_{1,0,1}\right) ^{N-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=p_{1,0,1}= &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\beta }{\left( N-2\right) \alpha +N\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Covariance is thus...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right]  \mathbb{E}\left[ Y\right] =\frac{\beta }{\left( N-2\right) \alpha +N\beta }-\frac{1}{N} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A ''B'' mutant in a population of ''A'''s  ==&lt;br /&gt;
&lt;br /&gt;
Suppose &amp;lt;math&amp;gt;q_{1}=0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;q_{i}=1&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;i=2,...,N&amp;lt;/math&amp;gt;. The probability of any individual &amp;lt;math&amp;gt;i=2,...,N&amp;lt;/math&amp;gt; to be matched with individual &amp;lt;math&amp;gt;1&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;1/(N-1)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The probability with which an individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{i}=0&amp;lt;/math&amp;gt;, who is matched to an individual &amp;lt;math&amp;gt;j&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{j}=1&amp;lt;/math&amp;gt;...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{0,1,N-1}=\frac{\beta }{\left( N-2\right) \alpha +N\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The probability with which an individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{i}=1&amp;lt;/math&amp;gt;, who is matched to an individual &amp;lt;math&amp;gt;j&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{j}=1&amp;lt;/math&amp;gt;...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
p_{1,1,N-1}=\frac{\alpha +\beta }{\left( N-2\right) \alpha +N\beta } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The probability with which an individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{i}=1&amp;lt;/math&amp;gt;, who is matched to an individual &amp;lt;math&amp;gt;j&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;q_{j}=0&amp;lt;/math&amp;gt;...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
p_{1,0,N-1}=\frac{\beta }{\left( N-2\right) \alpha +N\beta } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=0\right) =\binom{N}{k}\left( p_{0,1,N-1}\right)^{k}\left( 1-p_{0,1,N-1}\right) ^{N-k}=&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=1\right) =\frac{1}{N-1}\binom{N}{k}\left(p_{1,0,N-1}\right) ^{k}\left( 1-p_{1,0,N-1}\right) ^{N-k}+\frac{N-2}{N-1}\binom{N}{k}\left( p_{1,1,N-1}\right) ^{k}\left( 1-p_{1,1,N-1}\right) ^{N-k}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is pretty well defined, so we can also compute the covariance of these two actual random variables. Let us start with the expectations...&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\frac{N-1}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\sum_{x=0,1}x\mathbb{P}\left( X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\mathbb{P}\left( X=1\right) = \frac{N-1}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For symmetry reasons...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ Y\right] =1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] = \frac{\left( N-2\right) \alpha +\left( N-1\right) \beta }{\left(N-2\right) \alpha +N\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,1}\sum_{y=0}^{N}xy\mathbb{P}\left(X=x,Y=y\right) \text{ (because }xy=0\text{ if either }x=0\text{ or }y=0\text{)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{y=0}^{N}y\mathbb{P}\left( X=1,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{k=0}^{N}y\mathbb{P}\left( X=1\right) \mathbb{P}\left(Y=k|X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N-1}{N}\sum_{k=0}^{N}\left[ \frac{1}{N-1}k\binom{N}{k}\left(p_{1,0,N-1}\right) ^{k}\left( 1-p_{1,0,N-1}\right) ^{N-k}+\frac{N-2}{N-1}k\binom{N}{k}\left( p_{1,1,N-1}\right) ^{k}\left( 1-p_{1,1,N-1}\right) ^{N-k}\right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=p_{1,0,N-1}+\left( N-2\right) p_{1,1,N-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\beta }{\left( N-2\right) \alpha +N\beta }+\left( N-2\right) \frac{\alpha +\beta }{\left( N-2\right) \alpha +N\beta }= &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\left( N-2\right) \alpha +\left( N-1\right) \beta }{\left(N-2\right) \alpha +N\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] \mathbb{E}\left[ Y\right] =\frac{\left( N-2\right) \alpha +\left( N-1\right)\beta }{\left( N-2\right) \alpha +N\beta }-\frac{N-1}{N} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comparing the two covariances == &lt;br /&gt;
&lt;br /&gt;
If we compare these two covariances, for instance for &amp;lt;math&amp;gt;\beta =0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\alpha =1&amp;lt;/math&amp;gt;, then in the first case &amp;lt;math&amp;gt;Cov(X,Y) =-1/N&amp;lt;/math&amp;gt;, while in the second case &amp;lt;math&amp;gt;Cov( X,Y) =+1/N&amp;lt;/math&amp;gt;. This should not feel strange; it is a coordination game, and if everyone plays &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;, then playing &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; is a bad idea, but if everyone else plays &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; too, then playing &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; is  a good idea. The model covariance is therefore not constant, and changes with the frequency of strategy &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this very simple model ==&lt;br /&gt;
&lt;br /&gt;
Here we have a nested sampling procedure; you can choose a starting point (by clicking on each individual in the parent population), keep it fixed, and draw a few transitions. Then change your starting point, and draw a few transitions from there. You will notice that the Price equation varies with every transition, along with the ''likelyhood'' of the different transitions that depend on the initial population.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial3.Tutorial3.class&amp;quot;  height=&amp;quot;480&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What would a probability theorist do? == &lt;br /&gt;
&lt;br /&gt;
Try to figure out the transition probabilities for the suggested model as a function of the current state. It seems that Nowak, Liebermann, Ohtsuki and Tarnita are a proper probability theorists, because that is what they did already.&lt;br /&gt;
&lt;br /&gt;
== What would a proper statistician do? ==&lt;br /&gt;
&lt;br /&gt;
Sample often for different starting points. Fit data to the model, estimate &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\beta &amp;lt;/math&amp;gt;. Test if the payoff matrix is as assumed.&lt;br /&gt;
&lt;br /&gt;
==  So how does the Price equation help here? ==&lt;br /&gt;
&lt;br /&gt;
Not. Can't think of anything remotely useful about the Price equation. The extra problem here is the frequency dependence. Sometimes this is referred&lt;br /&gt;
to as the problem that the Price Equation is not dynamically sufficient. That is a step in the right direction, but still inaccurate, because it only describes one of the symptoms, and not the cause. It is the ''model'' we have here that gives us, after a bit of computing, the transition probabilities for all  frequencies of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, and thereby all properties of the dynamical system. The ''models'' in versions 1.0 and 2.0 just concerned transitions leaving from one given starting point. A ''model'' can therefore be described as dynamically sufficient or insufficient. Because the Price equation can only deal with one step at at time, it tends to inspire people to think of implicit assumptions that pertain to dynamically insufficient models. That, however, does not mean that the Price Equation cannot be used in combination with a dynamically sufficient model. It can; as shown in the applet above. But the question is: used for what? And the answer is: for nothing.&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 11:08:04 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_3.0</comments>		</item>
		<item>
			<title>Price 2.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_2.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* What would a statistician do? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A model with sexual reproduction ==&lt;br /&gt;
&lt;br /&gt;
If we add sexual reproduction, everything gets slightly more complicated, the proper statistics as well as the Price equation. This makes&lt;br /&gt;
the statistics much more fun, and it makes the failure of the Price equation to be of any help even more salient. We like to keep it relatively simple&lt;br /&gt;
though, so for the moment we do not assume actual different sexes, but we do assume that every individual is diploid. That means that individuals can be ''AA'', ''Aa'' or ''aa''. The frequency of the gene is then, resp., ''1'', ''1/2'' or ''0''. Individuals are hermaphrodites for the sake of simplicity.&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 4 individuals, &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=q_{3}=1/2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;q_{4}=0&amp;lt;/math&amp;gt;. The next generation of 4 individuals is drawn as follows. First we draw a father for the first individual. From the father we draw one of the two loci, which gives us an ''A'' or an ''a''. Then we draw a mother, and one of her loci. These two loci go into the gametes for reproduction, that together give us the first individual of the offspring generation. Three repetitions of this procedure give us a whole new generation.&lt;br /&gt;
&lt;br /&gt;
We will make two crucial assumptions here.&lt;br /&gt;
&lt;br /&gt;
1) ''A'' is neither dominant nor recessive in fitness terms&lt;br /&gt;
&lt;br /&gt;
2) Fair meosis&lt;br /&gt;
&lt;br /&gt;
Both assumptions concern probabilities in this update step. The first concerns the probabilities with which an individual is chosen for parenthood. We assume that the probability with which individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; is chosen is&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{P}\left( i\text{ is chosen}\right) =\frac{\alpha q_{i}+\beta }{\sum_{j=1}^{n}\left( \alpha q_{j}+\beta \right) } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With our starting point, &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=q_{3}=1/2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;q_{4}=0&amp;lt;/math&amp;gt;. which  gives us the following probabilities...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{1} =\mathbb{P}\left( 1\text{ is chosen}\right) =\frac{\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{\frac{1}{2}} =\mathbb{P}\left( 2\text{ is chosen}\right) =\frac{\frac{1}{2}\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{\frac{1}{2}} =\mathbb{P}\left( 3\text{ is chosen}\right) =\frac{\frac{1}{2}\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{0} =\mathbb{P}\left( 4\text{ is chosen}\right) =\frac{\beta }{2\alpha+4\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These formulas tell us that Assumption 1) is equivalent to saying that &amp;lt;math&amp;gt;p_{\frac{1}{2}}&amp;lt;/math&amp;gt; is the average of &amp;lt;math&amp;gt;p_{1}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;p_{0}&amp;lt;/math&amp;gt;. The second assumption just means that the probability of either locus of the parent to be chosen for passing on is 1/2.&lt;br /&gt;
&lt;br /&gt;
Again, we first draw one of the individuals from the parent population (this is a hypothetical random variable that has nothing to do with the actual&lt;br /&gt;
transition) and then draw the next generation (this is the actual random thing that happens in the transition). The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is again defined as the genotype of the parent. For our given starting point, that is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbb{P}\left( X=\frac{1}{2}\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; as the number of successful  gametes that this parent produces. This is a slightly more  complicated random variable, because we need to draw 8 parents for 4 offspring and because the chances depend on which of the four the (candidate) parent is that was drawn in step 1. So we get a pretty long list of conditional probabilities.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=0\right) =\binom{8}{k}\left( p_{0}\right)^{k}\left( 1-p_{0}\right) ^{8-k},\ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=\frac{1}{2}\right) =\binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k},\ \ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=1\right) =\binom{8}{k}\left( p_{1}\right)^{k}\left( 1-p_{1}\right) ^{8-k},\ \ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is well defined again, so we can also compute the covariance of these two actual random variables. Let us start with expectations...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\sum_{x=0,\frac{1}{2},1}x\mathbb{P}\left(X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{2}\mathbb{P}\left( X=\frac{1}{2}\right) +\mathbb{P}\left(X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{2}\cdot \frac{1}{2}+\frac{1}{4}=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For symmetry reasons (the total number of succesful gametes is 8, and either of the 4 could be the parent)...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =2 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ Y\right] = \sum_{x=0,\frac{1}{2},1}\sum_{y=0}^{8}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{x=0,\frac{1}{2},1}\sum_{k=0}^{8}k\mathbb{P}\left( X=x\right)  \mathbb{P}\left( Y=k|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{k=0}^{8}k\cdot \frac{1}{4}\cdot \binom{8}{k}\left( p_{0}\right) ^{k}\left( 1-p_{0}\right) ^{8-k}+\sum_{k=0}^{8}k\cdot \frac{1}{2}\cdot \binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\sum_{k=0}^{8}k\cdot \frac{1}{4}\cdot \binom{8}{k}\left(p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{0}\right) ^{k}\left(1-p_{0}\right) ^{8-k}+\frac{1}{2}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{1}\right) ^{k}\left( 1-p_{1}\right)^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\cdot 8p_{0}+\frac{1}{2}\cdot 8p_{\frac{1}{2}}+\frac{1}{4}\cdot 8p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=2p_{0}+4p_{\frac{1}{2}}+2p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{4\alpha +8\beta }{2\alpha +4\beta }=2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,\frac{1}{2},1}\sum_{y=0}^{8}xy\mathbb{P}\left( X=x,Y=y\right) \text{ (because }xy=0\text{ if either }x=0\text{ or }y=0\text{)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{x=\frac{1}{2},1}\sum_{k=0}^{8}xk\mathbb{P}\left( X=x\right) \mathbb{P}\left( Y=k|X=x\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{k=0}^{8}\frac{1}{2}\cdot k\cdot \frac{1}{2}\cdot \binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right)^{8-k}+\sum_{k=0}^{8}1\cdot k\cdot \frac{1}{4}\cdot \binom{8}{k}\left(p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{\frac{1}{2}}\right)^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\cdot 8p_{\frac{1}{2}}+\frac{1}{4}\cdot 8p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=2\left( p_{\frac{1}{2}}+p_{1}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance of these two random variables is therefore...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] \mathbb{E}\left[ Y\right] =2\left( p_{\frac{1}{2}}+p_{1}\right) -1=\frac{3\alpha +4\beta }{2\alpha +4\beta }-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this slightly less simple model ==&lt;br /&gt;
&lt;br /&gt;
Interesting questions would be: is it good to have this gene? In this case, a first check in search of an answer would be: &lt;br /&gt;
&lt;br /&gt;
is &amp;lt;math&amp;gt;\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;gt;1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in other words, is &amp;lt;math&amp;gt;\alpha &amp;gt;0 &amp;lt;/math&amp;gt;, which, as long as we remain within the setting of this model, is equivalent to  &amp;lt;math&amp;gt;Cov\left( X,Y\right) &amp;gt;0 &amp;lt;/math&amp;gt;. This however is only a first check, and below we will see that the answer can come in a riot of colours and flavours, especially if we are not really sure after all if the model describes reality accurately. But first we will look at what the Price equation makes of all this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With this model, the Price equation looks pretty much like the one Price formulated in his original paper. It is an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N} \sum_{i}q_{i}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;. So here that is &amp;lt;math&amp;gt;Q_{1}=1/2&amp;lt;/math&amp;gt;. The frequency of the gene in the offspring population is...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}^{\prime }}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
This differs from the Price Equation 1.0, because of the locus-drawing step. Therefore we have $q_{i}^{\prime }$, which is the frequency of the gene in the set of successful gametes produced by individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;. In the [Price_1.0 | Price Equation 1.0] this was by definition equal to the frequency &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; of the gene in the parent, but because there is a random step involved here, this is no longer the case. Of course  &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is still the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation for this model is then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime}-q_{i}\right) }{\sum_{i}z_{i}} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}^{\prime }}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}+\frac{\sum_{i}z_{i}\left(q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}+\frac{\sum_{i}z_{i}\left(q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which in this particular model is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\frac{1}{2}\left[ \frac{\sum_{i}z_{i}q_{i}}{4}-\frac{\sum_{i}q_{i}}{2}\right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime}-q_{i}\right) }{8} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
As before, it is unfortunate that George Price named the term between square brackets in this equation ''Cov(z,q)''. The claim of the Price equation - which we contend even more now - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. &lt;br /&gt;
&lt;br /&gt;
Two issues remain. One is that now there is another term on the right hand side. In the Price equation literature, this term tends to be crossed off, &amp;quot;because it will be 0 anyway&amp;quot;. This is not correct; it is typically non-zero, even if it is 0 ''in expectation''. The other issue is that &amp;quot;''Cov( z,q)''&amp;quot; is still not a covariance; it is not a constant property of a random variable, but it is a random variable itself, as it differs from draw to draw.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial2.Tutorial2.class&amp;quot;  height=&amp;quot;480&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; can go up or down by a variety of amounts. The right hand side just tags along with &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt;. This can create an illusion of understanding, but whatever happens, the terms on the right hand side of the identity just change along with the outcome of the chance experiment. In other words: the data explain the data. Moreover, crossing of a term that typically is not 0 turns the identity into a false statement.&lt;br /&gt;
&lt;br /&gt;
== What would a probability theorist do? ==&lt;br /&gt;
&lt;br /&gt;
Try to figure out the dynamic properties of the suggested model. With the transition probabilities (see above) we can compute the expected change in frequency, and the fixation probability of ''A'' and ''a'' given the current state. Or given any starting state. &lt;br /&gt;
&lt;br /&gt;
Prove that the assumption of fair meiosis implies that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All of this can be done without the Price equation. In fact, it is better done without, because the Price equation just does not fit the purpose.&lt;br /&gt;
&lt;br /&gt;
== What would a statistician do? ==&lt;br /&gt;
&lt;br /&gt;
A statistician would try to find out what the true model is, given data. That implies that she would:&lt;br /&gt;
&lt;br /&gt;
* Estimate &amp;lt;math&amp;gt;\alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test the assumption of fair meiosis&lt;br /&gt;
&lt;br /&gt;
For this test we need the meiosis term that is often discarded. Any test would involve this part of the formula, because if it remains far away from 0 even for large populations, that  we would refute fair meiosis. So here is yet another reason why it would be just wrong to throw this quantity away, or just assume that it is 0.&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here? ==&lt;br /&gt;
&lt;br /&gt;
It doesn't. And it should worry Price Equationists that even with a relatively simple bit of modelling content, the Price equation is not of any use. Maybe things get better when the models are a bit more complicated? Well, no, of course not. As a matter of fact, things get even worse.&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 11:06:53 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_2.0</comments>		</item>
		<item>
			<title>Price 2.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_2.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* What would a proper statistician do? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A model with sexual reproduction ==&lt;br /&gt;
&lt;br /&gt;
If we add sexual reproduction, everything gets slightly more complicated, the proper statistics as well as the Price equation. This makes&lt;br /&gt;
the statistics much more fun, and it makes the failure of the Price equation to be of any help even more salient. We like to keep it relatively simple&lt;br /&gt;
though, so for the moment we do not assume actual different sexes, but we do assume that every individual is diploid. That means that individuals can be ''AA'', ''Aa'' or ''aa''. The frequency of the gene is then, resp., ''1'', ''1/2'' or ''0''. Individuals are hermaphrodites for the sake of simplicity.&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 4 individuals, &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=q_{3}=1/2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;q_{4}=0&amp;lt;/math&amp;gt;. The next generation of 4 individuals is drawn as follows. First we draw a father for the first individual. From the father we draw one of the two loci, which gives us an ''A'' or an ''a''. Then we draw a mother, and one of her loci. These two loci go into the gametes for reproduction, that together give us the first individual of the offspring generation. Three repetitions of this procedure give us a whole new generation.&lt;br /&gt;
&lt;br /&gt;
We will make two crucial assumptions here.&lt;br /&gt;
&lt;br /&gt;
1) ''A'' is neither dominant nor recessive in fitness terms&lt;br /&gt;
&lt;br /&gt;
2) Fair meosis&lt;br /&gt;
&lt;br /&gt;
Both assumptions concern probabilities in this update step. The first concerns the probabilities with which an individual is chosen for parenthood. We assume that the probability with which individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; is chosen is&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{P}\left( i\text{ is chosen}\right) =\frac{\alpha q_{i}+\beta }{\sum_{j=1}^{n}\left( \alpha q_{j}+\beta \right) } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With our starting point, &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=q_{3}=1/2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;q_{4}=0&amp;lt;/math&amp;gt;. which  gives us the following probabilities...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{1} =\mathbb{P}\left( 1\text{ is chosen}\right) =\frac{\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{\frac{1}{2}} =\mathbb{P}\left( 2\text{ is chosen}\right) =\frac{\frac{1}{2}\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{\frac{1}{2}} =\mathbb{P}\left( 3\text{ is chosen}\right) =\frac{\frac{1}{2}\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{0} =\mathbb{P}\left( 4\text{ is chosen}\right) =\frac{\beta }{2\alpha+4\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These formulas tell us that Assumption 1) is equivalent to saying that &amp;lt;math&amp;gt;p_{\frac{1}{2}}&amp;lt;/math&amp;gt; is the average of &amp;lt;math&amp;gt;p_{1}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;p_{0}&amp;lt;/math&amp;gt;. The second assumption just means that the probability of either locus of the parent to be chosen for passing on is 1/2.&lt;br /&gt;
&lt;br /&gt;
Again, we first draw one of the individuals from the parent population (this is a hypothetical random variable that has nothing to do with the actual&lt;br /&gt;
transition) and then draw the next generation (this is the actual random thing that happens in the transition). The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is again defined as the genotype of the parent. For our given starting point, that is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbb{P}\left( X=\frac{1}{2}\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; as the number of successful  gametes that this parent produces. This is a slightly more  complicated random variable, because we need to draw 8 parents for 4 offspring and because the chances depend on which of the four the (candidate) parent is that was drawn in step 1. So we get a pretty long list of conditional probabilities.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=0\right) =\binom{8}{k}\left( p_{0}\right)^{k}\left( 1-p_{0}\right) ^{8-k},\ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=\frac{1}{2}\right) =\binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k},\ \ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=1\right) =\binom{8}{k}\left( p_{1}\right)^{k}\left( 1-p_{1}\right) ^{8-k},\ \ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is well defined again, so we can also compute the covariance of these two actual random variables. Let us start with expectations...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\sum_{x=0,\frac{1}{2},1}x\mathbb{P}\left(X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{2}\mathbb{P}\left( X=\frac{1}{2}\right) +\mathbb{P}\left(X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{2}\cdot \frac{1}{2}+\frac{1}{4}=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For symmetry reasons (the total number of succesful gametes is 8, and either of the 4 could be the parent)...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =2 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ Y\right] = \sum_{x=0,\frac{1}{2},1}\sum_{y=0}^{8}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{x=0,\frac{1}{2},1}\sum_{k=0}^{8}k\mathbb{P}\left( X=x\right)  \mathbb{P}\left( Y=k|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{k=0}^{8}k\cdot \frac{1}{4}\cdot \binom{8}{k}\left( p_{0}\right) ^{k}\left( 1-p_{0}\right) ^{8-k}+\sum_{k=0}^{8}k\cdot \frac{1}{2}\cdot \binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\sum_{k=0}^{8}k\cdot \frac{1}{4}\cdot \binom{8}{k}\left(p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{0}\right) ^{k}\left(1-p_{0}\right) ^{8-k}+\frac{1}{2}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{1}\right) ^{k}\left( 1-p_{1}\right)^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\cdot 8p_{0}+\frac{1}{2}\cdot 8p_{\frac{1}{2}}+\frac{1}{4}\cdot 8p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=2p_{0}+4p_{\frac{1}{2}}+2p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{4\alpha +8\beta }{2\alpha +4\beta }=2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,\frac{1}{2},1}\sum_{y=0}^{8}xy\mathbb{P}\left( X=x,Y=y\right) \text{ (because }xy=0\text{ if either }x=0\text{ or }y=0\text{)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{x=\frac{1}{2},1}\sum_{k=0}^{8}xk\mathbb{P}\left( X=x\right) \mathbb{P}\left( Y=k|X=x\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{k=0}^{8}\frac{1}{2}\cdot k\cdot \frac{1}{2}\cdot \binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right)^{8-k}+\sum_{k=0}^{8}1\cdot k\cdot \frac{1}{4}\cdot \binom{8}{k}\left(p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{\frac{1}{2}}\right)^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\cdot 8p_{\frac{1}{2}}+\frac{1}{4}\cdot 8p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=2\left( p_{\frac{1}{2}}+p_{1}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance of these two random variables is therefore...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] \mathbb{E}\left[ Y\right] =2\left( p_{\frac{1}{2}}+p_{1}\right) -1=\frac{3\alpha +4\beta }{2\alpha +4\beta }-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this slightly less simple model ==&lt;br /&gt;
&lt;br /&gt;
Interesting questions would be: is it good to have this gene? In this case, a first check in search of an answer would be: &lt;br /&gt;
&lt;br /&gt;
is &amp;lt;math&amp;gt;\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;gt;1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in other words, is &amp;lt;math&amp;gt;\alpha &amp;gt;0 &amp;lt;/math&amp;gt;, which, as long as we remain within the setting of this model, is equivalent to  &amp;lt;math&amp;gt;Cov\left( X,Y\right) &amp;gt;0 &amp;lt;/math&amp;gt;. This however is only a first check, and below we will see that the answer can come in a riot of colours and flavours, especially if we are not really sure after all if the model describes reality accurately. But first we will look at what the Price equation makes of all this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With this model, the Price equation looks pretty much like the one Price formulated in his original paper. It is an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N} \sum_{i}q_{i}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;. So here that is &amp;lt;math&amp;gt;Q_{1}=1/2&amp;lt;/math&amp;gt;. The frequency of the gene in the offspring population is...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}^{\prime }}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
This differs from the Price Equation 1.0, because of the locus-drawing step. Therefore we have $q_{i}^{\prime }$, which is the frequency of the gene in the set of successful gametes produced by individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;. In the [Price_1.0 | Price Equation 1.0] this was by definition equal to the frequency &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; of the gene in the parent, but because there is a random step involved here, this is no longer the case. Of course  &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is still the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation for this model is then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime}-q_{i}\right) }{\sum_{i}z_{i}} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}^{\prime }}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}+\frac{\sum_{i}z_{i}\left(q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}+\frac{\sum_{i}z_{i}\left(q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which in this particular model is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\frac{1}{2}\left[ \frac{\sum_{i}z_{i}q_{i}}{4}-\frac{\sum_{i}q_{i}}{2}\right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime}-q_{i}\right) }{8} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
As before, it is unfortunate that George Price named the term between square brackets in this equation ''Cov(z,q)''. The claim of the Price equation - which we contend even more now - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. &lt;br /&gt;
&lt;br /&gt;
Two issues remain. One is that now there is another term on the right hand side. In the Price equation literature, this term tends to be crossed off, &amp;quot;because it will be 0 anyway&amp;quot;. This is not correct; it is typically non-zero, even if it is 0 ''in expectation''. The other issue is that &amp;quot;''Cov( z,q)''&amp;quot; is still not a covariance; it is not a constant property of a random variable, but it is a random variable itself, as it differs from draw to draw.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial2.Tutorial2.class&amp;quot;  height=&amp;quot;480&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; can go up or down by a variety of amounts. The right hand side just tags along with &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt;. This can create an illusion of understanding, but whatever happens, the terms on the right hand side of the identity just change along with the outcome of the chance experiment. In other words: the data explain the data. Moreover, crossing of a term that typically is not 0 turns the identity into a false statement.&lt;br /&gt;
&lt;br /&gt;
== What would a probability theorist do? ==&lt;br /&gt;
&lt;br /&gt;
Try to figure out the dynamic properties of the suggested model. With the transition probabilities (see above) we can compute the expected change in frequency, and the fixation probability of ''A'' and ''a'' given the current state. Or given any starting state. &lt;br /&gt;
&lt;br /&gt;
Prove that the assumption of fair meiosis implies that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All of this can be done without the Price equation. In fact, it is better done without, because the Price equation just does not fit the purpose.&lt;br /&gt;
&lt;br /&gt;
== What would a statistician do? ==&lt;br /&gt;
&lt;br /&gt;
A statistician would try to find out what the true model is, given data. That implies that she would:&lt;br /&gt;
&lt;br /&gt;
* Estimate &amp;lt;math&amp;gt;\alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test the assumption of fair meiosis&lt;br /&gt;
&lt;br /&gt;
For this test we need the meiosis term that is often discarded. Any test would involve this part of the formula, because if it remains far away from 0 even for large populations, that  wewould refute fair meiosis. So here is yet another reason why it would be just wrong to throw this quantity away, or just assume that it is 0.&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here? ==&lt;br /&gt;
&lt;br /&gt;
It doesn't. And it should worry Price Equationists that even with a relatively simple bit of modelling content, the Price equation is not of any use. Maybe things get better when the models are a bit more complicated? Well, no, of course not. As a matter of fact, things get even worse.&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 11:06:41 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_2.0</comments>		</item>
		<item>
			<title>Price 2.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_2.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* What would a proper probability theorist do? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A model with sexual reproduction ==&lt;br /&gt;
&lt;br /&gt;
If we add sexual reproduction, everything gets slightly more complicated, the proper statistics as well as the Price equation. This makes&lt;br /&gt;
the statistics much more fun, and it makes the failure of the Price equation to be of any help even more salient. We like to keep it relatively simple&lt;br /&gt;
though, so for the moment we do not assume actual different sexes, but we do assume that every individual is diploid. That means that individuals can be ''AA'', ''Aa'' or ''aa''. The frequency of the gene is then, resp., ''1'', ''1/2'' or ''0''. Individuals are hermaphrodites for the sake of simplicity.&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 4 individuals, &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=q_{3}=1/2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;q_{4}=0&amp;lt;/math&amp;gt;. The next generation of 4 individuals is drawn as follows. First we draw a father for the first individual. From the father we draw one of the two loci, which gives us an ''A'' or an ''a''. Then we draw a mother, and one of her loci. These two loci go into the gametes for reproduction, that together give us the first individual of the offspring generation. Three repetitions of this procedure give us a whole new generation.&lt;br /&gt;
&lt;br /&gt;
We will make two crucial assumptions here.&lt;br /&gt;
&lt;br /&gt;
1) ''A'' is neither dominant nor recessive in fitness terms&lt;br /&gt;
&lt;br /&gt;
2) Fair meosis&lt;br /&gt;
&lt;br /&gt;
Both assumptions concern probabilities in this update step. The first concerns the probabilities with which an individual is chosen for parenthood. We assume that the probability with which individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; is chosen is&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{P}\left( i\text{ is chosen}\right) =\frac{\alpha q_{i}+\beta }{\sum_{j=1}^{n}\left( \alpha q_{j}+\beta \right) } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With our starting point, &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=q_{3}=1/2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;q_{4}=0&amp;lt;/math&amp;gt;. which  gives us the following probabilities...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{1} =\mathbb{P}\left( 1\text{ is chosen}\right) =\frac{\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{\frac{1}{2}} =\mathbb{P}\left( 2\text{ is chosen}\right) =\frac{\frac{1}{2}\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{\frac{1}{2}} =\mathbb{P}\left( 3\text{ is chosen}\right) =\frac{\frac{1}{2}\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{0} =\mathbb{P}\left( 4\text{ is chosen}\right) =\frac{\beta }{2\alpha+4\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These formulas tell us that Assumption 1) is equivalent to saying that &amp;lt;math&amp;gt;p_{\frac{1}{2}}&amp;lt;/math&amp;gt; is the average of &amp;lt;math&amp;gt;p_{1}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;p_{0}&amp;lt;/math&amp;gt;. The second assumption just means that the probability of either locus of the parent to be chosen for passing on is 1/2.&lt;br /&gt;
&lt;br /&gt;
Again, we first draw one of the individuals from the parent population (this is a hypothetical random variable that has nothing to do with the actual&lt;br /&gt;
transition) and then draw the next generation (this is the actual random thing that happens in the transition). The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is again defined as the genotype of the parent. For our given starting point, that is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbb{P}\left( X=\frac{1}{2}\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; as the number of successful  gametes that this parent produces. This is a slightly more  complicated random variable, because we need to draw 8 parents for 4 offspring and because the chances depend on which of the four the (candidate) parent is that was drawn in step 1. So we get a pretty long list of conditional probabilities.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=0\right) =\binom{8}{k}\left( p_{0}\right)^{k}\left( 1-p_{0}\right) ^{8-k},\ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=\frac{1}{2}\right) =\binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k},\ \ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=1\right) =\binom{8}{k}\left( p_{1}\right)^{k}\left( 1-p_{1}\right) ^{8-k},\ \ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is well defined again, so we can also compute the covariance of these two actual random variables. Let us start with expectations...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\sum_{x=0,\frac{1}{2},1}x\mathbb{P}\left(X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{2}\mathbb{P}\left( X=\frac{1}{2}\right) +\mathbb{P}\left(X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{2}\cdot \frac{1}{2}+\frac{1}{4}=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For symmetry reasons (the total number of succesful gametes is 8, and either of the 4 could be the parent)...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =2 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ Y\right] = \sum_{x=0,\frac{1}{2},1}\sum_{y=0}^{8}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{x=0,\frac{1}{2},1}\sum_{k=0}^{8}k\mathbb{P}\left( X=x\right)  \mathbb{P}\left( Y=k|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{k=0}^{8}k\cdot \frac{1}{4}\cdot \binom{8}{k}\left( p_{0}\right) ^{k}\left( 1-p_{0}\right) ^{8-k}+\sum_{k=0}^{8}k\cdot \frac{1}{2}\cdot \binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\sum_{k=0}^{8}k\cdot \frac{1}{4}\cdot \binom{8}{k}\left(p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{0}\right) ^{k}\left(1-p_{0}\right) ^{8-k}+\frac{1}{2}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{1}\right) ^{k}\left( 1-p_{1}\right)^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\cdot 8p_{0}+\frac{1}{2}\cdot 8p_{\frac{1}{2}}+\frac{1}{4}\cdot 8p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=2p_{0}+4p_{\frac{1}{2}}+2p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{4\alpha +8\beta }{2\alpha +4\beta }=2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,\frac{1}{2},1}\sum_{y=0}^{8}xy\mathbb{P}\left( X=x,Y=y\right) \text{ (because }xy=0\text{ if either }x=0\text{ or }y=0\text{)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{x=\frac{1}{2},1}\sum_{k=0}^{8}xk\mathbb{P}\left( X=x\right) \mathbb{P}\left( Y=k|X=x\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{k=0}^{8}\frac{1}{2}\cdot k\cdot \frac{1}{2}\cdot \binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right)^{8-k}+\sum_{k=0}^{8}1\cdot k\cdot \frac{1}{4}\cdot \binom{8}{k}\left(p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{\frac{1}{2}}\right)^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\cdot 8p_{\frac{1}{2}}+\frac{1}{4}\cdot 8p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=2\left( p_{\frac{1}{2}}+p_{1}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance of these two random variables is therefore...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] \mathbb{E}\left[ Y\right] =2\left( p_{\frac{1}{2}}+p_{1}\right) -1=\frac{3\alpha +4\beta }{2\alpha +4\beta }-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this slightly less simple model ==&lt;br /&gt;
&lt;br /&gt;
Interesting questions would be: is it good to have this gene? In this case, a first check in search of an answer would be: &lt;br /&gt;
&lt;br /&gt;
is &amp;lt;math&amp;gt;\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;gt;1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in other words, is &amp;lt;math&amp;gt;\alpha &amp;gt;0 &amp;lt;/math&amp;gt;, which, as long as we remain within the setting of this model, is equivalent to  &amp;lt;math&amp;gt;Cov\left( X,Y\right) &amp;gt;0 &amp;lt;/math&amp;gt;. This however is only a first check, and below we will see that the answer can come in a riot of colours and flavours, especially if we are not really sure after all if the model describes reality accurately. But first we will look at what the Price equation makes of all this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With this model, the Price equation looks pretty much like the one Price formulated in his original paper. It is an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N} \sum_{i}q_{i}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;. So here that is &amp;lt;math&amp;gt;Q_{1}=1/2&amp;lt;/math&amp;gt;. The frequency of the gene in the offspring population is...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}^{\prime }}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
This differs from the Price Equation 1.0, because of the locus-drawing step. Therefore we have $q_{i}^{\prime }$, which is the frequency of the gene in the set of successful gametes produced by individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;. In the [Price_1.0 | Price Equation 1.0] this was by definition equal to the frequency &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; of the gene in the parent, but because there is a random step involved here, this is no longer the case. Of course  &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is still the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation for this model is then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime}-q_{i}\right) }{\sum_{i}z_{i}} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}^{\prime }}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}+\frac{\sum_{i}z_{i}\left(q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}+\frac{\sum_{i}z_{i}\left(q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which in this particular model is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\frac{1}{2}\left[ \frac{\sum_{i}z_{i}q_{i}}{4}-\frac{\sum_{i}q_{i}}{2}\right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime}-q_{i}\right) }{8} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
As before, it is unfortunate that George Price named the term between square brackets in this equation ''Cov(z,q)''. The claim of the Price equation - which we contend even more now - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. &lt;br /&gt;
&lt;br /&gt;
Two issues remain. One is that now there is another term on the right hand side. In the Price equation literature, this term tends to be crossed off, &amp;quot;because it will be 0 anyway&amp;quot;. This is not correct; it is typically non-zero, even if it is 0 ''in expectation''. The other issue is that &amp;quot;''Cov( z,q)''&amp;quot; is still not a covariance; it is not a constant property of a random variable, but it is a random variable itself, as it differs from draw to draw.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial2.Tutorial2.class&amp;quot;  height=&amp;quot;480&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; can go up or down by a variety of amounts. The right hand side just tags along with &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt;. This can create an illusion of understanding, but whatever happens, the terms on the right hand side of the identity just change along with the outcome of the chance experiment. In other words: the data explain the data. Moreover, crossing of a term that typically is not 0 turns the identity into a false statement.&lt;br /&gt;
&lt;br /&gt;
== What would a probability theorist do? ==&lt;br /&gt;
&lt;br /&gt;
Try to figure out the dynamic properties of the suggested model. With the transition probabilities (see above) we can compute the expected change in frequency, and the fixation probability of ''A'' and ''a'' given the current state. Or given any starting state. &lt;br /&gt;
&lt;br /&gt;
Prove that the assumption of fair meiosis implies that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All of this can be done without the Price equation. In fact, it is better done without, because the Price equation just does not fit the purpose.&lt;br /&gt;
&lt;br /&gt;
== What would a proper statistician do? ==&lt;br /&gt;
&lt;br /&gt;
A statistician would try to find out what the true model is, given data. That implies that she would:&lt;br /&gt;
&lt;br /&gt;
* Estimate &amp;lt;math&amp;gt;\alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test the assumption of fair meiosis&lt;br /&gt;
&lt;br /&gt;
For this test we need the meiosis term that is often discarded. Any test would involve this part of the formula, because if it remains far away from 0 even for large populations, that  wewould refute fair meiosis. So here is yet another reason why it would be just wrong to throw this quantity away, or just assume that it is 0.&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here? ==&lt;br /&gt;
&lt;br /&gt;
It doesn't. And it should worry Price Equationists that even with a relatively simple bit of modelling content, the Price equation is not of any use. Maybe things get better when the models are a bit more complicated? Well, no, of course not. As a matter of fact, things get even worse.&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 11:06:30 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_2.0</comments>		</item>
		<item>
			<title>Price 2.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_2.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* A model with sexual reproduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A model with sexual reproduction ==&lt;br /&gt;
&lt;br /&gt;
If we add sexual reproduction, everything gets slightly more complicated, the proper statistics as well as the Price equation. This makes&lt;br /&gt;
the statistics much more fun, and it makes the failure of the Price equation to be of any help even more salient. We like to keep it relatively simple&lt;br /&gt;
though, so for the moment we do not assume actual different sexes, but we do assume that every individual is diploid. That means that individuals can be ''AA'', ''Aa'' or ''aa''. The frequency of the gene is then, resp., ''1'', ''1/2'' or ''0''. Individuals are hermaphrodites for the sake of simplicity.&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 4 individuals, &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=q_{3}=1/2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;q_{4}=0&amp;lt;/math&amp;gt;. The next generation of 4 individuals is drawn as follows. First we draw a father for the first individual. From the father we draw one of the two loci, which gives us an ''A'' or an ''a''. Then we draw a mother, and one of her loci. These two loci go into the gametes for reproduction, that together give us the first individual of the offspring generation. Three repetitions of this procedure give us a whole new generation.&lt;br /&gt;
&lt;br /&gt;
We will make two crucial assumptions here.&lt;br /&gt;
&lt;br /&gt;
1) ''A'' is neither dominant nor recessive in fitness terms&lt;br /&gt;
&lt;br /&gt;
2) Fair meosis&lt;br /&gt;
&lt;br /&gt;
Both assumptions concern probabilities in this update step. The first concerns the probabilities with which an individual is chosen for parenthood. We assume that the probability with which individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; is chosen is&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{P}\left( i\text{ is chosen}\right) =\frac{\alpha q_{i}+\beta }{\sum_{j=1}^{n}\left( \alpha q_{j}+\beta \right) } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With our starting point, &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=q_{3}=1/2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;q_{4}=0&amp;lt;/math&amp;gt;. which  gives us the following probabilities...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{1} =\mathbb{P}\left( 1\text{ is chosen}\right) =\frac{\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{\frac{1}{2}} =\mathbb{P}\left( 2\text{ is chosen}\right) =\frac{\frac{1}{2}\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{\frac{1}{2}} =\mathbb{P}\left( 3\text{ is chosen}\right) =\frac{\frac{1}{2}\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{0} =\mathbb{P}\left( 4\text{ is chosen}\right) =\frac{\beta }{2\alpha+4\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These formulas tell us that Assumption 1) is equivalent to saying that &amp;lt;math&amp;gt;p_{\frac{1}{2}}&amp;lt;/math&amp;gt; is the average of &amp;lt;math&amp;gt;p_{1}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;p_{0}&amp;lt;/math&amp;gt;. The second assumption just means that the probability of either locus of the parent to be chosen for passing on is 1/2.&lt;br /&gt;
&lt;br /&gt;
Again, we first draw one of the individuals from the parent population (this is a hypothetical random variable that has nothing to do with the actual&lt;br /&gt;
transition) and then draw the next generation (this is the actual random thing that happens in the transition). The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is again defined as the genotype of the parent. For our given starting point, that is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbb{P}\left( X=\frac{1}{2}\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; as the number of successful  gametes that this parent produces. This is a slightly more  complicated random variable, because we need to draw 8 parents for 4 offspring and because the chances depend on which of the four the (candidate) parent is that was drawn in step 1. So we get a pretty long list of conditional probabilities.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=0\right) =\binom{8}{k}\left( p_{0}\right)^{k}\left( 1-p_{0}\right) ^{8-k},\ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=\frac{1}{2}\right) =\binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k},\ \ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=1\right) =\binom{8}{k}\left( p_{1}\right)^{k}\left( 1-p_{1}\right) ^{8-k},\ \ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is well defined again, so we can also compute the covariance of these two actual random variables. Let us start with expectations...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\sum_{x=0,\frac{1}{2},1}x\mathbb{P}\left(X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{2}\mathbb{P}\left( X=\frac{1}{2}\right) +\mathbb{P}\left(X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{2}\cdot \frac{1}{2}+\frac{1}{4}=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For symmetry reasons (the total number of succesful gametes is 8, and either of the 4 could be the parent)...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =2 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ Y\right] = \sum_{x=0,\frac{1}{2},1}\sum_{y=0}^{8}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{x=0,\frac{1}{2},1}\sum_{k=0}^{8}k\mathbb{P}\left( X=x\right)  \mathbb{P}\left( Y=k|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{k=0}^{8}k\cdot \frac{1}{4}\cdot \binom{8}{k}\left( p_{0}\right) ^{k}\left( 1-p_{0}\right) ^{8-k}+\sum_{k=0}^{8}k\cdot \frac{1}{2}\cdot \binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\sum_{k=0}^{8}k\cdot \frac{1}{4}\cdot \binom{8}{k}\left(p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{0}\right) ^{k}\left(1-p_{0}\right) ^{8-k}+\frac{1}{2}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{1}\right) ^{k}\left( 1-p_{1}\right)^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\cdot 8p_{0}+\frac{1}{2}\cdot 8p_{\frac{1}{2}}+\frac{1}{4}\cdot 8p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=2p_{0}+4p_{\frac{1}{2}}+2p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{4\alpha +8\beta }{2\alpha +4\beta }=2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,\frac{1}{2},1}\sum_{y=0}^{8}xy\mathbb{P}\left( X=x,Y=y\right) \text{ (because }xy=0\text{ if either }x=0\text{ or }y=0\text{)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{x=\frac{1}{2},1}\sum_{k=0}^{8}xk\mathbb{P}\left( X=x\right) \mathbb{P}\left( Y=k|X=x\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{k=0}^{8}\frac{1}{2}\cdot k\cdot \frac{1}{2}\cdot \binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right)^{8-k}+\sum_{k=0}^{8}1\cdot k\cdot \frac{1}{4}\cdot \binom{8}{k}\left(p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{\frac{1}{2}}\right)^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\cdot 8p_{\frac{1}{2}}+\frac{1}{4}\cdot 8p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=2\left( p_{\frac{1}{2}}+p_{1}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance of these two random variables is therefore...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] \mathbb{E}\left[ Y\right] =2\left( p_{\frac{1}{2}}+p_{1}\right) -1=\frac{3\alpha +4\beta }{2\alpha +4\beta }-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this slightly less simple model ==&lt;br /&gt;
&lt;br /&gt;
Interesting questions would be: is it good to have this gene? In this case, a first check in search of an answer would be: &lt;br /&gt;
&lt;br /&gt;
is &amp;lt;math&amp;gt;\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;gt;1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in other words, is &amp;lt;math&amp;gt;\alpha &amp;gt;0 &amp;lt;/math&amp;gt;, which, as long as we remain within the setting of this model, is equivalent to  &amp;lt;math&amp;gt;Cov\left( X,Y\right) &amp;gt;0 &amp;lt;/math&amp;gt;. This however is only a first check, and below we will see that the answer can come in a riot of colours and flavours, especially if we are not really sure after all if the model describes reality accurately. But first we will look at what the Price equation makes of all this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With this model, the Price equation looks pretty much like the one Price formulated in his original paper. It is an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N} \sum_{i}q_{i}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;. So here that is &amp;lt;math&amp;gt;Q_{1}=1/2&amp;lt;/math&amp;gt;. The frequency of the gene in the offspring population is...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}^{\prime }}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
This differs from the Price Equation 1.0, because of the locus-drawing step. Therefore we have $q_{i}^{\prime }$, which is the frequency of the gene in the set of successful gametes produced by individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;. In the [Price_1.0 | Price Equation 1.0] this was by definition equal to the frequency &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; of the gene in the parent, but because there is a random step involved here, this is no longer the case. Of course  &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is still the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation for this model is then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime}-q_{i}\right) }{\sum_{i}z_{i}} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}^{\prime }}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}+\frac{\sum_{i}z_{i}\left(q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}+\frac{\sum_{i}z_{i}\left(q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which in this particular model is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\frac{1}{2}\left[ \frac{\sum_{i}z_{i}q_{i}}{4}-\frac{\sum_{i}q_{i}}{2}\right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime}-q_{i}\right) }{8} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
As before, it is unfortunate that George Price named the term between square brackets in this equation ''Cov(z,q)''. The claim of the Price equation - which we contend even more now - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. &lt;br /&gt;
&lt;br /&gt;
Two issues remain. One is that now there is another term on the right hand side. In the Price equation literature, this term tends to be crossed off, &amp;quot;because it will be 0 anyway&amp;quot;. This is not correct; it is typically non-zero, even if it is 0 ''in expectation''. The other issue is that &amp;quot;''Cov( z,q)''&amp;quot; is still not a covariance; it is not a constant property of a random variable, but it is a random variable itself, as it differs from draw to draw.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial2.Tutorial2.class&amp;quot;  height=&amp;quot;480&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; can go up or down by a variety of amounts. The right hand side just tags along with &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt;. This can create an illusion of understanding, but whatever happens, the terms on the right hand side of the identity just change along with the outcome of the chance experiment. In other words: the data explain the data. Moreover, crossing of a term that typically is not 0 turns the identity into a false statement.&lt;br /&gt;
&lt;br /&gt;
== What would a proper probability theorist do? ==&lt;br /&gt;
&lt;br /&gt;
Try to figure out the dynamic properties of the suggested model. With the transition probabilities (see above) we can compute the expected change in frequency, and the fixation probability of ''A'' and ''a'' given the current state. Or given any starting state. &lt;br /&gt;
&lt;br /&gt;
Prove that the assumption of fair meiosis implies that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All of this can be done without the Price equation. In fact, it is better done without, because the Price equation just does not fit the purpose.&lt;br /&gt;
&lt;br /&gt;
== What would a proper statistician do? ==&lt;br /&gt;
&lt;br /&gt;
A statistician would try to find out what the true model is, given data. That implies that she would:&lt;br /&gt;
&lt;br /&gt;
* Estimate &amp;lt;math&amp;gt;\alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test the assumption of fair meiosis&lt;br /&gt;
&lt;br /&gt;
For this test we need the meiosis term that is often discarded. Any test would involve this part of the formula, because if it remains far away from 0 even for large populations, that  wewould refute fair meiosis. So here is yet another reason why it would be just wrong to throw this quantity away, or just assume that it is 0.&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here? ==&lt;br /&gt;
&lt;br /&gt;
It doesn't. And it should worry Price Equationists that even with a relatively simple bit of modelling content, the Price equation is not of any use. Maybe things get better when the models are a bit more complicated? Well, no, of course not. As a matter of fact, things get even worse.&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 11:05:52 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_2.0</comments>		</item>
		<item>
			<title>Price 2.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_2.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* A model with sexual reproduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A model with sexual reproduction ==&lt;br /&gt;
&lt;br /&gt;
If we add sexual reproduction, everything gets slightly more complicated, the proper statistics as well as the Price equation. This makes&lt;br /&gt;
the statistics much more fun, and it makes the failure of the Price equation to be of any help even more salient. We like to keep it relatively simple&lt;br /&gt;
though, so for the moment we do not assume actual different sexes, but we do assume that every individual is diploid. That means that individuals can be ''AA'', ''Aa'' or ''aa''. The frequency of the gene is then, resp., ''1'', ''1/2'' or ''0''. Individuals are hermaphrodites for the sake of simplicity.&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 4 individuals, &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=q_{3}=1/2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;q_{4}=0&amp;lt;/math&amp;gt;. The next generation of 4 individuals is drawn as follows. First we draw a father for the first individual. From the father we draw one of the two loci, which gives us an ''A'' or an ''a''. Then we draw a mother, and one of her loci. These two loci go into the gametes for reproduction, that together give us the first individual of the offspring generation. Three repetitions of this procedure give us a whole new generation.&lt;br /&gt;
&lt;br /&gt;
We will make two crucial assumptions here.&lt;br /&gt;
&lt;br /&gt;
1) ''A'' is neither dominant nor recessive in fitness terms&lt;br /&gt;
&lt;br /&gt;
2) Fair meosis&lt;br /&gt;
&lt;br /&gt;
Both assumptions concern probabilities in this update step. The first concerns the probabilities with which an individual is chosen for parenthood. We assume that the probability with which individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; is chosen is&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{P}\left( i\text{ is chosen}\right) =\frac{\alpha q_{i}+\beta }{\sum_{j=1}^{n}\left( \alpha q_{j}+\beta \right) } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With our starting point, &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=q_{3}=1/2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;q_{4}=0&amp;lt;/math&amp;gt;. which  gives us the following probabilities...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{1} =\mathbb{P}\left( 1\text{ is chosen}\right) =\frac{\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{\frac{1}{2}} =\mathbb{P}\left( 2\text{ is chosen}\right) =\frac{\frac{1}{2}\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{\frac{1}{2}} =\mathbb{P}\left( 3\text{ is chosen}\right) =\frac{\frac{1}{2}\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{0} =\mathbb{P}\left( 4\text{ is chosen}\right) =\frac{\beta }{2\alpha+4\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These formulas tell us that Assumption 1) is equivalent to saying that &amp;lt;math&amp;gt;p_{\frac{1}{2}}&amp;lt;/math&amp;gt; is the average of &amp;lt;math&amp;gt;p_{1}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;p_{0}&amp;lt;/math&amp;gt;. The second assumption just means that the probability of either locus of the parent to be chosen for passing on is 1/2.&lt;br /&gt;
&lt;br /&gt;
Again, we first draw one of the individuals from the parent population (this is a hypothetical random variable that has nothing to do with the actual&lt;br /&gt;
transition) and then draw the next generation (this is the actual random thing that happens in the transition). The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is again defined as the genotype of the parent. For our given starting point, that is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbb{P}\left( X=\frac{1}{2}\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; as the number of successful  gametes that this parent produces. This is a slightly more  complicated random variable, because we need to draw 8 parents for 4 offspring and because the chances depend on which of the four the (candidate) parent is that was drawn in step 1. So we get a pretty long list of conditional probabilities.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=0\right) =\binom{8}{k}\left( p_{0}\right)^{k}\left( 1-p_{0}\right) ^{8-k},\ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=\frac{1}{2}\right) =\binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k},\ \ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=1\right) =\binom{8}{k}\left( p_{1}\right)^{k}\left( 1-p_{1}\right) ^{8-k},\ \ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is well defined again, so we can also compute the covariance of these two actual random variables. Let us start with expectations...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\sum_{x=0,\frac{1}{2},1}x\mathbb{P}\left(X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{2}\mathbb{P}\left( X=\frac{1}{2}\right) +\mathbb{P}\left(X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{2}\cdot \frac{1}{2}+\frac{1}{4}=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For symmetry reasons (the total number of succesful gametes is 8, and either of the 4 could be the parent)...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =2 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ Y\right] = \sum_{x=0,\frac{1}{2},1}\sum_{y=0}^{8}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{x=0,\frac{1}{2},1}\sum_{k=0}^{8}k\mathbb{P}\left( X=x\right)  \mathbb{P}\left( Y=k|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{k=0}^{8}k\cdot \frac{1}{4}\cdot \binom{8}{k}\left( p_{0}\right) ^{k}\left( 1-p_{0}\right) ^{8-k}+\sum_{k=0}^{8}k\cdot \frac{1}{2}\cdot \binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\sum_{k=0}^{8}k\cdot \frac{1}{4}\cdot \binom{8}{k}\left(p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{0}\right) ^{k}\left(1-p_{0}\right) ^{8-k}+\frac{1}{2}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{1}\right) ^{k}\left( 1-p_{1}\right)^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\cdot 8p_{0}+\frac{1}{2}\cdot 8p_{\frac{1}{2}}+\frac{1}{4}\cdot 8p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=2p_{0}+4p_{\frac{1}{2}}+2p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{4\alpha +8\beta }{2\alpha +4\beta }=2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,\frac{1}{2},1}\sum_{y=0}^{8}xy\mathbb{P}\left( X=x,Y=y\right) \text{ (because }xy=0\text{ if either }x=0\text{ or }y=0\text{)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{x=\frac{1}{2},1}\sum_{k=0}^{8}xk\mathbb{P}\left( X=x\right) \mathbb{P}\left( Y=k|X=x\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{k=0}^{8}\frac{1}{2}\cdot k\cdot \frac{1}{2}\cdot \binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right)^{8-k}+\sum_{k=0}^{8}1\cdot k\cdot \frac{1}{4}\cdot \binom{8}{k}\left(p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{\frac{1}{2}}\right)^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\cdot 8p_{\frac{1}{2}}+\frac{1}{4}\cdot 8p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=2\left( p_{\frac{1}{2}}+p_{1}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance of these two random variables is therefore...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] \mathbb{E}\left[ Y\right] =2\left( p_{\frac{1}{2}}+p_{1}\right) -1=\frac{3\alpha +4\beta }{2\alpha +4\beta }-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this slightly less simple model ==&lt;br /&gt;
&lt;br /&gt;
Interesting questions would be: is it good to have this gene? In this case, a first check in search of an answer would be: &lt;br /&gt;
&lt;br /&gt;
is &amp;lt;math&amp;gt;\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;gt;1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in other words, is &amp;lt;math&amp;gt;\alpha &amp;gt;0 &amp;lt;/math&amp;gt;, which, as long as we remain within the setting of this model, is equivalent to  &amp;lt;math&amp;gt;Cov\left( X,Y\right) &amp;gt;0 &amp;lt;/math&amp;gt;. This however is only a first check, and below we will see that the answer can come in a riot of colours and flavours, especially if we are not really sure after all if the model describes reality accurately. But first we will look at what the Price equation makes of all this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With this model, the Price equation looks pretty much like the one Price formulated in his original paper. It is an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N} \sum_{i}q_{i}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;. So here that is &amp;lt;math&amp;gt;Q_{1}=1/2&amp;lt;/math&amp;gt;. The frequency of the gene in the offspring population is...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}^{\prime }}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
This differs from the Price Equation 1.0, because of the locus-drawing step. Therefore we have $q_{i}^{\prime }$, which is the frequency of the gene in the set of successful gametes produced by individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;. In the [Price_1.0 | Price Equation 1.0] this was by definition equal to the frequency &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; of the gene in the parent, but because there is a random step involved here, this is no longer the case. Of course  &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is still the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation for this model is then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime}-q_{i}\right) }{\sum_{i}z_{i}} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}^{\prime }}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}+\frac{\sum_{i}z_{i}\left(q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}+\frac{\sum_{i}z_{i}\left(q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which in this particular model is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\frac{1}{2}\left[ \frac{\sum_{i}z_{i}q_{i}}{4}-\frac{\sum_{i}q_{i}}{2}\right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime}-q_{i}\right) }{8} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
As before, it is unfortunate that George Price named the term between square brackets in this equation ''Cov(z,q)''. The claim of the Price equation - which we contend even more now - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. &lt;br /&gt;
&lt;br /&gt;
Two issues remain. One is that now there is another term on the right hand side. In the Price equation literature, this term tends to be crossed off, &amp;quot;because it will be 0 anyway&amp;quot;. This is not correct; it is typically non-zero, even if it is 0 ''in expectation''. The other issue is that &amp;quot;''Cov( z,q)''&amp;quot; is still not a covariance; it is not a constant property of a random variable, but it is a random variable itself, as it differs from draw to draw.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial2.Tutorial2.class&amp;quot;  height=&amp;quot;480&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; can go up or down by a variety of amounts. The right hand side just tags along with &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt;. This can create an illusion of understanding, but whatever happens, the terms on the right hand side of the identity just change along with the outcome of the chance experiment. In other words: the data explain the data. Moreover, crossing of a term that typically is not 0 turns the identity into a false statement.&lt;br /&gt;
&lt;br /&gt;
== What would a proper probability theorist do? ==&lt;br /&gt;
&lt;br /&gt;
Try to figure out the dynamic properties of the suggested model. With the transition probabilities (see above) we can compute the expected change in frequency, and the fixation probability of ''A'' and ''a'' given the current state. Or given any starting state. &lt;br /&gt;
&lt;br /&gt;
Prove that the assumption of fair meiosis implies that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All of this can be done without the Price equation. In fact, it is better done without, because the Price equation just does not fit the purpose.&lt;br /&gt;
&lt;br /&gt;
== What would a proper statistician do? ==&lt;br /&gt;
&lt;br /&gt;
A statistician would try to find out what the true model is, given data. That implies that she would:&lt;br /&gt;
&lt;br /&gt;
* Estimate &amp;lt;math&amp;gt;\alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test the assumption of fair meiosis&lt;br /&gt;
&lt;br /&gt;
For this test we need the meiosis term that is often discarded. Any test would involve this part of the formula, because if it remains far away from 0 even for large populations, that  wewould refute fair meiosis. So here is yet another reason why it would be just wrong to throw this quantity away, or just assume that it is 0.&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here? ==&lt;br /&gt;
&lt;br /&gt;
It doesn't. And it should worry Price Equationists that even with a relatively simple bit of modelling content, the Price equation is not of any use. Maybe things get better when the models are a bit more complicated? Well, no, of course not. As a matter of fact, things get even worse.&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 11:02:48 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_2.0</comments>		</item>
		<item>
			<title>Price 2.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_2.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* A model with sexual reproduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A model with sexual reproduction ==&lt;br /&gt;
&lt;br /&gt;
If we add sexual reproduction, everything gets slightly more complicated, the proper statistics as well as the Price equation. This makes&lt;br /&gt;
the statistics much more fun, and it makes the failure of the Price equation to be of any help even more salient. We like to keep it relatively simple&lt;br /&gt;
though, so for the moment we do not assume actual different sexes, but we do assume that every individual is diploid. That means that individuals can be ''AA'', ''Aa'' or ''aa''. The frequency of the gene is then, resp., ''1'', ''1/2'' or ''0''. Individuals are hermaphrodites for the sake of simplicity.&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 4 individuals, &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=q_{3}=1/2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;q_{4}=0&amp;lt;/math&amp;gt;. The next generation of 4 individuals is drawn as follows. First we draw a father for the first individual. From the father we draw one of the two loci, which gives us an ''A'' or an ''a''. Then we draw a mother, and one of her loci. These two loci go into the gametes for reproduction, that together give us the first individual of the offspring generation. Three repetitions of this procedure give us a whole new generation.&lt;br /&gt;
&lt;br /&gt;
We will make two crucial assumptions here.&lt;br /&gt;
&lt;br /&gt;
1) ''A'' is neither dominant nor recessive in fitness terms&lt;br /&gt;
&lt;br /&gt;
2) Fair meosis&lt;br /&gt;
&lt;br /&gt;
Both assumptions concern probabilities in this update step. The first concerns the probabilities with which an individual is chosen for parenthood. We assume that the probability with which individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; is chosen is&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{P}\left( i\text{ is chosen}\right) =\frac{\alpha q_{i}+\beta }{\sum_{j=1}^{n}\left( \alpha q_{j}+\beta \right) } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With our starting point, &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=q_{3}=1/2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;q_{4}=0&amp;lt;/math&amp;gt;. which  gives us the following probabilities...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{1} =\mathbb{P}\left( 1\text{ is chosen}\right) =\frac{\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{\frac{1}{2}} =\mathbb{P}\left( 2\text{ is chosen}\right) =\frac{\frac{1}{2}\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{\frac{1}{2}} =\mathbb{P}\left( 3\text{ is chosen}\right) =\frac{\frac{1}{2}\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{0} =\mathbb{P}\left( 4\text{ is chosen}\right) =\frac{\beta }{2\alpha+4\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These formulas tell us that Assumption 1) is equivalent to saying that &amp;lt;math&amp;gt;p_{\frac{1}{2}}&amp;lt;/math&amp;gt; is the average of &amp;lt;math&amp;gt;p_{1}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;p_{0}&amp;lt;/math&amp;gt;. The second assumption just means that the probability of either locus of the parent to be chosen for passing on is 1/2.&lt;br /&gt;
&lt;br /&gt;
Again, we first draw one of the individuals from the parent population (this is a hypothetical random variable that has nothing to do with the actual&lt;br /&gt;
transition) and then draw the next generation (this is the actual random thing that happens in the transition). The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is again defined as the genotype of the parent. For our given starting point, that is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbb{P}\left( X=\frac{1}{2}\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; as the number of successful  gametes that this parent produces. This is a slightly more  complicated random variable, because we need to draw 8 parents for 4 offspring and because the chances depend on which of the four the (candidate) parent is that was drawn in step 1. So we get a pretty long list of conditional probabilities.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=0\right) =\binom{8}{k}\left( p_{0}\right)^{k}\left( 1-p_{0}\right) ^{8-k},\ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=\frac{1}{2}\right) =\binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k},\ \ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=1\right) =\binom{8}{k}\left( p_{1}\right)^{k}\left( 1-p_{1}\right) ^{8-k},\ \ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is well defined again, so we can also compute the covariance of these two actual random variables. Let us start with expectations...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\sum_{x=0,\frac{1}{2},1}x\mathbb{P}\left(X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{2}\mathbb{P}\left( X=\frac{1}{2}\right) +\mathbb{P}\left(X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{2}\cdot \frac{1}{2}+\frac{1}{4}=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For symmetry reasons (the total number of succesful gametes is 8, and either of the 4 could be the parent)...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =2 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ Y\right] = \sum_{x=0,\frac{1}{2},1}\sum_{y=0}^{8}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{x=0,\frac{1}{2},1}\sum_{k=0}^{8}k\mathbb{P}\left( X=x\right)  \mathbb{P}\left( Y=k|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{k=0}^{8}k\cdot \frac{1}{4}\cdot \binom{8}{k}\left( p_{0}\right) ^{k}\left( 1-p_{0}\right) ^{8-k}+\sum_{k=0}^{8}k\cdot \frac{1}{2}\cdot \binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\sum_{k=0}^{8}k\cdot \frac{1}{4}\cdot \binom{8}{k}\left(p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{0}\right) ^{k}\left(1-p_{0}\right) ^{8-k}+\frac{1}{2}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{1}\right) ^{k}\left( 1-p_{1}\right)^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\cdot 8p_{0}+\frac{1}{2}\cdot 8p_{\frac{1}{2}}+\frac{1}{4}\cdot 8p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=2p_{0}+4p_{\frac{1}{2}}+2p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{4\alpha +8\beta }{2\alpha +4\beta }=2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,\frac{1}{2},1}\sum_{y=0}^{8}xy\mathbb{P}\left( X=x,Y=y\right) \text{ (because }xy=0\text{ if either }x=0\text{ or }y=0\text{)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{x=\frac{1}{2},1}\sum_{k=0}^{8}xk\mathbb{P}\left( X=x\right) \mathbb{P}\left( Y=k|X=x\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{k=0}^{8}\frac{1}{2}\cdot k\cdot \frac{1}{2}\cdot \binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right)^{8-k}+\sum_{k=0}^{8}1\cdot k\cdot \frac{1}{4}\cdot \binom{8}{k}\left(p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{\frac{1}{2}}\right)^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\cdot 8p_{\frac{1}{2}}+\frac{1}{4}\cdot 8p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=2\left( p_{\frac{1}{2}}+p_{1}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance of these two random variables is therefore...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] \mathbb{E}\left[ Y\right] =2\left( p_{\frac{1}{2}}+p_{1}\right) -1=\frac{3\alpha +4\beta }{2\alpha +4\beta }-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this slightly less simple model ==&lt;br /&gt;
&lt;br /&gt;
Interesting questions would be: is it good to have this gene? In this case, a first check in search of an answer would be: &lt;br /&gt;
&lt;br /&gt;
is &amp;lt;math&amp;gt;\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;gt;1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in other words, is &amp;lt;math&amp;gt;\alpha &amp;gt;0 &amp;lt;/math&amp;gt;, which, as long as we remain within the setting of this model, is equivalent to  &amp;lt;math&amp;gt;Cov\left( X,Y\right) &amp;gt;0 &amp;lt;/math&amp;gt;. This however is only a first check, and below we will see that the answer can come in a riot of colours and flavours, especially if we are not really sure after all if the model describes reality accurately. But first we will look at what the Price equation makes of all this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With this model, the Price equation looks pretty much like the one Price formulated in his original paper. It is an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N} \sum_{i}q_{i}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;. So here that is &amp;lt;math&amp;gt;Q_{1}=1/2&amp;lt;/math&amp;gt;. The frequency of the gene in the offspring population is...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}^{\prime }}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
This differs from the Price Equation 1.0, because of the locus-drawing step. Therefore we have $q_{i}^{\prime }$, which is the frequency of the gene in the set of successful gametes produced by individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;. In the [Price_1.0 | Price Equation 1.0] this was by definition equal to the frequency &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; of the gene in the parent, but because there is a random step involved here, this is no longer the case. Of course  &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is still the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation for this model is then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime}-q_{i}\right) }{\sum_{i}z_{i}} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}^{\prime }}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}+\frac{\sum_{i}z_{i}\left(q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}+\frac{\sum_{i}z_{i}\left(q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which in this particular model is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\frac{1}{2}\left[ \frac{\sum_{i}z_{i}q_{i}}{4}-\frac{\sum_{i}q_{i}}{2}\right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime}-q_{i}\right) }{8} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
As before, it is unfortunate that George Price named the term between square brackets in this equation ''Cov(z,q)''. The claim of the Price equation - which we contend even more now - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. &lt;br /&gt;
&lt;br /&gt;
Two issues remain. One is that now there is another term on the right hand side. In the Price equation literature, this term tends to be crossed off, &amp;quot;because it will be 0 anyway&amp;quot;. This is not correct; it is typically non-zero, even if it is 0 ''in expectation''. The other issue is that &amp;quot;''Cov( z,q)''&amp;quot; is still not a covariance; it is not a constant property of a random variable, but it is a random variable itself, as it differs from draw to draw.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial2.Tutorial2.class&amp;quot;  height=&amp;quot;480&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; can go up or down by a variety of amounts. The right hand side just tags along with &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt;. This can create an illusion of understanding, but whatever happens, the terms on the right hand side of the identity just change along with the outcome of the chance experiment. In other words: the data explain the data. Moreover, crossing of a term that typically is not 0 turns the identity into a false statement.&lt;br /&gt;
&lt;br /&gt;
== What would a proper probability theorist do? ==&lt;br /&gt;
&lt;br /&gt;
Try to figure out the dynamic properties of the suggested model. With the transition probabilities (see above) we can compute the expected change in frequency, and the fixation probability of ''A'' and ''a'' given the current state. Or given any starting state. &lt;br /&gt;
&lt;br /&gt;
Prove that the assumption of fair meiosis implies that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All of this can be done without the Price equation. In fact, it is better done without, because the Price equation just does not fit the purpose.&lt;br /&gt;
&lt;br /&gt;
== What would a proper statistician do? ==&lt;br /&gt;
&lt;br /&gt;
A statistician would try to find out what the true model is, given data. That implies that she would:&lt;br /&gt;
&lt;br /&gt;
* Estimate &amp;lt;math&amp;gt;\alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test the assumption of fair meiosis&lt;br /&gt;
&lt;br /&gt;
For this test we need the meiosis term that is often discarded. Any test would involve this part of the formula, because if it remains far away from 0 even for large populations, that  wewould refute fair meiosis. So here is yet another reason why it would be just wrong to throw this quantity away, or just assume that it is 0.&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here? ==&lt;br /&gt;
&lt;br /&gt;
It doesn't. And it should worry Price Equationists that even with a relatively simple bit of modelling content, the Price equation is not of any use. Maybe things get better when the models are a bit more complicated? Well, no, of course not. As a matter of fact, things get even worse.&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 11:02:05 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_2.0</comments>		</item>
		<item>
			<title>Price 2.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_2.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* A model with sexual reproduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A model with sexual reproduction ==&lt;br /&gt;
&lt;br /&gt;
If we add sexual reproduction, everything gets slightly more complicated, the proper statistics as well as the Price equation. This makes&lt;br /&gt;
the statistics much more fun, and it makes the failure of the Price equation to be of any help even more salient. We like to keep it relatively simple&lt;br /&gt;
though, so for the moment we do not assume actual different sexes, but we do assume that every individual is diploid. That means that individuals can be ''AA'', ''Aa'' or ''aa''. The frequency of the gene is then, resp., ''1'', ''1/2'' or ''0''. Individuals are hermaphrodites for the sake of simplicity.&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 4 individuals, &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=q_{3}=1/2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;q_{4}=0&amp;lt;/math&amp;gt;. The next generation of 4 individuals is drawn as follows. First we draw a father for the first individual. From the father we draw one of the two loci, which gives us an ''A'' or an ''a''. Then we draw a mother, and one of her loci. These two loci go into the gametes for reproduction, that together give us the first individual of the offspring generation. Three repetitions of this procedure give us a whole new generation.&lt;br /&gt;
&lt;br /&gt;
We will make two crucial assumptions here.&lt;br /&gt;
&lt;br /&gt;
1) ''A'' is neither dominant nor recessive in fitness terms&lt;br /&gt;
&lt;br /&gt;
2) Fair meosis&lt;br /&gt;
&lt;br /&gt;
Both assumptions concern probabilities in this update step. The first concerns the probabilities with which an individual is chosen for parenthood. We assume that the probability with which individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; is chosen is&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{P}\left( i\text{ is chosen}\right) =\frac{\alpha q_{i}+\beta }{\sum_{j=1}^{n}\left( \alpha q_{j}+\beta \right) } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With our starting point, &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=q_{3}=1/2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;q_{4}=0&amp;lt;/math&amp;gt;. which  gives us the following probabilities...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{1} =\mathbb{P}\left( 1\text{ is chosen}\right) =\frac{\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{\frac{1}{2}} =\mathbb{P}\left( 2\text{ is chosen}\right) =\frac{\frac{1}{2}\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{\frac{1}{2}} =\mathbb{P}\left( 3\text{ is chosen}\right) =\frac{\frac{1}{2}\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{0} =\mathbb{P}\left( 4\text{ is chosen}\right) =\frac{\beta }{2\alpha+4\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These formulas tell us that Assumption 1) is equivalent to saying that &amp;lt;math&amp;gt;p_{\frac{1}{2}}&amp;lt;/math&amp;gt; is the average of &amp;lt;math&amp;gt;p_{1}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;p_{0}&amp;lt;/math&amp;gt;. The second assumption just means that the probability of either locus of the parent to be chosen for passing on is 1/2.&lt;br /&gt;
&lt;br /&gt;
Again, we first draw one of the individuals from the parent population (this is a hypothetical random variable that has nothing to do with the actual&lt;br /&gt;
transition) and then draw the next generation (this is the actual random thing that happens in the transition). The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is again defined as the genotype of the parent. For our given starting point, that is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbb{P}\left( X=\frac{1}{2}\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; as the number of successful  gametes that this parent produces. This is a slightly more  omplicated random variable, because we need to draw 8 parents for 4 offspring and because the chances depend on which of the four the (candidate) parent is that was drawn in step 1. So we get a pretty long list of conditional probabilities.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=0\right) =\binom{8}{k}\left( p_{0}\right)^{k}\left( 1-p_{0}\right) ^{8-k},\ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=\frac{1}{2}\right) =\binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k},\ \ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=1\right) =\binom{8}{k}\left( p_{1}\right)^{k}\left( 1-p_{1}\right) ^{8-k},\ \ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is well defined again, so we can also compute the covariance of these two actual random variables. Let us start with expectations...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\sum_{x=0,\frac{1}{2},1}x\mathbb{P}\left(X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{2}\mathbb{P}\left( X=\frac{1}{2}\right) +\mathbb{P}\left(X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{2}\cdot \frac{1}{2}+\frac{1}{4}=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For symmetry reasons (the total number of succesful gametes is 8, and either of the 4 could be the parent)...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =2 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ Y\right] = \sum_{x=0,\frac{1}{2},1}\sum_{y=0}^{8}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{x=0,\frac{1}{2},1}\sum_{k=0}^{8}k\mathbb{P}\left( X=x\right)  \mathbb{P}\left( Y=k|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{k=0}^{8}k\cdot \frac{1}{4}\cdot \binom{8}{k}\left( p_{0}\right) ^{k}\left( 1-p_{0}\right) ^{8-k}+\sum_{k=0}^{8}k\cdot \frac{1}{2}\cdot \binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\sum_{k=0}^{8}k\cdot \frac{1}{4}\cdot \binom{8}{k}\left(p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{0}\right) ^{k}\left(1-p_{0}\right) ^{8-k}+\frac{1}{2}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{1}\right) ^{k}\left( 1-p_{1}\right)^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\cdot 8p_{0}+\frac{1}{2}\cdot 8p_{\frac{1}{2}}+\frac{1}{4}\cdot 8p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=2p_{0}+4p_{\frac{1}{2}}+2p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{4\alpha +8\beta }{2\alpha +4\beta }=2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,\frac{1}{2},1}\sum_{y=0}^{8}xy\mathbb{P}\left( X=x,Y=y\right) \text{ (because }xy=0\text{ if either }x=0\text{ or }y=0\text{)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{x=\frac{1}{2},1}\sum_{k=0}^{8}xk\mathbb{P}\left( X=x\right) \mathbb{P}\left( Y=k|X=x\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{k=0}^{8}\frac{1}{2}\cdot k\cdot \frac{1}{2}\cdot \binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right)^{8-k}+\sum_{k=0}^{8}1\cdot k\cdot \frac{1}{4}\cdot \binom{8}{k}\left(p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{\frac{1}{2}}\right)^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\cdot 8p_{\frac{1}{2}}+\frac{1}{4}\cdot 8p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=2\left( p_{\frac{1}{2}}+p_{1}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance of these two random variables is therefore...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] \mathbb{E}\left[ Y\right] =2\left( p_{\frac{1}{2}}+p_{1}\right) -1=\frac{3\alpha +4\beta }{2\alpha +4\beta }-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this slightly less simple model ==&lt;br /&gt;
&lt;br /&gt;
Interesting questions would be: is it good to have this gene? In this case, a first check in search of an answer would be: &lt;br /&gt;
&lt;br /&gt;
is &amp;lt;math&amp;gt;\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;gt;1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in other words, is &amp;lt;math&amp;gt;\alpha &amp;gt;0 &amp;lt;/math&amp;gt;, which, as long as we remain within the setting of this model, is equivalent to  &amp;lt;math&amp;gt;Cov\left( X,Y\right) &amp;gt;0 &amp;lt;/math&amp;gt;. This however is only a first check, and below we will see that the answer can come in a riot of colours and flavours, especially if we are not really sure after all if the model describes reality accurately. But first we will look at what the Price equation makes of all this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With this model, the Price equation looks pretty much like the one Price formulated in his original paper. It is an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N} \sum_{i}q_{i}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;. So here that is &amp;lt;math&amp;gt;Q_{1}=1/2&amp;lt;/math&amp;gt;. The frequency of the gene in the offspring population is...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}^{\prime }}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
This differs from the Price Equation 1.0, because of the locus-drawing step. Therefore we have $q_{i}^{\prime }$, which is the frequency of the gene in the set of successful gametes produced by individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;. In the [Price_1.0 | Price Equation 1.0] this was by definition equal to the frequency &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; of the gene in the parent, but because there is a random step involved here, this is no longer the case. Of course  &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is still the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation for this model is then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime}-q_{i}\right) }{\sum_{i}z_{i}} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}^{\prime }}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}+\frac{\sum_{i}z_{i}\left(q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}+\frac{\sum_{i}z_{i}\left(q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which in this particular model is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\frac{1}{2}\left[ \frac{\sum_{i}z_{i}q_{i}}{4}-\frac{\sum_{i}q_{i}}{2}\right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime}-q_{i}\right) }{8} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
As before, it is unfortunate that George Price named the term between square brackets in this equation ''Cov(z,q)''. The claim of the Price equation - which we contend even more now - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. &lt;br /&gt;
&lt;br /&gt;
Two issues remain. One is that now there is another term on the right hand side. In the Price equation literature, this term tends to be crossed off, &amp;quot;because it will be 0 anyway&amp;quot;. This is not correct; it is typically non-zero, even if it is 0 ''in expectation''. The other issue is that &amp;quot;''Cov( z,q)''&amp;quot; is still not a covariance; it is not a constant property of a random variable, but it is a random variable itself, as it differs from draw to draw.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial2.Tutorial2.class&amp;quot;  height=&amp;quot;480&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; can go up or down by a variety of amounts. The right hand side just tags along with &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt;. This can create an illusion of understanding, but whatever happens, the terms on the right hand side of the identity just change along with the outcome of the chance experiment. In other words: the data explain the data. Moreover, crossing of a term that typically is not 0 turns the identity into a false statement.&lt;br /&gt;
&lt;br /&gt;
== What would a proper probability theorist do? ==&lt;br /&gt;
&lt;br /&gt;
Try to figure out the dynamic properties of the suggested model. With the transition probabilities (see above) we can compute the expected change in frequency, and the fixation probability of ''A'' and ''a'' given the current state. Or given any starting state. &lt;br /&gt;
&lt;br /&gt;
Prove that the assumption of fair meiosis implies that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All of this can be done without the Price equation. In fact, it is better done without, because the Price equation just does not fit the purpose.&lt;br /&gt;
&lt;br /&gt;
== What would a proper statistician do? ==&lt;br /&gt;
&lt;br /&gt;
A statistician would try to find out what the true model is, given data. That implies that she would:&lt;br /&gt;
&lt;br /&gt;
* Estimate &amp;lt;math&amp;gt;\alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test the assumption of fair meiosis&lt;br /&gt;
&lt;br /&gt;
For this test we need the meiosis term that is often discarded. Any test would involve this part of the formula, because if it remains far away from 0 even for large populations, that  wewould refute fair meiosis. So here is yet another reason why it would be just wrong to throw this quantity away, or just assume that it is 0.&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here? ==&lt;br /&gt;
&lt;br /&gt;
It doesn't. And it should worry Price Equationists that even with a relatively simple bit of modelling content, the Price equation is not of any use. Maybe things get better when the models are a bit more complicated? Well, no, of course not. As a matter of fact, things get even worse.&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 11:01:46 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_2.0</comments>		</item>
		<item>
			<title>Price 2.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_2.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* A model with sexual reproduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A model with sexual reproduction ==&lt;br /&gt;
&lt;br /&gt;
If we add sexual reproduction, everything gets slightly more complicated, the proper statistics as well as the Price equation. This makes&lt;br /&gt;
the statistics much more fun, and it makes the failure of the Price equation to be of any help even more salient. We like to keep it relatively simple&lt;br /&gt;
though, so for the moment we do not assume actual different sexes, but we do assume that every individual is diploid. That means that individuals can be ''AA'', ''Aa'' or ''aa''. The frequency of the gene is then, resp., ''1'', ''1/2'' or ''0''. Individuals are hermaphrodites for the sake of simplicity.&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 4 individuals, &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=q_{3}=1/2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;q_{4}=0&amp;lt;/math&amp;gt;. The next generation of 4 individuals is drawn as follows. First we draw a father for the first individual. From the father we draw one of the two loci, which gives us an ''A'' or an ''a''. Then we draw a mother, and one of her loci. These two loci go into the gametes for reproduction, that together give us the first individual of the offspring generation. Three repetitions of this procedure give us a whole new generation.&lt;br /&gt;
&lt;br /&gt;
We will make two crucial assumptions here.&lt;br /&gt;
&lt;br /&gt;
1) ''A'' is neither dominant nor recessive in fitness terms&lt;br /&gt;
&lt;br /&gt;
2) Fair meosis&lt;br /&gt;
&lt;br /&gt;
Both assumptions concern probabilities in this update step. The first concerns the probabilities with which an individual is chosen for parenthood. We assume that the probability with which individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; is chosen is&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{P}\left( i\text{ is chosen}\right) =\frac{\alpha q_{i}+\beta }{\sum_{j=1}^{n}\left( \alpha q_{j}+\beta \right) } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With our starting point, &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=q_{3}=1/2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;q_{4}=0&amp;lt;/math&amp;gt;. which  gives us the following probabilities...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{1} =\mathbb{P}\left( 1\text{ is chosen}\right) =\frac{\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{\frac{1}{2}} =\mathbb{P}\left( 2\text{ is chosen}\right) =\frac{\frac{1}{2}\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{\frac{1}{2}} =\mathbb{P}\left( 3\text{ is chosen}\right) =\frac{\frac{1}{2}\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{0} =\mathbb{P}\left( 4\text{ is chosen}\right) =\frac{\beta }{2\alpha+4\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These formulas tell us that Assumption 1) is equivalent to saying that &amp;lt;math&amp;gt;p_{\frac{1}{2}}&amp;lt;/math&amp;gt; is the average of &amp;lt;math&amp;gt;p_{1}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;p_{0}&amp;lt;/math&amp;gt;. The second assumption just means that the probability of either locus of the parent to be chosen for passing on is 1/2.&lt;br /&gt;
&lt;br /&gt;
Again, we first draw one of the individuals from the parent population (this is a hypothetical random variable that has nothing to do with the actual&lt;br /&gt;
transition) and then draw the next generation (this is the actual random thing that happens in the the transition). The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is again defined as the genotype of the parent. For our given starting point, that is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbb{P}\left( X=\frac{1}{2}\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; as the number of successful  gametes that this parent produces. This is a slightly more  omplicated random variable, because we need to draw 8 parents for 4 offspring and because the chances depend on which of the four the (candidate) parent is that was drawn in step 1. So we get a pretty long list of conditional probabilities.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=0\right) =\binom{8}{k}\left( p_{0}\right)^{k}\left( 1-p_{0}\right) ^{8-k},\ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=\frac{1}{2}\right) =\binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k},\ \ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=1\right) =\binom{8}{k}\left( p_{1}\right)^{k}\left( 1-p_{1}\right) ^{8-k},\ \ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is well defined again, so we can also compute the covariance of these two actual random variables. Let us start with expectations...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\sum_{x=0,\frac{1}{2},1}x\mathbb{P}\left(X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{2}\mathbb{P}\left( X=\frac{1}{2}\right) +\mathbb{P}\left(X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{2}\cdot \frac{1}{2}+\frac{1}{4}=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For symmetry reasons (the total number of succesful gametes is 8, and either of the 4 could be the parent)...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =2 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ Y\right] = \sum_{x=0,\frac{1}{2},1}\sum_{y=0}^{8}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{x=0,\frac{1}{2},1}\sum_{k=0}^{8}k\mathbb{P}\left( X=x\right)  \mathbb{P}\left( Y=k|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{k=0}^{8}k\cdot \frac{1}{4}\cdot \binom{8}{k}\left( p_{0}\right) ^{k}\left( 1-p_{0}\right) ^{8-k}+\sum_{k=0}^{8}k\cdot \frac{1}{2}\cdot \binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\sum_{k=0}^{8}k\cdot \frac{1}{4}\cdot \binom{8}{k}\left(p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{0}\right) ^{k}\left(1-p_{0}\right) ^{8-k}+\frac{1}{2}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{1}\right) ^{k}\left( 1-p_{1}\right)^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\cdot 8p_{0}+\frac{1}{2}\cdot 8p_{\frac{1}{2}}+\frac{1}{4}\cdot 8p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=2p_{0}+4p_{\frac{1}{2}}+2p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{4\alpha +8\beta }{2\alpha +4\beta }=2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,\frac{1}{2},1}\sum_{y=0}^{8}xy\mathbb{P}\left( X=x,Y=y\right) \text{ (because }xy=0\text{ if either }x=0\text{ or }y=0\text{)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{x=\frac{1}{2},1}\sum_{k=0}^{8}xk\mathbb{P}\left( X=x\right) \mathbb{P}\left( Y=k|X=x\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{k=0}^{8}\frac{1}{2}\cdot k\cdot \frac{1}{2}\cdot \binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right)^{8-k}+\sum_{k=0}^{8}1\cdot k\cdot \frac{1}{4}\cdot \binom{8}{k}\left(p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{\frac{1}{2}}\right)^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\cdot 8p_{\frac{1}{2}}+\frac{1}{4}\cdot 8p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=2\left( p_{\frac{1}{2}}+p_{1}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance of these two random variables is therefore...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] \mathbb{E}\left[ Y\right] =2\left( p_{\frac{1}{2}}+p_{1}\right) -1=\frac{3\alpha +4\beta }{2\alpha +4\beta }-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this slightly less simple model ==&lt;br /&gt;
&lt;br /&gt;
Interesting questions would be: is it good to have this gene? In this case, a first check in search of an answer would be: &lt;br /&gt;
&lt;br /&gt;
is &amp;lt;math&amp;gt;\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;gt;1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in other words, is &amp;lt;math&amp;gt;\alpha &amp;gt;0 &amp;lt;/math&amp;gt;, which, as long as we remain within the setting of this model, is equivalent to  &amp;lt;math&amp;gt;Cov\left( X,Y\right) &amp;gt;0 &amp;lt;/math&amp;gt;. This however is only a first check, and below we will see that the answer can come in a riot of colours and flavours, especially if we are not really sure after all if the model describes reality accurately. But first we will look at what the Price equation makes of all this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With this model, the Price equation looks pretty much like the one Price formulated in his original paper. It is an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N} \sum_{i}q_{i}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;. So here that is &amp;lt;math&amp;gt;Q_{1}=1/2&amp;lt;/math&amp;gt;. The frequency of the gene in the offspring population is...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}^{\prime }}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
This differs from the Price Equation 1.0, because of the locus-drawing step. Therefore we have $q_{i}^{\prime }$, which is the frequency of the gene in the set of successful gametes produced by individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;. In the [Price_1.0 | Price Equation 1.0] this was by definition equal to the frequency &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; of the gene in the parent, but because there is a random step involved here, this is no longer the case. Of course  &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is still the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation for this model is then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime}-q_{i}\right) }{\sum_{i}z_{i}} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}^{\prime }}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}+\frac{\sum_{i}z_{i}\left(q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}+\frac{\sum_{i}z_{i}\left(q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which in this particular model is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\frac{1}{2}\left[ \frac{\sum_{i}z_{i}q_{i}}{4}-\frac{\sum_{i}q_{i}}{2}\right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime}-q_{i}\right) }{8} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
As before, it is unfortunate that George Price named the term between square brackets in this equation ''Cov(z,q)''. The claim of the Price equation - which we contend even more now - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. &lt;br /&gt;
&lt;br /&gt;
Two issues remain. One is that now there is another term on the right hand side. In the Price equation literature, this term tends to be crossed off, &amp;quot;because it will be 0 anyway&amp;quot;. This is not correct; it is typically non-zero, even if it is 0 ''in expectation''. The other issue is that &amp;quot;''Cov( z,q)''&amp;quot; is still not a covariance; it is not a constant property of a random variable, but it is a random variable itself, as it differs from draw to draw.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial2.Tutorial2.class&amp;quot;  height=&amp;quot;480&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; can go up or down by a variety of amounts. The right hand side just tags along with &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt;. This can create an illusion of understanding, but whatever happens, the terms on the right hand side of the identity just change along with the outcome of the chance experiment. In other words: the data explain the data. Moreover, crossing of a term that typically is not 0 turns the identity into a false statement.&lt;br /&gt;
&lt;br /&gt;
== What would a proper probability theorist do? ==&lt;br /&gt;
&lt;br /&gt;
Try to figure out the dynamic properties of the suggested model. With the transition probabilities (see above) we can compute the expected change in frequency, and the fixation probability of ''A'' and ''a'' given the current state. Or given any starting state. &lt;br /&gt;
&lt;br /&gt;
Prove that the assumption of fair meiosis implies that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All of this can be done without the Price equation. In fact, it is better done without, because the Price equation just does not fit the purpose.&lt;br /&gt;
&lt;br /&gt;
== What would a proper statistician do? ==&lt;br /&gt;
&lt;br /&gt;
A statistician would try to find out what the true model is, given data. That implies that she would:&lt;br /&gt;
&lt;br /&gt;
* Estimate &amp;lt;math&amp;gt;\alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test the assumption of fair meiosis&lt;br /&gt;
&lt;br /&gt;
For this test we need the meiosis term that is often discarded. Any test would involve this part of the formula, because if it remains far away from 0 even for large populations, that  wewould refute fair meiosis. So here is yet another reason why it would be just wrong to throw this quantity away, or just assume that it is 0.&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here? ==&lt;br /&gt;
&lt;br /&gt;
It doesn't. And it should worry Price Equationists that even with a relatively simple bit of modelling content, the Price equation is not of any use. Maybe things get better when the models are a bit more complicated? Well, no, of course not. As a matter of fact, things get even worse.&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 11:00:19 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_2.0</comments>		</item>
		<item>
			<title>Price 2.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_2.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* A model with sexual reproduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A model with sexual reproduction ==&lt;br /&gt;
&lt;br /&gt;
If we add sexual reproduction, everything gets slightly more complicated, the proper statistics as well as the Price equation. This makes&lt;br /&gt;
the statistics much more fun, and it makes the failure of the Price equation to be of any help even more salient. We like to keep it relatively simple&lt;br /&gt;
though, so for the moment we do not assume actual different sexes, but we do assume that every individual is diploid. That means that individuals can be ''AA'', ''Aa'' or ''aa''. The frequency of the gene is then, resp., ''1'', ''1/2'' or ''0''. Individuals are hermaphrodites for the sake of simplicity.&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 4 individuals, &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=q_{3}=1/2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;q_{4}=0&amp;lt;/math&amp;gt;. The next generation of 4 individuals is drawn as follows. First we draw a father for the first individual. From the father we draw one of the two loci, which gives us an ''A'' or an ''a''. Then we draw a mother, and one of her loci. These two loci go into the gametes for reproduction, that together give us the first individual of the offspring generation. Three repetitions of this procedure give us a whole new generation.&lt;br /&gt;
&lt;br /&gt;
We will make two crucial assumptions here.&lt;br /&gt;
&lt;br /&gt;
1) ''A'' is neither dominant nor recessive in fitness terms&lt;br /&gt;
&lt;br /&gt;
2) Fair meosis&lt;br /&gt;
&lt;br /&gt;
Both assumptions concern probabilities in this update step. The first concerns the probabilities with which an individual is chosen for parenthood. We assume that the probability with which individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; is chosen is&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{P}\left( i\text{ is chosen}\right) =\frac{\alpha q_{i}+\beta }{\sum_{j=1}^{n}\left( \alpha q_{j}+\beta \right) } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With our starting point, &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=q_{3}=1/2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;q_{4}=0&amp;lt;/math&amp;gt;. which  gives us the following probabilities...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{1} =\mathbb{P}\left( 1\text{ is chosen}\right) =\frac{\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{\frac{1}{2}} =\mathbb{P}\left( 2\text{ is chosen}\right) =\frac{\frac{1}{2}\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{\frac{1}{2}} =\mathbb{P}\left( 3\text{ is chosen}\right) =\frac{\frac{1}{2}\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{0} =\mathbb{P}\left( 4\text{ is chosen}\right) =\frac{\beta }{2\alpha+4\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These formulas tells us that Assumption 1) is equivalent to saying that &amp;lt;math&amp;gt;p_{\frac{1}{2}}&amp;lt;/math&amp;gt; is the average of &amp;lt;math&amp;gt;p_{1}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;p_{0}&amp;lt;/math&amp;gt;. The second assumption just means that the probability of either locus of the parent to be chosen for passing on is 1/2.&lt;br /&gt;
&lt;br /&gt;
Again, we first draw one of the individuals from the parent population (this is a hypothetical random variable that has nothing to do with the actual&lt;br /&gt;
transition) and then draw the next generation (this is the actual random thing that happens in the the transition). The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is again defined as the genotype of the parent. For our given starting point, that is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbb{P}\left( X=\frac{1}{2}\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; as the number of successful  gametes that this parent produces. This is a slightly more  omplicated random variable, because we need to draw 8 parents for 4 offspring and because the chances depend on which of the four the (candidate) parent is that was drawn in step 1. So we get a pretty long list of conditional probabilities.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=0\right) =\binom{8}{k}\left( p_{0}\right)^{k}\left( 1-p_{0}\right) ^{8-k},\ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=\frac{1}{2}\right) =\binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k},\ \ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=1\right) =\binom{8}{k}\left( p_{1}\right)^{k}\left( 1-p_{1}\right) ^{8-k},\ \ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is well defined again, so we can also compute the covariance of these two actual random variables. Let us start with expectations...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\sum_{x=0,\frac{1}{2},1}x\mathbb{P}\left(X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{2}\mathbb{P}\left( X=\frac{1}{2}\right) +\mathbb{P}\left(X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{2}\cdot \frac{1}{2}+\frac{1}{4}=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For symmetry reasons (the total number of succesful gametes is 8, and either of the 4 could be the parent)...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =2 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ Y\right] = \sum_{x=0,\frac{1}{2},1}\sum_{y=0}^{8}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{x=0,\frac{1}{2},1}\sum_{k=0}^{8}k\mathbb{P}\left( X=x\right)  \mathbb{P}\left( Y=k|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{k=0}^{8}k\cdot \frac{1}{4}\cdot \binom{8}{k}\left( p_{0}\right) ^{k}\left( 1-p_{0}\right) ^{8-k}+\sum_{k=0}^{8}k\cdot \frac{1}{2}\cdot \binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\sum_{k=0}^{8}k\cdot \frac{1}{4}\cdot \binom{8}{k}\left(p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{0}\right) ^{k}\left(1-p_{0}\right) ^{8-k}+\frac{1}{2}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{1}\right) ^{k}\left( 1-p_{1}\right)^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\cdot 8p_{0}+\frac{1}{2}\cdot 8p_{\frac{1}{2}}+\frac{1}{4}\cdot 8p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=2p_{0}+4p_{\frac{1}{2}}+2p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{4\alpha +8\beta }{2\alpha +4\beta }=2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,\frac{1}{2},1}\sum_{y=0}^{8}xy\mathbb{P}\left( X=x,Y=y\right) \text{ (because }xy=0\text{ if either }x=0\text{ or }y=0\text{)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{x=\frac{1}{2},1}\sum_{k=0}^{8}xk\mathbb{P}\left( X=x\right) \mathbb{P}\left( Y=k|X=x\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{k=0}^{8}\frac{1}{2}\cdot k\cdot \frac{1}{2}\cdot \binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right)^{8-k}+\sum_{k=0}^{8}1\cdot k\cdot \frac{1}{4}\cdot \binom{8}{k}\left(p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{\frac{1}{2}}\right)^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\cdot 8p_{\frac{1}{2}}+\frac{1}{4}\cdot 8p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=2\left( p_{\frac{1}{2}}+p_{1}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance of these two random variables is therefore...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] \mathbb{E}\left[ Y\right] =2\left( p_{\frac{1}{2}}+p_{1}\right) -1=\frac{3\alpha +4\beta }{2\alpha +4\beta }-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this slightly less simple model ==&lt;br /&gt;
&lt;br /&gt;
Interesting questions would be: is it good to have this gene? In this case, a first check in search of an answer would be: &lt;br /&gt;
&lt;br /&gt;
is &amp;lt;math&amp;gt;\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;gt;1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in other words, is &amp;lt;math&amp;gt;\alpha &amp;gt;0 &amp;lt;/math&amp;gt;, which, as long as we remain within the setting of this model, is equivalent to  &amp;lt;math&amp;gt;Cov\left( X,Y\right) &amp;gt;0 &amp;lt;/math&amp;gt;. This however is only a first check, and below we will see that the answer can come in a riot of colours and flavours, especially if we are not really sure after all if the model describes reality accurately. But first we will look at what the Price equation makes of all this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With this model, the Price equation looks pretty much like the one Price formulated in his original paper. It is an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N} \sum_{i}q_{i}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;. So here that is &amp;lt;math&amp;gt;Q_{1}=1/2&amp;lt;/math&amp;gt;. The frequency of the gene in the offspring population is...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}^{\prime }}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
This differs from the Price Equation 1.0, because of the locus-drawing step. Therefore we have $q_{i}^{\prime }$, which is the frequency of the gene in the set of successful gametes produced by individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;. In the [Price_1.0 | Price Equation 1.0] this was by definition equal to the frequency &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; of the gene in the parent, but because there is a random step involved here, this is no longer the case. Of course  &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is still the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation for this model is then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime}-q_{i}\right) }{\sum_{i}z_{i}} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}^{\prime }}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}+\frac{\sum_{i}z_{i}\left(q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}+\frac{\sum_{i}z_{i}\left(q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which in this particular model is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\frac{1}{2}\left[ \frac{\sum_{i}z_{i}q_{i}}{4}-\frac{\sum_{i}q_{i}}{2}\right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime}-q_{i}\right) }{8} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
As before, it is unfortunate that George Price named the term between square brackets in this equation ''Cov(z,q)''. The claim of the Price equation - which we contend even more now - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. &lt;br /&gt;
&lt;br /&gt;
Two issues remain. One is that now there is another term on the right hand side. In the Price equation literature, this term tends to be crossed off, &amp;quot;because it will be 0 anyway&amp;quot;. This is not correct; it is typically non-zero, even if it is 0 ''in expectation''. The other issue is that &amp;quot;''Cov( z,q)''&amp;quot; is still not a covariance; it is not a constant property of a random variable, but it is a random variable itself, as it differs from draw to draw.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial2.Tutorial2.class&amp;quot;  height=&amp;quot;480&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; can go up or down by a variety of amounts. The right hand side just tags along with &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt;. This can create an illusion of understanding, but whatever happens, the terms on the right hand side of the identity just change along with the outcome of the chance experiment. In other words: the data explain the data. Moreover, crossing of a term that typically is not 0 turns the identity into a false statement.&lt;br /&gt;
&lt;br /&gt;
== What would a proper probability theorist do? ==&lt;br /&gt;
&lt;br /&gt;
Try to figure out the dynamic properties of the suggested model. With the transition probabilities (see above) we can compute the expected change in frequency, and the fixation probability of ''A'' and ''a'' given the current state. Or given any starting state. &lt;br /&gt;
&lt;br /&gt;
Prove that the assumption of fair meiosis implies that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All of this can be done without the Price equation. In fact, it is better done without, because the Price equation just does not fit the purpose.&lt;br /&gt;
&lt;br /&gt;
== What would a proper statistician do? ==&lt;br /&gt;
&lt;br /&gt;
A statistician would try to find out what the true model is, given data. That implies that she would:&lt;br /&gt;
&lt;br /&gt;
* Estimate &amp;lt;math&amp;gt;\alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test the assumption of fair meiosis&lt;br /&gt;
&lt;br /&gt;
For this test we need the meiosis term that is often discarded. Any test would involve this part of the formula, because if it remains far away from 0 even for large populations, that  wewould refute fair meiosis. So here is yet another reason why it would be just wrong to throw this quantity away, or just assume that it is 0.&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here? ==&lt;br /&gt;
&lt;br /&gt;
It doesn't. And it should worry Price Equationists that even with a relatively simple bit of modelling content, the Price equation is not of any use. Maybe things get better when the models are a bit more complicated? Well, no, of course not. As a matter of fact, things get even worse.&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 10:59:55 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_2.0</comments>		</item>
		<item>
			<title>Price 2.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_2.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* A model with sexual reproduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A model with sexual reproduction ==&lt;br /&gt;
&lt;br /&gt;
If we add sexual reproduction, everything gets slightly more complicated, the proper statistics as well as the Price equation. This makes&lt;br /&gt;
the statistics much more fun, and it makes the failure of the Price equation to be of any help even more salient. We like to keep it relatively simple&lt;br /&gt;
though, so for the moment we do not assume actual different sexes, but we do assume that every individual is diploid. That means that individuals can be ''AA'', ''Aa'' or ''aa''. The frequency of the gene is then, resp., ''1'', ''1/2'' or ''0''. Individuals are hermaphrodites for the sake of simplicity.&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 4 individuals, &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=q_{3}=1/2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;q_{4}=0&amp;lt;/math&amp;gt;. The next generation of 4 individuals is drawn as follows. First we draw a father for the first individual. From the father we draw one of the two loci, which gives us an ''A'' or an ''a''. Then we draw a mother, and one of her loci. These two loci go into the gametes for reproduction, that together give us the first individual of the offspring generation. Three repetitions of this procedure give us a whole new generation.&lt;br /&gt;
&lt;br /&gt;
We will make two crucial assumptions here.&lt;br /&gt;
&lt;br /&gt;
1) ''A'' is neither dominant nor recessive in fitness terms&lt;br /&gt;
&lt;br /&gt;
2) Fair meosis&lt;br /&gt;
&lt;br /&gt;
Both assumptions concern probabilities in this update step. The first concerns the probabilities with which an individual is chosen for parenthood. We assume that the probability with which individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; is chosen is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{P}\left( i\text{ is chosen}\right) =\frac{\alpha q_{i}+\beta }{\sum_{j=1}^{n}\left( \alpha q_{j}+\beta \right) } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With our starting point, &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=q_{3}=1/2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;q_{4}=0&amp;lt;/math&amp;gt;. which  gives us the following probabilities...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{1} =\mathbb{P}\left( 1\text{ is chosen}\right) =\frac{\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{\frac{1}{2}} =\mathbb{P}\left( 2\text{ is chosen}\right) =\frac{\frac{1}{2}\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{\frac{1}{2}} =\mathbb{P}\left( 3\text{ is chosen}\right) =\frac{\frac{1}{2}\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{0} =\mathbb{P}\left( 4\text{ is chosen}\right) =\frac{\beta }{2\alpha+4\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These formulas tells us that Assumption 1) is equivalent to saying that &amp;lt;math&amp;gt;p_{\frac{1}{2}}&amp;lt;/math&amp;gt; is the average of &amp;lt;math&amp;gt;p_{1}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;p_{0}&amp;lt;/math&amp;gt;. The second assumption just means that the probability of either locus of the parent to be chosen for passing on is 1/2.&lt;br /&gt;
&lt;br /&gt;
Again, we first draw one of the individuals from the parent population (this is a hypothetical random variable that has nothing to do with the actual&lt;br /&gt;
transition) and then draw the next generation (this is the actual random thing that happens in the the transition). The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is again defined as the genotype of the parent. For our given starting point, that is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbb{P}\left( X=\frac{1}{2}\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; as the number of successful  gametes that this parent produces. This is a slightly more  omplicated random variable, because we need to draw 8 parents for 4 offspring and because the chances depend on which of the four the (candidate) parent is that was drawn in step 1. So we get a pretty long list of conditional probabilities.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=0\right) =\binom{8}{k}\left( p_{0}\right)^{k}\left( 1-p_{0}\right) ^{8-k},\ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=\frac{1}{2}\right) =\binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k},\ \ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=1\right) =\binom{8}{k}\left( p_{1}\right)^{k}\left( 1-p_{1}\right) ^{8-k},\ \ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is well defined again, so we can also compute the covariance of these two actual random variables. Let us start with expectations...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\sum_{x=0,\frac{1}{2},1}x\mathbb{P}\left(X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{2}\mathbb{P}\left( X=\frac{1}{2}\right) +\mathbb{P}\left(X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{2}\cdot \frac{1}{2}+\frac{1}{4}=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For symmetry reasons (the total number of succesful gametes is 8, and either of the 4 could be the parent)...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =2 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ Y\right] = \sum_{x=0,\frac{1}{2},1}\sum_{y=0}^{8}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{x=0,\frac{1}{2},1}\sum_{k=0}^{8}k\mathbb{P}\left( X=x\right)  \mathbb{P}\left( Y=k|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{k=0}^{8}k\cdot \frac{1}{4}\cdot \binom{8}{k}\left( p_{0}\right) ^{k}\left( 1-p_{0}\right) ^{8-k}+\sum_{k=0}^{8}k\cdot \frac{1}{2}\cdot \binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\sum_{k=0}^{8}k\cdot \frac{1}{4}\cdot \binom{8}{k}\left(p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{0}\right) ^{k}\left(1-p_{0}\right) ^{8-k}+\frac{1}{2}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{1}\right) ^{k}\left( 1-p_{1}\right)^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\cdot 8p_{0}+\frac{1}{2}\cdot 8p_{\frac{1}{2}}+\frac{1}{4}\cdot 8p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=2p_{0}+4p_{\frac{1}{2}}+2p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{4\alpha +8\beta }{2\alpha +4\beta }=2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,\frac{1}{2},1}\sum_{y=0}^{8}xy\mathbb{P}\left( X=x,Y=y\right) \text{ (because }xy=0\text{ if either }x=0\text{ or }y=0\text{)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{x=\frac{1}{2},1}\sum_{k=0}^{8}xk\mathbb{P}\left( X=x\right) \mathbb{P}\left( Y=k|X=x\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{k=0}^{8}\frac{1}{2}\cdot k\cdot \frac{1}{2}\cdot \binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right)^{8-k}+\sum_{k=0}^{8}1\cdot k\cdot \frac{1}{4}\cdot \binom{8}{k}\left(p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{\frac{1}{2}}\right)^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\cdot 8p_{\frac{1}{2}}+\frac{1}{4}\cdot 8p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=2\left( p_{\frac{1}{2}}+p_{1}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance of these two random variables is therefore...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] \mathbb{E}\left[ Y\right] =2\left( p_{\frac{1}{2}}+p_{1}\right) -1=\frac{3\alpha +4\beta }{2\alpha +4\beta }-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this slightly less simple model ==&lt;br /&gt;
&lt;br /&gt;
Interesting questions would be: is it good to have this gene? In this case, a first check in search of an answer would be: &lt;br /&gt;
&lt;br /&gt;
is &amp;lt;math&amp;gt;\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;gt;1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in other words, is &amp;lt;math&amp;gt;\alpha &amp;gt;0 &amp;lt;/math&amp;gt;, which, as long as we remain within the setting of this model, is equivalent to  &amp;lt;math&amp;gt;Cov\left( X,Y\right) &amp;gt;0 &amp;lt;/math&amp;gt;. This however is only a first check, and below we will see that the answer can come in a riot of colours and flavours, especially if we are not really sure after all if the model describes reality accurately. But first we will look at what the Price equation makes of all this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With this model, the Price equation looks pretty much like the one Price formulated in his original paper. It is an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N} \sum_{i}q_{i}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;. So here that is &amp;lt;math&amp;gt;Q_{1}=1/2&amp;lt;/math&amp;gt;. The frequency of the gene in the offspring population is...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}^{\prime }}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
This differs from the Price Equation 1.0, because of the locus-drawing step. Therefore we have $q_{i}^{\prime }$, which is the frequency of the gene in the set of successful gametes produced by individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;. In the [Price_1.0 | Price Equation 1.0] this was by definition equal to the frequency &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; of the gene in the parent, but because there is a random step involved here, this is no longer the case. Of course  &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is still the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation for this model is then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime}-q_{i}\right) }{\sum_{i}z_{i}} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}^{\prime }}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}+\frac{\sum_{i}z_{i}\left(q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}+\frac{\sum_{i}z_{i}\left(q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which in this particular model is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\frac{1}{2}\left[ \frac{\sum_{i}z_{i}q_{i}}{4}-\frac{\sum_{i}q_{i}}{2}\right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime}-q_{i}\right) }{8} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
As before, it is unfortunate that George Price named the term between square brackets in this equation ''Cov(z,q)''. The claim of the Price equation - which we contend even more now - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. &lt;br /&gt;
&lt;br /&gt;
Two issues remain. One is that now there is another term on the right hand side. In the Price equation literature, this term tends to be crossed off, &amp;quot;because it will be 0 anyway&amp;quot;. This is not correct; it is typically non-zero, even if it is 0 ''in expectation''. The other issue is that &amp;quot;''Cov( z,q)''&amp;quot; is still not a covariance; it is not a constant property of a random variable, but it is a random variable itself, as it differs from draw to draw.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial2.Tutorial2.class&amp;quot;  height=&amp;quot;480&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; can go up or down by a variety of amounts. The right hand side just tags along with &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt;. This can create an illusion of understanding, but whatever happens, the terms on the right hand side of the identity just change along with the outcome of the chance experiment. In other words: the data explain the data. Moreover, crossing of a term that typically is not 0 turns the identity into a false statement.&lt;br /&gt;
&lt;br /&gt;
== What would a proper probability theorist do? ==&lt;br /&gt;
&lt;br /&gt;
Try to figure out the dynamic properties of the suggested model. With the transition probabilities (see above) we can compute the expected change in frequency, and the fixation probability of ''A'' and ''a'' given the current state. Or given any starting state. &lt;br /&gt;
&lt;br /&gt;
Prove that the assumption of fair meiosis implies that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All of this can be done without the Price equation. In fact, it is better done without, because the Price equation just does not fit the purpose.&lt;br /&gt;
&lt;br /&gt;
== What would a proper statistician do? ==&lt;br /&gt;
&lt;br /&gt;
A statistician would try to find out what the true model is, given data. That implies that she would:&lt;br /&gt;
&lt;br /&gt;
* Estimate &amp;lt;math&amp;gt;\alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test the assumption of fair meiosis&lt;br /&gt;
&lt;br /&gt;
For this test we need the meiosis term that is often discarded. Any test would involve this part of the formula, because if it remains far away from 0 even for large populations, that  wewould refute fair meiosis. So here is yet another reason why it would be just wrong to throw this quantity away, or just assume that it is 0.&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here? ==&lt;br /&gt;
&lt;br /&gt;
It doesn't. And it should worry Price Equationists that even with a relatively simple bit of modelling content, the Price equation is not of any use. Maybe things get better when the models are a bit more complicated? Well, no, of course not. As a matter of fact, things get even worse.&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 10:59:29 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_2.0</comments>		</item>
		<item>
			<title>Price 2.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_2.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* A model with sexual reproduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A model with sexual reproduction ==&lt;br /&gt;
&lt;br /&gt;
If we add sexual reproduction, everything gets slightly more complicated, the proper statistics as well as the Price equation. This makes&lt;br /&gt;
the statistics much more fun, and it makes the failure of the Price equation to be of any help even more salient. We like to keep it relatively simple&lt;br /&gt;
though, so for the moment we do not assume actual different sexes, but we do assume that every individual is diploid. That means that individuals can be ''AA'', ''Aa'' or ''aa''. The frequency of the gene is then, resp., ''1'', ''1/2'' or ''0''. Individuals are hermaphrodites for the sake of simplicity.&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 4 individuals, &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=q_{3}=1/2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;q_{4}=0&amp;lt;/math&amp;gt;. The next generation of 4 individuals is drawn as follows. First we draw a father for the first individual. From the father we draw one of the two loci, which gives us an ''A'' or an ''a''. Then we draw a mother, and one of her loci. These two loci go into the gametes for reproduction, that together give us the first individual of the offspring generation. Three repetitions of this procedure give us a whole new generation.&lt;br /&gt;
&lt;br /&gt;
We will make two crucial assumptions here.&lt;br /&gt;
&lt;br /&gt;
1) ''A'' is dominant nor recessive in fitness terms&lt;br /&gt;
&lt;br /&gt;
2) Fair meosis&lt;br /&gt;
&lt;br /&gt;
Both assumptions concern probabilities in this update step. The first concerns the probabilities with which an individual is chosen for parenthood. We assume that the probability with which individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; is chosen is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{P}\left( i\text{ is chosen}\right) =\frac{\alpha q_{i}+\beta }{\sum_{j=1}^{n}\left( \alpha q_{j}+\beta \right) } &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With our starting point, &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=q_{3}=1/2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;q_{4}=0&amp;lt;/math&amp;gt;. which  gives us the following probabilities...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{1} =\mathbb{P}\left( 1\text{ is chosen}\right) =\frac{\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{\frac{1}{2}} =\mathbb{P}\left( 2\text{ is chosen}\right) =\frac{\frac{1}{2}\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{\frac{1}{2}} =\mathbb{P}\left( 3\text{ is chosen}\right) =\frac{\frac{1}{2}\alpha +\beta }{2\alpha +4\beta } &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p_{0} =\mathbb{P}\left( 4\text{ is chosen}\right) =\frac{\beta }{2\alpha+4\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These formulas tells us that Assumption 1) is equivalent to saying that &amp;lt;math&amp;gt;p_{\frac{1}{2}}&amp;lt;/math&amp;gt; is the average of &amp;lt;math&amp;gt;p_{1}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;p_{0}&amp;lt;/math&amp;gt;. The second assumption just means that the probability of either locus of the parent to be chosen for passing on is 1/2.&lt;br /&gt;
&lt;br /&gt;
Again, we first draw one of the individuals from the parent population (this is a hypothetical random variable that has nothing to do with the actual&lt;br /&gt;
transition) and then draw the next generation (this is the actual random thing that happens in the the transition). The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is again defined as the genotype of the parent. For our given starting point, that is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbb{P}\left( X=\frac{1}{2}\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; as the number of successful  gametes that this parent produces. This is a slightly more  omplicated random variable, because we need to draw 8 parents for 4 offspring and because the chances depend on which of the four the (candidate) parent is that was drawn in step 1. So we get a pretty long list of conditional probabilities.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=0\right) =\binom{8}{k}\left( p_{0}\right)^{k}\left( 1-p_{0}\right) ^{8-k},\ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=\frac{1}{2}\right) =\binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k},\ \ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=k|X=1\right) =\binom{8}{k}\left( p_{1}\right)^{k}\left( 1-p_{1}\right) ^{8-k},\ \ k=1,..,8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is well defined again, so we can also compute the covariance of these two actual random variables. Let us start with expectations...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ X\right] =\sum_{x=0,\frac{1}{2},1}x\mathbb{P}\left(X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{2}\mathbb{P}\left( X=\frac{1}{2}\right) +\mathbb{P}\left(X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{2}\cdot \frac{1}{2}+\frac{1}{4}=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For symmetry reasons (the total number of succesful gametes is 8, and either of the 4 could be the parent)...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =2 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ Y\right] = \sum_{x=0,\frac{1}{2},1}\sum_{y=0}^{8}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{x=0,\frac{1}{2},1}\sum_{k=0}^{8}k\mathbb{P}\left( X=x\right)  \mathbb{P}\left( Y=k|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{k=0}^{8}k\cdot \frac{1}{4}\cdot \binom{8}{k}\left( p_{0}\right) ^{k}\left( 1-p_{0}\right) ^{8-k}+\sum_{k=0}^{8}k\cdot \frac{1}{2}\cdot \binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\sum_{k=0}^{8}k\cdot \frac{1}{4}\cdot \binom{8}{k}\left(p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{0}\right) ^{k}\left(1-p_{0}\right) ^{8-k}+\frac{1}{2}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{1}\right) ^{k}\left( 1-p_{1}\right)^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\cdot 8p_{0}+\frac{1}{2}\cdot 8p_{\frac{1}{2}}+\frac{1}{4}\cdot 8p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=2p_{0}+4p_{\frac{1}{2}}+2p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{4\alpha +8\beta }{2\alpha +4\beta }=2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,\frac{1}{2},1}\sum_{y=0}^{8}xy\mathbb{P}\left( X=x,Y=y\right) \text{ (because }xy=0\text{ if either }x=0\text{ or }y=0\text{)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{x=\frac{1}{2},1}\sum_{k=0}^{8}xk\mathbb{P}\left( X=x\right) \mathbb{P}\left( Y=k|X=x\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{k=0}^{8}\frac{1}{2}\cdot k\cdot \frac{1}{2}\cdot \binom{8}{k}\left( p_{\frac{1}{2}}\right) ^{k}\left( 1-p_{\frac{1}{2}}\right)^{8-k}+\sum_{k=0}^{8}1\cdot k\cdot \frac{1}{4}\cdot \binom{8}{k}\left(p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{\frac{1}{2}}\right)^{k}\left( 1-p_{\frac{1}{2}}\right) ^{8-k}+\frac{1}{4}\sum_{k=0}^{8}k\binom{8}{k}\left( p_{1}\right) ^{k}\left( 1-p_{1}\right) ^{8-k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{1}{4}\cdot 8p_{\frac{1}{2}}+\frac{1}{4}\cdot 8p_{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=2\left( p_{\frac{1}{2}}+p_{1}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance of these two random variables is therefore...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] \mathbb{E}\left[ Y\right] =2\left( p_{\frac{1}{2}}+p_{1}\right) -1=\frac{3\alpha +4\beta }{2\alpha +4\beta }-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this slightly less simple model ==&lt;br /&gt;
&lt;br /&gt;
Interesting questions would be: is it good to have this gene? In this case, a first check in search of an answer would be: &lt;br /&gt;
&lt;br /&gt;
is &amp;lt;math&amp;gt;\frac{3\alpha +4\beta }{2\alpha +4\beta }&amp;gt;1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in other words, is &amp;lt;math&amp;gt;\alpha &amp;gt;0 &amp;lt;/math&amp;gt;, which, as long as we remain within the setting of this model, is equivalent to  &amp;lt;math&amp;gt;Cov\left( X,Y\right) &amp;gt;0 &amp;lt;/math&amp;gt;. This however is only a first check, and below we will see that the answer can come in a riot of colours and flavours, especially if we are not really sure after all if the model describes reality accurately. But first we will look at what the Price equation makes of all this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With this model, the Price equation looks pretty much like the one Price formulated in his original paper. It is an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N} \sum_{i}q_{i}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;. So here that is &amp;lt;math&amp;gt;Q_{1}=1/2&amp;lt;/math&amp;gt;. The frequency of the gene in the offspring population is...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}^{\prime }}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
This differs from the Price Equation 1.0, because of the locus-drawing step. Therefore we have $q_{i}^{\prime }$, which is the frequency of the gene in the set of successful gametes produced by individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;. In the [Price_1.0 | Price Equation 1.0] this was by definition equal to the frequency &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; of the gene in the parent, but because there is a random step involved here, this is no longer the case. Of course  &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is still the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation for this model is then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime}-q_{i}\right) }{\sum_{i}z_{i}} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}^{\prime }}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}+\frac{\sum_{i}z_{i}\left(q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}+\frac{\sum_{i}z_{i}\left(q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which in this particular model is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\frac{1}{2}\left[ \frac{\sum_{i}z_{i}q_{i}}{4}-\frac{\sum_{i}q_{i}}{2}\right] +\frac{\sum_{i}z_{i}\left( q_{i}^{\prime}-q_{i}\right) }{8} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
As before, it is unfortunate that George Price named the term between square brackets in this equation ''Cov(z,q)''. The claim of the Price equation - which we contend even more now - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. &lt;br /&gt;
&lt;br /&gt;
Two issues remain. One is that now there is another term on the right hand side. In the Price equation literature, this term tends to be crossed off, &amp;quot;because it will be 0 anyway&amp;quot;. This is not correct; it is typically non-zero, even if it is 0 ''in expectation''. The other issue is that &amp;quot;''Cov( z,q)''&amp;quot; is still not a covariance; it is not a constant property of a random variable, but it is a random variable itself, as it differs from draw to draw.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial2.Tutorial2.class&amp;quot;  height=&amp;quot;480&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; can go up or down by a variety of amounts. The right hand side just tags along with &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt;. This can create an illusion of understanding, but whatever happens, the terms on the right hand side of the identity just change along with the outcome of the chance experiment. In other words: the data explain the data. Moreover, crossing of a term that typically is not 0 turns the identity into a false statement.&lt;br /&gt;
&lt;br /&gt;
== What would a proper probability theorist do? ==&lt;br /&gt;
&lt;br /&gt;
Try to figure out the dynamic properties of the suggested model. With the transition probabilities (see above) we can compute the expected change in frequency, and the fixation probability of ''A'' and ''a'' given the current state. Or given any starting state. &lt;br /&gt;
&lt;br /&gt;
Prove that the assumption of fair meiosis implies that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i}z_{i}\left( q_{i}^{\prime }-q_{i}\right) }{\sum_{i}z_{i}}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All of this can be done without the Price equation. In fact, it is better done without, because the Price equation just does not fit the purpose.&lt;br /&gt;
&lt;br /&gt;
== What would a proper statistician do? ==&lt;br /&gt;
&lt;br /&gt;
A statistician would try to find out what the true model is, given data. That implies that she would:&lt;br /&gt;
&lt;br /&gt;
* Estimate &amp;lt;math&amp;gt;\alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test the assumption of fair meiosis&lt;br /&gt;
&lt;br /&gt;
For this test we need the meiosis term that is often discarded. Any test would involve this part of the formula, because if it remains far away from 0 even for large populations, that  wewould refute fair meiosis. So here is yet another reason why it would be just wrong to throw this quantity away, or just assume that it is 0.&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here? ==&lt;br /&gt;
&lt;br /&gt;
It doesn't. And it should worry Price Equationists that even with a relatively simple bit of modelling content, the Price equation is not of any use. Maybe things get better when the models are a bit more complicated? Well, no, of course not. As a matter of fact, things get even worse.&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 10:58:08 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_2.0</comments>		</item>
		<item>
			<title>Price</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* Price 2.0: A model with sexual reproduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Evolution is all about transitions. One generation gives birth to the next, which gives birth to yet another generation, in an endless chain of transitions. These transitions don't just go anywhere; some transitions are more likely than others. First of all we beget offspring that is likely to bear some similarity with ourselves.  And how likely we are to get offspring at all, and how many, tends to depend on certain heritable characteristics. The relative likelihood of some transitions and the relative improbability of others imply that we can make informed guesses as to where this endless chain of transitions came from and where it is going. That is what the science of evolution does.&lt;br /&gt;
&lt;br /&gt;
The Price equation zooms in on transitions from one generation to the next. This suggests that it could be a fundamental tool for understanding this&lt;br /&gt;
process of evolution. It was formulated by George Richard Price in 1970 [http://www.nature.com/nature/journal/v227/n5257/abs/227520a0.html in an article in Nature], and acclaimed by some, maybe even quite a few, to be a fundamental ingredient for models of evolution ([http://dx.doi.org/10.1016/j.cub.2008.01.005 Gardner], [http://dx.doi.org/10.1006/jtbi.1995.0148 Frank], [http://dx.doi.org/10.1006/jtbi.2002.3015 Grafen]). We think not. We think it is an unintended hoax. The reason why it is hard to identify it as such is that it is all about probability theory and statistics, and those two topics are just not that easy. The following tutorial will help by looking at what proper probability theory or statistics would do and compare that to what the Price equation does to numbers that represent those transitions. There is [http://dx.doi.org/10.1016/j.jtbi.2005.04.026 an article with the same message], but this tutorial makes it simpler, by allowing you to play around with models, data and samples yourself. At some points you may find that the steps the tutorial takes are evident and all too easy, but it is possible that after a few steps, as simple as they are, you may nonetheless feel confused enough to make you want to retrace your steps and be happy, the second time around, that they are that simple. Or not, in which case you will just have an easy journey to a deep understanding why the Price equation is not what some say it is.&lt;br /&gt;
&lt;br /&gt;
==Price 1.0: A very simple model ==&lt;br /&gt;
We will begin with the simplest real model that we can think of. No sex, no shrinking or expanding populations, no frequency dependence, no&lt;br /&gt;
complications whatsoever. Just two individuals that are ready to reproduce. Asexually. This gives us a version of the Price equation that is even&lt;br /&gt;
simpler than the first version by Price himself. And it will give us probability theory and statistics that is relatively nice and easy too, and therefore an excellent start that helps us get acquainted to the joys of rigour and precision.&lt;br /&gt;
&lt;br /&gt;
[[Price 1.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 1.0 Applet | Go straight to the software]]&lt;br /&gt;
&lt;br /&gt;
== Price 2.0: A model with sexual reproduction ==&lt;br /&gt;
&lt;br /&gt;
If we add sexual reproduction, everything gets slightly more complicated, the proper statistics as well as the Price equation. This makes&lt;br /&gt;
the statistics much more fun, and it makes the failure of the Price equation to be of any help even more salient. We like to keep it relatively simple though, so for the moment we do not assume actual different sexes, but we do assume that every individual is diploid.&lt;br /&gt;
&lt;br /&gt;
[[Price 2.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 2.0 Applet | Go straight to the software]]&lt;br /&gt;
&lt;br /&gt;
== Price 3.0: A model with frequency dependence ==&lt;br /&gt;
&lt;br /&gt;
We go back to the asexual model, but now we will take a model with frequency dependence. This will be a bit more complicated, but we can still use a basic, well known model. They are paired randomly, and play a game in those pairs. The game gives them payoffs according to a payoff matrix&lt;br /&gt;
&lt;br /&gt;
[[Price 3.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 3.0 Applet | Go straight to the software]]&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 10:57:17 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price</comments>		</item>
		<item>
			<title>Price 1.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_1.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* So how does the Price equation help here? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A very simple model ==&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 2 individuals. We depart from a  population in which individual no 1 has &amp;quot;the&amp;quot; gene, while the other, individual no 2, does not. In Price equation terms, that means that the variable &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt;, which denotes the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; becomes: &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The next generation of 2 individuals is drawn in a very simple way. First we draw the first, and then we draw the second. That makes it a Wright-Fisher process. At both draws the new individual could be the offspring of individual no 1 or of individual no 2. Reproduction is asexual, hence the offspring is a perfect copy of its parent. Now here comes the important thing. We assume that at both draws, the probability of no 1 from the parent population - the one with the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt;, while the probability of no 2 from the parent population - the one without the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;1-p&amp;lt;/math&amp;gt;. That gives us four possible transitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Price1Setting.jpg|400px|center|thumb|Four possible transitions]]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What the new generation will be is a random variable. What the current generation is, '''is not'''; the current generation is simply given. We can however think of a ''hypothetical'' chance experiment such that, in combination with the actual random transition, we get two random variables, between which we can define a covariance. So here is the recipe. &lt;br /&gt;
&lt;br /&gt;
1) Draw one of the individuals from the parent population (this is the hypothetical random variable).&lt;br /&gt;
&lt;br /&gt;
2) Draw the next generation (this is the actual random thing that happens in the the transition).&lt;br /&gt;
&lt;br /&gt;
The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is now defined as the genotype of the parent. That is a simple, albeit hypothetical random variable: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left(&lt;br /&gt;
X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt;, which is the number of offspring that the parent that has been drawn begets. This is a slightly more complicated random variable, because the chances depend on which one of the two possible parents has been chosen. So we get a (not too long) list of conditional probabilities. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=0 | X=0\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1 | X=0\right) = 2p \left( 1-p\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=2 | X=0\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The other conditional probabilities are the reverse, because the parent of a new individual is the one if it is not the other, and vice versa.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=0|X=1\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1|X=1\right) =2p\left( 1-p\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=2|X=1\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  &amp;lt;math&amp;gt;X &amp;lt;/math&amp;gt; and  &amp;lt;math&amp;gt;Y &amp;lt;/math&amp;gt; are pretty well defined, so we can also compute the covariance of these two actual random variables.&lt;br /&gt;
&lt;br /&gt;
Let us first look at expectations...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{E}\left[ X\right]=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ X\right] =\sum_{x=0,1}x\mathbb{P}\left( X=x\right) =\mathbb{P}\left( X=1\right) =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For obvious symmetry reasons; the total number of offspring is 2, and either one could be the parent, so ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =1&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =\sum_{x=0,1}\sum_{y=0,1,2}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{y=1,2}\sum_{x=0,1}y\mathbb{P}\left( X=x\right) \mathbb{P}\left(Y=y|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \left( \frac{1}{2}\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot 2p\left( 1-p\right) \right) +2\cdot \left( \frac{1}{2}\cdot p^{2}+\frac{1}{2}\cdot \left( 1-p\right) ^{2}\right) = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
... and ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] = p &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,1}\sum_{y=0,1,2}xy\mathbb{P}\left( X=x,Y=y\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(because &amp;lt;math&amp;gt;xy=0&amp;lt;/math&amp;gt; if either &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;y=0&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\sum_{x=1}\sum_{y=1,2}xy\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1,Y=1\right) +2\cdot \mathbb{P}\left(X=1,Y=2\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1\right) \cdot \mathbb{P}\left(Y=1|X=1\right) +2\cdot \mathbb{P}\left( X=1\right) \mathbb{P}\left(Y=2|X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \frac{1}{2}\cdot 2p\left( 1-p\right) +2\cdot \frac{1}{2}\cdot p^{2}= &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=p\left( 1-p\right) +p^{2}= p&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance is then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] &lt;br /&gt;
\mathbb{E}\left[ Y\right] =p-\frac{1}{2}\cdot 1=p-\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this very simple model ==&lt;br /&gt;
&lt;br /&gt;
An interesting question would be: is it good to have the gene? &lt;br /&gt;
&lt;br /&gt;
Or, if we do statistics: suppose we know that the process has this form, but we  don't know the value of ''p''. Then the question becomes: is ''p&amp;gt;1/2'', or, equivalently, is ''Cov( X,Y) &amp;gt;0''? Below we will try to answer that question. But first we will look at what the Price equation does to all of this.&lt;br /&gt;
&lt;br /&gt;
For a given transition, the Price equation constitutes an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N}\sum_{i}q_{i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; (For this particular model this quantity is 0.5).&lt;br /&gt;
&lt;br /&gt;
The frequency of the gene in the offspring population is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation 1.0 then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this simple case for N = 2 this amounts to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i}}{2}\right] &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
The point where confusion starts, is that George Price named the right hand side of this equation ''Cov(z,q)''. The claim of the Price equation - which we contend - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. The central issue here is that this ''Cov(z,q)'' is discussed as if it were a real covariance. Is that correct? &lt;br /&gt;
&lt;br /&gt;
Try yourself!&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial1.Tutorial1.class&amp;quot;  height=&amp;quot;400&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency ''Q'' can go up by 1/2, remain what it is, or go down by 1/2. The value of this so-called ''Covariance'' just follows that change in frequency (and because it is not a real covariance, we will use quotation marks from now on). This creates an illusion of understanding, because whatever happens, the covariance changes along with the outcome of the chance experiment. In other words: '''the data explain the data'''. &lt;br /&gt;
&lt;br /&gt;
This is, of course, not OK; the true and well-defined covariance is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) = p-\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This does not depend on the realisation. Cov(X,Y) defines the properties of the chance experiment, and the realisation of this chance experiment defines &amp;quot;Cov(z,q)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==What would a probability theorist do?==&lt;br /&gt;
&lt;br /&gt;
Try to figure out the transition probabilities for the suggested model. It seems that you are a proper probability theorist, because that is what you just did.  Congrats!&lt;br /&gt;
&lt;br /&gt;
== What would a statistician do? ==&lt;br /&gt;
&lt;br /&gt;
If you are interested in statistics, which is only natural if you care for evolution, and you do not know the true model that generates the transitions, then you would want to try to answer the question what ''p'' is. Is ''p&amp;gt;1/2''? Then having the gene is good for reproduction. Is ''p&amp;lt;1/2''? Then not. &lt;br /&gt;
&lt;br /&gt;
Is ''p=1/2''? Then it is good nor bad. So how do we find out? Well, the thing with statistics is that you will never find out for sure. All we can do is try to find ways to estimate this ''p'', or design tests on if and how ''p'' differs from ''1/2'', that will help us make statements about the true model with some confidence. Here are a few such statements.&lt;br /&gt;
&lt;br /&gt;
===Estimation of p===&lt;br /&gt;
&lt;br /&gt;
One of the reasons that so many are convinced of the value of the Price equation is that it ''almost'' hits the nail on the head (even though it misses the head completely). So here we go with what sometimes feels as an indication that the Price equation is not so wrong after all. If you sense this in yourself, just return to the interactive part above.&lt;br /&gt;
&lt;br /&gt;
If you draw a new generation, then that new generation comes with a &amp;quot;Cov(z,q)&amp;quot; . With probability &amp;lt;math&amp;gt;p^{2}&amp;lt;/math&amp;gt; you draw  two 1's, which implies  &amp;quot;Cov(z,q)&amp;quot;=+1/2. With probability &amp;lt;math&amp;gt;(1-p) ^{2}&amp;lt;/math&amp;gt; you draw  two 0's, which implies &amp;quot;Cov(z,q)&amp;quot;=-1/2. So&amp;quot;Cov(z,q)&amp;quot; is actually a random variable itself, the characteristics of which we can look at. Two natural characteristics are its expected value and its variance. Now the expectation of this so-called variance is, luckily,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}. &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i} }{2}\right] = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=\sum_{z_{1}=0,1,2}\left[ \frac{z_{1}q_{1}}{2}-\frac{q_{1}}{2}\right] &lt;br /&gt;
\mathbb{P}\left( Z_{1}=z_{1}\right) = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=-\frac{1}{2}\cdot \left( 1-p\right) ^{2}+0\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot p^{2}=p-\frac{1}{2}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the realisation varies quite a bit, as we have seen in interactive part above. This is reflected in the variance of &amp;quot;Cov(z,q)&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] = \frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \left( ^{\prime \prime }Cov\left( z,q\right) ^{\prime&lt;br /&gt;
\prime }\right) ^{2}\right] -\mathbb{E}^{2}\left[ \left( ^{\prime \prime}Cov\left( z,q\right) ^{\prime \prime }\right) \right] =\frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This variance can be reduced though if we take a large sample. Suppose that we have individuals ''i=1,...,n'' with the gene, and individuals ''i=n+1,...,2n''&lt;br /&gt;
without it. Now we draw the next generation in the same way as before, which looks a bit more general; ''2n'' individuals are drawn, and at every draw&lt;br /&gt;
individual ''i'' has a probability with which it is drawn to reproduce. For ''i=1,...,n'' this probability is &amp;lt;math&amp;gt;\frac{p_{1}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
For ''i=n+1,...,2n'' this probability is &amp;lt;math&amp;gt;\frac{p_{0}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. For this transition, one can show that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =p-\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\lim_{n\rightarrow \infty }Var\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we indeed define &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime \prime }Cov\left( z,q\right)^{\prime \prime }&amp;lt;/math&amp;gt;  as &amp;lt;math&amp;gt;\frac{1}{2n}\left(\sum_{i=1}^{2n}z_{i}q_{i}- \sum_{i=1}^{2n}q_{i}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }+\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is an unbiased estimator of ''p'' - because &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The quantity &amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }&amp;lt;/math&amp;gt; is also regularly referred to as the ''sample'' covariance, which is not the true covariance (the covariance is a fixed property of two random variables, the sample covariance is a random variable itself).&lt;br /&gt;
&lt;br /&gt;
===Testing properties of p ===&lt;br /&gt;
&lt;br /&gt;
The ''sample'' covariance is typically also used as input for in tests of the type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{0} : p=\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{1} : p\neq \frac{1}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here?== &lt;br /&gt;
&lt;br /&gt;
Not. For determining the properties of the model, the Price equation did not help, and in fact cannot even be of use. We found the transition&lt;br /&gt;
probabilities just by doing probability calculations. For doing statistics the Price equation did not help either. And yes, the Price equation applied to one actual draw does have the sample covariance of that draw in it, and the sample covariance is a useful thing, but we do not need the Price&lt;br /&gt;
equation for knowing that the sample covariance is useful. The sample covariance has been around since the 1880's, when Karl Pearson (1857 – 1936) introduced it, along with the distinction between covariance and sample covariance. It was there well before George Price&lt;br /&gt;
was born, and it is used in parameter estimation and hypothesis testing in all other fields of science, where no one has ever heard of G.R. Price. And, most importantly, using the sample covariance is obviously not the same as using the Price equation. It is using the sample covariance.&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 10:56:19 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_1.0</comments>		</item>
		<item>
			<title>Price 1.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_1.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* Estimation of p */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A very simple model ==&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 2 individuals. We depart from a  population in which individual no 1 has &amp;quot;the&amp;quot; gene, while the other, individual no 2, does not. In Price equation terms, that means that the variable &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt;, which denotes the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; becomes: &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The next generation of 2 individuals is drawn in a very simple way. First we draw the first, and then we draw the second. That makes it a Wright-Fisher process. At both draws the new individual could be the offspring of individual no 1 or of individual no 2. Reproduction is asexual, hence the offspring is a perfect copy of its parent. Now here comes the important thing. We assume that at both draws, the probability of no 1 from the parent population - the one with the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt;, while the probability of no 2 from the parent population - the one without the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;1-p&amp;lt;/math&amp;gt;. That gives us four possible transitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Price1Setting.jpg|400px|center|thumb|Four possible transitions]]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What the new generation will be is a random variable. What the current generation is, '''is not'''; the current generation is simply given. We can however think of a ''hypothetical'' chance experiment such that, in combination with the actual random transition, we get two random variables, between which we can define a covariance. So here is the recipe. &lt;br /&gt;
&lt;br /&gt;
1) Draw one of the individuals from the parent population (this is the hypothetical random variable).&lt;br /&gt;
&lt;br /&gt;
2) Draw the next generation (this is the actual random thing that happens in the the transition).&lt;br /&gt;
&lt;br /&gt;
The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is now defined as the genotype of the parent. That is a simple, albeit hypothetical random variable: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left(&lt;br /&gt;
X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt;, which is the number of offspring that the parent that has been drawn begets. This is a slightly more complicated random variable, because the chances depend on which one of the two possible parents has been chosen. So we get a (not too long) list of conditional probabilities. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=0 | X=0\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1 | X=0\right) = 2p \left( 1-p\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=2 | X=0\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The other conditional probabilities are the reverse, because the parent of a new individual is the one if it is not the other, and vice versa.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=0|X=1\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1|X=1\right) =2p\left( 1-p\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=2|X=1\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  &amp;lt;math&amp;gt;X &amp;lt;/math&amp;gt; and  &amp;lt;math&amp;gt;Y &amp;lt;/math&amp;gt; are pretty well defined, so we can also compute the covariance of these two actual random variables.&lt;br /&gt;
&lt;br /&gt;
Let us first look at expectations...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{E}\left[ X\right]=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ X\right] =\sum_{x=0,1}x\mathbb{P}\left( X=x\right) =\mathbb{P}\left( X=1\right) =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For obvious symmetry reasons; the total number of offspring is 2, and either one could be the parent, so ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =1&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =\sum_{x=0,1}\sum_{y=0,1,2}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{y=1,2}\sum_{x=0,1}y\mathbb{P}\left( X=x\right) \mathbb{P}\left(Y=y|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \left( \frac{1}{2}\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot 2p\left( 1-p\right) \right) +2\cdot \left( \frac{1}{2}\cdot p^{2}+\frac{1}{2}\cdot \left( 1-p\right) ^{2}\right) = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
... and ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] = p &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,1}\sum_{y=0,1,2}xy\mathbb{P}\left( X=x,Y=y\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(because &amp;lt;math&amp;gt;xy=0&amp;lt;/math&amp;gt; if either &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;y=0&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\sum_{x=1}\sum_{y=1,2}xy\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1,Y=1\right) +2\cdot \mathbb{P}\left(X=1,Y=2\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1\right) \cdot \mathbb{P}\left(Y=1|X=1\right) +2\cdot \mathbb{P}\left( X=1\right) \mathbb{P}\left(Y=2|X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \frac{1}{2}\cdot 2p\left( 1-p\right) +2\cdot \frac{1}{2}\cdot p^{2}= &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=p\left( 1-p\right) +p^{2}= p&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance is then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] &lt;br /&gt;
\mathbb{E}\left[ Y\right] =p-\frac{1}{2}\cdot 1=p-\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this very simple model ==&lt;br /&gt;
&lt;br /&gt;
An interesting question would be: is it good to have the gene? &lt;br /&gt;
&lt;br /&gt;
Or, if we do statistics: suppose we know that the process has this form, but we  don't know the value of ''p''. Then the question becomes: is ''p&amp;gt;1/2'', or, equivalently, is ''Cov( X,Y) &amp;gt;0''? Below we will try to answer that question. But first we will look at what the Price equation does to all of this.&lt;br /&gt;
&lt;br /&gt;
For a given transition, the Price equation constitutes an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N}\sum_{i}q_{i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; (For this particular model this quantity is 0.5).&lt;br /&gt;
&lt;br /&gt;
The frequency of the gene in the offspring population is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation 1.0 then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this simple case for N = 2 this amounts to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i}}{2}\right] &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
The point where confusion starts, is that George Price named the right hand side of this equation ''Cov(z,q)''. The claim of the Price equation - which we contend - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. The central issue here is that this ''Cov(z,q)'' is discussed as if it were a real covariance. Is that correct? &lt;br /&gt;
&lt;br /&gt;
Try yourself!&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial1.Tutorial1.class&amp;quot;  height=&amp;quot;400&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency ''Q'' can go up by 1/2, remain what it is, or go down by 1/2. The value of this so-called ''Covariance'' just follows that change in frequency (and because it is not a real covariance, we will use quotation marks from now on). This creates an illusion of understanding, because whatever happens, the covariance changes along with the outcome of the chance experiment. In other words: '''the data explain the data'''. &lt;br /&gt;
&lt;br /&gt;
This is, of course, not OK; the true and well-defined covariance is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) = p-\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This does not depend on the realisation. Cov(X,Y) defines the properties of the chance experiment, and the realisation of this chance experiment defines &amp;quot;Cov(z,q)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==What would a probability theorist do?==&lt;br /&gt;
&lt;br /&gt;
Try to figure out the transition probabilities for the suggested model. It seems that you are a proper probability theorist, because that is what you just did.  Congrats!&lt;br /&gt;
&lt;br /&gt;
== What would a statistician do? ==&lt;br /&gt;
&lt;br /&gt;
If you are interested in statistics, which is only natural if you care for evolution, and you do not know the true model that generates the transitions, then you would want to try to answer the question what ''p'' is. Is ''p&amp;gt;1/2''? Then having the gene is good for reproduction. Is ''p&amp;lt;1/2''? Then not. &lt;br /&gt;
&lt;br /&gt;
Is ''p=1/2''? Then it is good nor bad. So how do we find out? Well, the thing with statistics is that you will never find out for sure. All we can do is try to find ways to estimate this ''p'', or design tests on if and how ''p'' differs from ''1/2'', that will help us make statements about the true model with some confidence. Here are a few such statements.&lt;br /&gt;
&lt;br /&gt;
===Estimation of p===&lt;br /&gt;
&lt;br /&gt;
One of the reasons that so many are convinced of the value of the Price equation is that it ''almost'' hits the nail on the head (even though it misses the head completely). So here we go with what sometimes feels as an indication that the Price equation is not so wrong after all. If you sense this in yourself, just return to the interactive part above.&lt;br /&gt;
&lt;br /&gt;
If you draw a new generation, then that new generation comes with a &amp;quot;Cov(z,q)&amp;quot; . With probability &amp;lt;math&amp;gt;p^{2}&amp;lt;/math&amp;gt; you draw  two 1's, which implies  &amp;quot;Cov(z,q)&amp;quot;=+1/2. With probability &amp;lt;math&amp;gt;(1-p) ^{2}&amp;lt;/math&amp;gt; you draw  two 0's, which implies &amp;quot;Cov(z,q)&amp;quot;=-1/2. So&amp;quot;Cov(z,q)&amp;quot; is actually a random variable itself, the characteristics of which we can look at. Two natural characteristics are its expected value and its variance. Now the expectation of this so-called variance is, luckily,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}. &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i} }{2}\right] = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=\sum_{z_{1}=0,1,2}\left[ \frac{z_{1}q_{1}}{2}-\frac{q_{1}}{2}\right] &lt;br /&gt;
\mathbb{P}\left( Z_{1}=z_{1}\right) = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=-\frac{1}{2}\cdot \left( 1-p\right) ^{2}+0\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot p^{2}=p-\frac{1}{2}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the realisation varies quite a bit, as we have seen in interactive part above. This is reflected in the variance of &amp;quot;Cov(z,q)&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] = \frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \left( ^{\prime \prime }Cov\left( z,q\right) ^{\prime&lt;br /&gt;
\prime }\right) ^{2}\right] -\mathbb{E}^{2}\left[ \left( ^{\prime \prime}Cov\left( z,q\right) ^{\prime \prime }\right) \right] =\frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This variance can be reduced though if we take a large sample. Suppose that we have individuals ''i=1,...,n'' with the gene, and individuals ''i=n+1,...,2n''&lt;br /&gt;
without it. Now we draw the next generation in the same way as before, which looks a bit more general; ''2n'' individuals are drawn, and at every draw&lt;br /&gt;
individual ''i'' has a probability with which it is drawn to reproduce. For ''i=1,...,n'' this probability is &amp;lt;math&amp;gt;\frac{p_{1}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
For ''i=n+1,...,2n'' this probability is &amp;lt;math&amp;gt;\frac{p_{0}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. For this transition, one can show that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =p-\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\lim_{n\rightarrow \infty }Var\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we indeed define &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime \prime }Cov\left( z,q\right)^{\prime \prime }&amp;lt;/math&amp;gt;  as &amp;lt;math&amp;gt;\frac{1}{2n}\left(\sum_{i=1}^{2n}z_{i}q_{i}- \sum_{i=1}^{2n}q_{i}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }+\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is an unbiased estimator of ''p'' - because &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The quantity &amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }&amp;lt;/math&amp;gt; is also regularly referred to as the ''sample'' covariance, which is not the true covariance (the covariance is a fixed property of two random variables, the sample covariance is a random variable itself).&lt;br /&gt;
&lt;br /&gt;
===Testing properties of p ===&lt;br /&gt;
&lt;br /&gt;
The ''sample'' covariance is typically also used as input for in tests of the type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{0} : p=\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{1} : p\neq \frac{1}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here?== &lt;br /&gt;
&lt;br /&gt;
Not. For determining the properties of the model, the Price equation did not help, and in fact cannot even be of use. We found the transition&lt;br /&gt;
probabilities just by doing probability calculations. For doing statistics the Price equation did not help either. And yes, the Price equation applied to one actual draw does have the sample covariance of that draw in it, and the sample covariance is a useful thing, but we do not need the Price&lt;br /&gt;
equation for knowing that the sample covariance is useful. The sample covariance has been around forever; it was there well before George Price&lt;br /&gt;
was born, and it is used in parameter estmation and hypothesis testing in all other fields of science, where no one has ever heard of G.R. Price. And, most importantly, using the sample covariance is obviously not the same as using the Price equation. It is using the sample covariance.&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 10:52:28 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_1.0</comments>		</item>
		<item>
			<title>Price 1.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_1.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* What would a statistician do? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A very simple model ==&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 2 individuals. We depart from a  population in which individual no 1 has &amp;quot;the&amp;quot; gene, while the other, individual no 2, does not. In Price equation terms, that means that the variable &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt;, which denotes the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; becomes: &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The next generation of 2 individuals is drawn in a very simple way. First we draw the first, and then we draw the second. That makes it a Wright-Fisher process. At both draws the new individual could be the offspring of individual no 1 or of individual no 2. Reproduction is asexual, hence the offspring is a perfect copy of its parent. Now here comes the important thing. We assume that at both draws, the probability of no 1 from the parent population - the one with the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt;, while the probability of no 2 from the parent population - the one without the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;1-p&amp;lt;/math&amp;gt;. That gives us four possible transitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Price1Setting.jpg|400px|center|thumb|Four possible transitions]]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What the new generation will be is a random variable. What the current generation is, '''is not'''; the current generation is simply given. We can however think of a ''hypothetical'' chance experiment such that, in combination with the actual random transition, we get two random variables, between which we can define a covariance. So here is the recipe. &lt;br /&gt;
&lt;br /&gt;
1) Draw one of the individuals from the parent population (this is the hypothetical random variable).&lt;br /&gt;
&lt;br /&gt;
2) Draw the next generation (this is the actual random thing that happens in the the transition).&lt;br /&gt;
&lt;br /&gt;
The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is now defined as the genotype of the parent. That is a simple, albeit hypothetical random variable: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left(&lt;br /&gt;
X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt;, which is the number of offspring that the parent that has been drawn begets. This is a slightly more complicated random variable, because the chances depend on which one of the two possible parents has been chosen. So we get a (not too long) list of conditional probabilities. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=0 | X=0\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1 | X=0\right) = 2p \left( 1-p\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=2 | X=0\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The other conditional probabilities are the reverse, because the parent of a new individual is the one if it is not the other, and vice versa.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=0|X=1\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1|X=1\right) =2p\left( 1-p\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=2|X=1\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  &amp;lt;math&amp;gt;X &amp;lt;/math&amp;gt; and  &amp;lt;math&amp;gt;Y &amp;lt;/math&amp;gt; are pretty well defined, so we can also compute the covariance of these two actual random variables.&lt;br /&gt;
&lt;br /&gt;
Let us first look at expectations...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{E}\left[ X\right]=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ X\right] =\sum_{x=0,1}x\mathbb{P}\left( X=x\right) =\mathbb{P}\left( X=1\right) =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For obvious symmetry reasons; the total number of offspring is 2, and either one could be the parent, so ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =1&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =\sum_{x=0,1}\sum_{y=0,1,2}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{y=1,2}\sum_{x=0,1}y\mathbb{P}\left( X=x\right) \mathbb{P}\left(Y=y|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \left( \frac{1}{2}\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot 2p\left( 1-p\right) \right) +2\cdot \left( \frac{1}{2}\cdot p^{2}+\frac{1}{2}\cdot \left( 1-p\right) ^{2}\right) = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
... and ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] = p &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,1}\sum_{y=0,1,2}xy\mathbb{P}\left( X=x,Y=y\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(because &amp;lt;math&amp;gt;xy=0&amp;lt;/math&amp;gt; if either &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;y=0&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\sum_{x=1}\sum_{y=1,2}xy\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1,Y=1\right) +2\cdot \mathbb{P}\left(X=1,Y=2\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1\right) \cdot \mathbb{P}\left(Y=1|X=1\right) +2\cdot \mathbb{P}\left( X=1\right) \mathbb{P}\left(Y=2|X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \frac{1}{2}\cdot 2p\left( 1-p\right) +2\cdot \frac{1}{2}\cdot p^{2}= &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=p\left( 1-p\right) +p^{2}= p&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance is then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] &lt;br /&gt;
\mathbb{E}\left[ Y\right] =p-\frac{1}{2}\cdot 1=p-\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this very simple model ==&lt;br /&gt;
&lt;br /&gt;
An interesting question would be: is it good to have the gene? &lt;br /&gt;
&lt;br /&gt;
Or, if we do statistics: suppose we know that the process has this form, but we  don't know the value of ''p''. Then the question becomes: is ''p&amp;gt;1/2'', or, equivalently, is ''Cov( X,Y) &amp;gt;0''? Below we will try to answer that question. But first we will look at what the Price equation does to all of this.&lt;br /&gt;
&lt;br /&gt;
For a given transition, the Price equation constitutes an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N}\sum_{i}q_{i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; (For this particular model this quantity is 0.5).&lt;br /&gt;
&lt;br /&gt;
The frequency of the gene in the offspring population is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation 1.0 then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this simple case for N = 2 this amounts to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i}}{2}\right] &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
The point where confusion starts, is that George Price named the right hand side of this equation ''Cov(z,q)''. The claim of the Price equation - which we contend - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. The central issue here is that this ''Cov(z,q)'' is discussed as if it were a real covariance. Is that correct? &lt;br /&gt;
&lt;br /&gt;
Try yourself!&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial1.Tutorial1.class&amp;quot;  height=&amp;quot;400&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency ''Q'' can go up by 1/2, remain what it is, or go down by 1/2. The value of this so-called ''Covariance'' just follows that change in frequency (and because it is not a real covariance, we will use quotation marks from now on). This creates an illusion of understanding, because whatever happens, the covariance changes along with the outcome of the chance experiment. In other words: '''the data explain the data'''. &lt;br /&gt;
&lt;br /&gt;
This is, of course, not OK; the true and well-defined covariance is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) = p-\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This does not depend on the realisation. Cov(X,Y) defines the properties of the chance experiment, and the realisation of this chance experiment defines &amp;quot;Cov(z,q)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==What would a probability theorist do?==&lt;br /&gt;
&lt;br /&gt;
Try to figure out the transition probabilities for the suggested model. It seems that you are a proper probability theorist, because that is what you just did.  Congrats!&lt;br /&gt;
&lt;br /&gt;
== What would a statistician do? ==&lt;br /&gt;
&lt;br /&gt;
If you are interested in statistics, which is only natural if you care for evolution, and you do not know the true model that generates the transitions, then you would want to try to answer the question what ''p'' is. Is ''p&amp;gt;1/2''? Then having the gene is good for reproduction. Is ''p&amp;lt;1/2''? Then not. &lt;br /&gt;
&lt;br /&gt;
Is ''p=1/2''? Then it is good nor bad. So how do we find out? Well, the thing with statistics is that you will never find out for sure. All we can do is try to find ways to estimate this ''p'', or design tests on if and how ''p'' differs from ''1/2'', that will help us make statements about the true model with some confidence. Here are a few such statements.&lt;br /&gt;
&lt;br /&gt;
===Estimation of p===&lt;br /&gt;
&lt;br /&gt;
One of the reasons that so many are convinced of the value of the Price equation is that it ''almost'' hits the nail on the head (even though it misses the head completely). So here we go with what sometimes feels as an indication that the Price equation is not so wrong after all. If you sense this in yourself, just return to the interactive part above.&lt;br /&gt;
&lt;br /&gt;
If you draw a new generation, then that new generation comes with a &amp;quot;Cov(z,q)&amp;quot; . With probability &amp;lt;math&amp;gt;p^{2}&amp;lt;/math&amp;gt; you draw  two 1's, which implies  &amp;quot;Cov(z,q)&amp;quot;=+1/2. With probability &amp;lt;math&amp;gt;(1-p) ^{2}&amp;lt;/math&amp;gt; you draw  two 0's, which implies &amp;quot;Cov(z,q)&amp;quot;=-1/2. So&amp;quot;Cov(z,q)&amp;quot; is actually a random variable itself, the characteristics of which we can look at. Two natural characteristics are its expected value and its variance. Now the expectation of this so-called variance is, luckily,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}. &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i} }{2}\right] = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=\sum_{z_{1}=0,1,2}\left[ \frac{z_{1}q_{1}}{2}-\frac{q_{1}}{2}\right] &lt;br /&gt;
\mathbb{P}\left( Z_{1}=z_{1}\right) = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=-\frac{1}{2}\cdot \left( 1-p\right) ^{2}+0\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot p^{2}=p-\frac{1}{2}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the realisation varies quite a bit, as we have seen in interactive part above. This is reflected in the variance of &amp;quot;Cov(z,q)&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] = \frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \left( ^{\prime \prime }Cov\left( z,q\right) ^{\prime&lt;br /&gt;
\prime }\right) ^{2}\right] -\mathbb{E}^{2}\left[ \left( ^{\prime \prime}Cov\left( z,q\right) ^{\prime \prime }\right) \right] =\frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This variance can be reduced though if we take a large sample. Suppose that we have individuals ''i=1,...,n'' with the gene, and individuals ''i=n+1,...,2n''&lt;br /&gt;
without it. Now we draw the next generation in the same way as before, which looks a bit more general; ''2n'' individuals are drawn, and at every draw&lt;br /&gt;
individual ''i'' has a probability with which it is drawn to reproduce. For ''i=1,...,n'' this probability is &amp;lt;math&amp;gt;\frac{p_{1}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
For ''i=n+1,...,2n'' this probability is &amp;lt;math&amp;gt;\frac{p_{0}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. For this transition, one can show that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =p-\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\lim_{n\rightarrow \infty }Var\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we indeed define &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime \prime }Cov\left( z,q\right)^{\prime \prime }&amp;lt;/math&amp;gt;  as &amp;lt;math&amp;gt;\frac{1}{2n}\left(\sum_{i=1}^{2n}z_{i}q_{i}- \sum_{i=1}^{2n}q_{i}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }+\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is an unbiased estimator of ''p'' - because &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The quantity &amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }&amp;lt;/math&amp;gt; is also regularly referred to as the ''sample'' covariance, which is not the true covariance (true covariance = fixed property of two random variables, sample covariance = itself a random variable).&lt;br /&gt;
&lt;br /&gt;
===Testing properties of p ===&lt;br /&gt;
&lt;br /&gt;
The ''sample'' covariance is typically also used as input for in tests of the type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{0} : p=\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{1} : p\neq \frac{1}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here?== &lt;br /&gt;
&lt;br /&gt;
Not. For determining the properties of the model, the Price equation did not help, and in fact cannot even be of use. We found the transition&lt;br /&gt;
probabilities just by doing probability calculations. For doing statistics the Price equation did not help either. And yes, the Price equation applied to one actual draw does have the sample covariance of that draw in it, and the sample covariance is a useful thing, but we do not need the Price&lt;br /&gt;
equation for knowing that the sample covariance is useful. The sample covariance has been around forever; it was there well before George Price&lt;br /&gt;
was born, and it is used in parameter estmation and hypothesis testing in all other fields of science, where no one has ever heard of G.R. Price. And, most importantly, using the sample covariance is obviously not the same as using the Price equation. It is using the sample covariance.&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 10:50:56 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_1.0</comments>		</item>
		<item>
			<title>Price 1.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_1.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* What would a statistician do? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A very simple model ==&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 2 individuals. We depart from a  population in which individual no 1 has &amp;quot;the&amp;quot; gene, while the other, individual no 2, does not. In Price equation terms, that means that the variable &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt;, which denotes the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; becomes: &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The next generation of 2 individuals is drawn in a very simple way. First we draw the first, and then we draw the second. That makes it a Wright-Fisher process. At both draws the new individual could be the offspring of individual no 1 or of individual no 2. Reproduction is asexual, hence the offspring is a perfect copy of its parent. Now here comes the important thing. We assume that at both draws, the probability of no 1 from the parent population - the one with the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt;, while the probability of no 2 from the parent population - the one without the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;1-p&amp;lt;/math&amp;gt;. That gives us four possible transitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Price1Setting.jpg|400px|center|thumb|Four possible transitions]]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What the new generation will be is a random variable. What the current generation is, '''is not'''; the current generation is simply given. We can however think of a ''hypothetical'' chance experiment such that, in combination with the actual random transition, we get two random variables, between which we can define a covariance. So here is the recipe. &lt;br /&gt;
&lt;br /&gt;
1) Draw one of the individuals from the parent population (this is the hypothetical random variable).&lt;br /&gt;
&lt;br /&gt;
2) Draw the next generation (this is the actual random thing that happens in the the transition).&lt;br /&gt;
&lt;br /&gt;
The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is now defined as the genotype of the parent. That is a simple, albeit hypothetical random variable: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left(&lt;br /&gt;
X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt;, which is the number of offspring that the parent that has been drawn begets. This is a slightly more complicated random variable, because the chances depend on which one of the two possible parents has been chosen. So we get a (not too long) list of conditional probabilities. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=0 | X=0\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1 | X=0\right) = 2p \left( 1-p\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=2 | X=0\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The other conditional probabilities are the reverse, because the parent of a new individual is the one if it is not the other, and vice versa.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=0|X=1\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1|X=1\right) =2p\left( 1-p\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=2|X=1\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  &amp;lt;math&amp;gt;X &amp;lt;/math&amp;gt; and  &amp;lt;math&amp;gt;Y &amp;lt;/math&amp;gt; are pretty well defined, so we can also compute the covariance of these two actual random variables.&lt;br /&gt;
&lt;br /&gt;
Let us first look at expectations...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{E}\left[ X\right]=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ X\right] =\sum_{x=0,1}x\mathbb{P}\left( X=x\right) =\mathbb{P}\left( X=1\right) =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For obvious symmetry reasons; the total number of offspring is 2, and either one could be the parent, so ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =1&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =\sum_{x=0,1}\sum_{y=0,1,2}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{y=1,2}\sum_{x=0,1}y\mathbb{P}\left( X=x\right) \mathbb{P}\left(Y=y|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \left( \frac{1}{2}\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot 2p\left( 1-p\right) \right) +2\cdot \left( \frac{1}{2}\cdot p^{2}+\frac{1}{2}\cdot \left( 1-p\right) ^{2}\right) = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
... and ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] = p &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,1}\sum_{y=0,1,2}xy\mathbb{P}\left( X=x,Y=y\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(because &amp;lt;math&amp;gt;xy=0&amp;lt;/math&amp;gt; if either &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;y=0&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\sum_{x=1}\sum_{y=1,2}xy\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1,Y=1\right) +2\cdot \mathbb{P}\left(X=1,Y=2\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1\right) \cdot \mathbb{P}\left(Y=1|X=1\right) +2\cdot \mathbb{P}\left( X=1\right) \mathbb{P}\left(Y=2|X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \frac{1}{2}\cdot 2p\left( 1-p\right) +2\cdot \frac{1}{2}\cdot p^{2}= &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=p\left( 1-p\right) +p^{2}= p&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance is then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] &lt;br /&gt;
\mathbb{E}\left[ Y\right] =p-\frac{1}{2}\cdot 1=p-\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this very simple model ==&lt;br /&gt;
&lt;br /&gt;
An interesting question would be: is it good to have the gene? &lt;br /&gt;
&lt;br /&gt;
Or, if we do statistics: suppose we know that the process has this form, but we  don't know the value of ''p''. Then the question becomes: is ''p&amp;gt;1/2'', or, equivalently, is ''Cov( X,Y) &amp;gt;0''? Below we will try to answer that question. But first we will look at what the Price equation does to all of this.&lt;br /&gt;
&lt;br /&gt;
For a given transition, the Price equation constitutes an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N}\sum_{i}q_{i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; (For this particular model this quantity is 0.5).&lt;br /&gt;
&lt;br /&gt;
The frequency of the gene in the offspring population is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation 1.0 then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this simple case for N = 2 this amounts to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i}}{2}\right] &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
The point where confusion starts, is that George Price named the right hand side of this equation ''Cov(z,q)''. The claim of the Price equation - which we contend - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. The central issue here is that this ''Cov(z,q)'' is discussed as if it were a real covariance. Is that correct? &lt;br /&gt;
&lt;br /&gt;
Try yourself!&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial1.Tutorial1.class&amp;quot;  height=&amp;quot;400&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency ''Q'' can go up by 1/2, remain what it is, or go down by 1/2. The value of this so-called ''Covariance'' just follows that change in frequency (and because it is not a real covariance, we will use quotation marks from now on). This creates an illusion of understanding, because whatever happens, the covariance changes along with the outcome of the chance experiment. In other words: '''the data explain the data'''. &lt;br /&gt;
&lt;br /&gt;
This is, of course, not OK; the true and well-defined covariance is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) = p-\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This does not depend on the realisation. Cov(X,Y) defines the properties of the chance experiment, and the realisation of this chance experiment defines &amp;quot;Cov(z,q)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==What would a probability theorist do?==&lt;br /&gt;
&lt;br /&gt;
Try to figure out the transition probabilities for the suggested model. It seems that you are a proper probability theorist, because that is what you just did.  Congrats!&lt;br /&gt;
&lt;br /&gt;
== What would a statistician do? ==&lt;br /&gt;
&lt;br /&gt;
If you are interested in statistics, which is only natural if you care for evolution, and you do not know the true model that generates the transitions, then you would want to try to answer the question what ''p'' is. Is ''p&amp;gt;1/2''? Then having the gene is good for reproduction. Is ''p&amp;lt;1/2''? Then not. &lt;br /&gt;
&lt;br /&gt;
Is ''p=1/2''? Then it is good nor bad. So how do we find out? Well, the thing with statistics is that you will never find out for sure. All we can do is try to find ways to estimate this ''p'', or design tests on if and how ''p'' differs from ''1/2'', that will help us make statements about the true model with some confidence. Here are a few such statements.&lt;br /&gt;
&lt;br /&gt;
===Estimation of p===&lt;br /&gt;
&lt;br /&gt;
One of the reasons that so many are convinced of the value of the Price equation is that it ''almost'' hits the nail on the head (even though it misses the head completely). So here we go with what sometimes feels as an indication that the Price equation is not so wrong after all. If you sense this in yourself, just return to the interactive part above.&lt;br /&gt;
&lt;br /&gt;
If you draw a new generation, then that new generation comes with a &amp;quot;Cov(z,q)&amp;quot; . With probability &amp;lt;math&amp;gt;p^{2}&amp;lt;/math&amp;gt; you draw  two 1's, which implies  &amp;quot;Cov(z,q)&amp;quot;=+1/2. With probability &amp;lt;math&amp;gt;(1-p) ^{2}&amp;lt;/math&amp;gt; you draw  two 0's, which implies &amp;quot;Cov(z,q)&amp;quot;=-1/2. So&amp;quot;Cov(z,q)&amp;quot; is actually a random variable itself, the characteristics of which we can look at. Two natural characteristics are its expected value and its variance. Now the expectation of this so-called variance is, luckily,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}. &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i} }{2}\right] = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=\sum_{z_{1}=0,1,2}\left[ \frac{z_{1}q_{1}}{2}-\frac{q_{1}}{2}\right] &lt;br /&gt;
\mathbb{P}\left( Z_{1}=z_{1}\right) = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=-\frac{1}{2}\cdot \left( 1-p\right) ^{2}+0\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot p^{2}=p-\frac{1}{2}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the realisation varies quite a bit, as we have seen in interactive part above. This is reflected in the variance of &amp;quot;Cov(z,q)&amp;quot;;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] = \frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \left( ^{\prime \prime }Cov\left( z,q\right) ^{\prime&lt;br /&gt;
\prime }\right) ^{2}\right] -\mathbb{E}^{2}\left[ \left( ^{\prime \prime}Cov\left( z,q\right) ^{\prime \prime }\right) \right] =\frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This variance can be reduced though if we take a large sample. Suppose that we have individuals ''i=1,...,n'' with the gene, and individuals ''i=n+1,...,2n''&lt;br /&gt;
without it. Now we draw the next generation in the same way as before, which looks a bit more general; ''2n'' individuals are drawn, and at every draw&lt;br /&gt;
individual ''i'' has a probability with which it is drawn to reproduce. For ''i=1,...,n'' this probability is &amp;lt;math&amp;gt;\frac{p_{1}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
For ''i=n+1,...,2n'' this probability is &amp;lt;math&amp;gt;\frac{p_{0}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. For this transition, one can show that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =p-\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\lim_{n\rightarrow \infty }Var\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we indeed define &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime \prime }Cov\left( z,q\right)^{\prime \prime }&amp;lt;/math&amp;gt;  as &amp;lt;math&amp;gt;\frac{1}{2n}\left(\sum_{i=1}^{2n}z_{i}q_{i}- \sum_{i=1}^{2n}q_{i}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }+\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is an unbiased estimator of ''p'' - because &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The quantity &amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }&amp;lt;/math&amp;gt; is also regularly referred to as the ''sample'' covariance, which is not the true covariance (true covariance = fixed property of two random variables, sample covariance = itself a random variable).&lt;br /&gt;
&lt;br /&gt;
===Testing properties of p ===&lt;br /&gt;
&lt;br /&gt;
The ''sample'' covariance is typically also used as input for in tests of the type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{0} : p=\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{1} : p\neq \frac{1}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here?== &lt;br /&gt;
&lt;br /&gt;
Not. For determining the properties of the model, the Price equation did not help, and in fact cannot even be of use. We found the transition&lt;br /&gt;
probabilities just by doing probability calculations. For doing statistics the Price equation did not help either. And yes, the Price equation applied to one actual draw does have the sample covariance of that draw in it, and the sample covariance is a useful thing, but we do not need the Price&lt;br /&gt;
equation for knowing that the sample covariance is useful. The sample covariance has been around forever; it was there well before George Price&lt;br /&gt;
was born, and it is used in parameter estmation and hypothesis testing in all other fields of science, where no one has ever heard of G.R. Price. And, most importantly, using the sample covariance is obviously not the same as using the Price equation. It is using the sample covariance.&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 10:49:10 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_1.0</comments>		</item>
		<item>
			<title>Price 1.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_1.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* What would a proper statistician do? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A very simple model ==&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 2 individuals. We depart from a  population in which individual no 1 has &amp;quot;the&amp;quot; gene, while the other, individual no 2, does not. In Price equation terms, that means that the variable &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt;, which denotes the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; becomes: &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The next generation of 2 individuals is drawn in a very simple way. First we draw the first, and then we draw the second. That makes it a Wright-Fisher process. At both draws the new individual could be the offspring of individual no 1 or of individual no 2. Reproduction is asexual, hence the offspring is a perfect copy of its parent. Now here comes the important thing. We assume that at both draws, the probability of no 1 from the parent population - the one with the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt;, while the probability of no 2 from the parent population - the one without the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;1-p&amp;lt;/math&amp;gt;. That gives us four possible transitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Price1Setting.jpg|400px|center|thumb|Four possible transitions]]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What the new generation will be is a random variable. What the current generation is, '''is not'''; the current generation is simply given. We can however think of a ''hypothetical'' chance experiment such that, in combination with the actual random transition, we get two random variables, between which we can define a covariance. So here is the recipe. &lt;br /&gt;
&lt;br /&gt;
1) Draw one of the individuals from the parent population (this is the hypothetical random variable).&lt;br /&gt;
&lt;br /&gt;
2) Draw the next generation (this is the actual random thing that happens in the the transition).&lt;br /&gt;
&lt;br /&gt;
The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is now defined as the genotype of the parent. That is a simple, albeit hypothetical random variable: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left(&lt;br /&gt;
X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt;, which is the number of offspring that the parent that has been drawn begets. This is a slightly more complicated random variable, because the chances depend on which one of the two possible parents has been chosen. So we get a (not too long) list of conditional probabilities. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=0 | X=0\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1 | X=0\right) = 2p \left( 1-p\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=2 | X=0\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The other conditional probabilities are the reverse, because the parent of a new individual is the one if it is not the other, and vice versa.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=0|X=1\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1|X=1\right) =2p\left( 1-p\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=2|X=1\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  &amp;lt;math&amp;gt;X &amp;lt;/math&amp;gt; and  &amp;lt;math&amp;gt;Y &amp;lt;/math&amp;gt; are pretty well defined, so we can also compute the covariance of these two actual random variables.&lt;br /&gt;
&lt;br /&gt;
Let us first look at expectations...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{E}\left[ X\right]=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ X\right] =\sum_{x=0,1}x\mathbb{P}\left( X=x\right) =\mathbb{P}\left( X=1\right) =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For obvious symmetry reasons; the total number of offspring is 2, and either one could be the parent, so ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =1&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =\sum_{x=0,1}\sum_{y=0,1,2}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{y=1,2}\sum_{x=0,1}y\mathbb{P}\left( X=x\right) \mathbb{P}\left(Y=y|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \left( \frac{1}{2}\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot 2p\left( 1-p\right) \right) +2\cdot \left( \frac{1}{2}\cdot p^{2}+\frac{1}{2}\cdot \left( 1-p\right) ^{2}\right) = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
... and ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] = p &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,1}\sum_{y=0,1,2}xy\mathbb{P}\left( X=x,Y=y\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(because &amp;lt;math&amp;gt;xy=0&amp;lt;/math&amp;gt; if either &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;y=0&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\sum_{x=1}\sum_{y=1,2}xy\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1,Y=1\right) +2\cdot \mathbb{P}\left(X=1,Y=2\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1\right) \cdot \mathbb{P}\left(Y=1|X=1\right) +2\cdot \mathbb{P}\left( X=1\right) \mathbb{P}\left(Y=2|X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \frac{1}{2}\cdot 2p\left( 1-p\right) +2\cdot \frac{1}{2}\cdot p^{2}= &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=p\left( 1-p\right) +p^{2}= p&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance is then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] &lt;br /&gt;
\mathbb{E}\left[ Y\right] =p-\frac{1}{2}\cdot 1=p-\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this very simple model ==&lt;br /&gt;
&lt;br /&gt;
An interesting question would be: is it good to have the gene? &lt;br /&gt;
&lt;br /&gt;
Or, if we do statistics: suppose we know that the process has this form, but we  don't know the value of ''p''. Then the question becomes: is ''p&amp;gt;1/2'', or, equivalently, is ''Cov( X,Y) &amp;gt;0''? Below we will try to answer that question. But first we will look at what the Price equation does to all of this.&lt;br /&gt;
&lt;br /&gt;
For a given transition, the Price equation constitutes an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N}\sum_{i}q_{i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; (For this particular model this quantity is 0.5).&lt;br /&gt;
&lt;br /&gt;
The frequency of the gene in the offspring population is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation 1.0 then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this simple case for N = 2 this amounts to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i}}{2}\right] &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
The point where confusion starts, is that George Price named the right hand side of this equation ''Cov(z,q)''. The claim of the Price equation - which we contend - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. The central issue here is that this ''Cov(z,q)'' is discussed as if it were a real covariance. Is that correct? &lt;br /&gt;
&lt;br /&gt;
Try yourself!&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial1.Tutorial1.class&amp;quot;  height=&amp;quot;400&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency ''Q'' can go up by 1/2, remain what it is, or go down by 1/2. The value of this so-called ''Covariance'' just follows that change in frequency (and because it is not a real covariance, we will use quotation marks from now on). This creates an illusion of understanding, because whatever happens, the covariance changes along with the outcome of the chance experiment. In other words: '''the data explain the data'''. &lt;br /&gt;
&lt;br /&gt;
This is, of course, not OK; the true and well-defined covariance is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) = p-\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This does not depend on the realisation. Cov(X,Y) defines the properties of the chance experiment, and the realisation of this chance experiment defines &amp;quot;Cov(z,q)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==What would a probability theorist do?==&lt;br /&gt;
&lt;br /&gt;
Try to figure out the transition probabilities for the suggested model. It seems that you are a proper probability theorist, because that is what you just did.  Congrats!&lt;br /&gt;
&lt;br /&gt;
== What would a statistician do? ==&lt;br /&gt;
&lt;br /&gt;
If you are interested in statistics, which is only natural if you care for evolution, and you do not know the true model that generates the transitions, then you would want to try to answer the question what $p$ is. Is ''p&amp;gt;1/2''? Then having the gene is good for reproduction. Is ''p&amp;lt;1/2''? Then not. &lt;br /&gt;
&lt;br /&gt;
Is ''p=1/2''? Then it is good nor bad. So how do we find out? Well, the thing with statistics is that you will never find out for sure. All we can do is try to find ways to estimate this ''p'', or design tests on if and how ''p'' differs from ''1/2'', that will help us make statements about the true model with some confidence. Here are a few such statements.&lt;br /&gt;
&lt;br /&gt;
===Estimation of p===&lt;br /&gt;
&lt;br /&gt;
One of the reasons that so many are convinced of the value of the Price equation is that it ''almost'' hits the nail on the head (even though it misses the head completely). So here we go with what sometimes feels as an indication that the Price equation is not so wrong after all. If you sense this in yourself, just return to the interactive part above.&lt;br /&gt;
&lt;br /&gt;
If you draw a new generation, then that new generation comes with a &amp;quot;Cov(z,q)&amp;quot; . With probability &amp;lt;math&amp;gt;p^{2}&amp;lt;/math&amp;gt; you draw  two 1's, which implies  &amp;quot;Cov(z,q)&amp;quot;=+1/2. With probability &amp;lt;math&amp;gt;(1-p) ^{2}&amp;lt;/math&amp;gt; you draw  two 0's, which implies &amp;quot;Cov(z,q)&amp;quot;=-1/2. So&amp;quot;Cov(z,q)&amp;quot; is actually a random variable itself, the characteristics of which we can look at. Two natural characteristics are its expected value and its variance. Now the expectation of this so-called variance is, luckily,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}. &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i} }{2}\right] = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=\sum_{z_{1}=0,1,2}\left[ \frac{z_{1}q_{1}}{2}-\frac{q_{1}}{2}\right] &lt;br /&gt;
\mathbb{P}\left( Z_{1}=z_{1}\right) = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=-\frac{1}{2}\cdot \left( 1-p\right) ^{2}+0\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot p^{2}=p-\frac{1}{2}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the realisation varies quite a bit, as we have seen in interactive part above. This is reflected in the variance of &amp;quot;Cov(z,q)&amp;quot;;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] = \frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \left( ^{\prime \prime }Cov\left( z,q\right) ^{\prime&lt;br /&gt;
\prime }\right) ^{2}\right] -\mathbb{E}^{2}\left[ \left( ^{\prime \prime}Cov\left( z,q\right) ^{\prime \prime }\right) \right] =\frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This variance can be reduced though if we take a large sample. Suppose that we have individuals ''i=1,...,n'' with the gene, and individuals ''i=n+1,...,2n''&lt;br /&gt;
without it. Now we draw the next generation in the same way as before, which looks a bit more general; ''2n'' individuals are drawn, and at every draw&lt;br /&gt;
individual ''i'' has a probability with which it is drawn to reproduce. For ''i=1,...,n'' this probability is &amp;lt;math&amp;gt;\frac{p_{1}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
For ''i=n+1,...,2n'' this probability is &amp;lt;math&amp;gt;\frac{p_{0}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. For this transition, one can show that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =p-\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\lim_{n\rightarrow \infty }Var\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we indeed define &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime \prime }Cov\left( z,q\right)^{\prime \prime }&amp;lt;/math&amp;gt;  as &amp;lt;math&amp;gt;\frac{1}{2n}\left(\sum_{i=1}^{2n}z_{i}q_{i}- \sum_{i=1}^{2n}q_{i}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }+\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is an unbiased estimator of ''p'' - because &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The quantity &amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }&amp;lt;/math&amp;gt; is also regularly referred to as the ''sample'' covariance, which is not the true covariance (true covariance = fixed property of two random variables, sample covariance = itself a random variable).&lt;br /&gt;
&lt;br /&gt;
===Testing properties of p ===&lt;br /&gt;
&lt;br /&gt;
The ''sample'' covariance is typically also used as input for in tests of the type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{0} : p=\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{1} : p\neq \frac{1}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here?== &lt;br /&gt;
&lt;br /&gt;
Not. For determining the properties of the model, the Price equation did not help, and in fact cannot even be of use. We found the transition&lt;br /&gt;
probabilities just by doing probability calculations. For doing statistics the Price equation did not help either. And yes, the Price equation applied to one actual draw does have the sample covariance of that draw in it, and the sample covariance is a useful thing, but we do not need the Price&lt;br /&gt;
equation for knowing that the sample covariance is useful. The sample covariance has been around forever; it was there well before George Price&lt;br /&gt;
was born, and it is used in parameter estmation and hypothesis testing in all other fields of science, where no one has ever heard of G.R. Price. And, most importantly, using the sample covariance is obviously not the same as using the Price equation. It is using the sample covariance.&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 10:48:12 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_1.0</comments>		</item>
		<item>
			<title>Price 1.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_1.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* What would a proper probability theorist do? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A very simple model ==&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 2 individuals. We depart from a  population in which individual no 1 has &amp;quot;the&amp;quot; gene, while the other, individual no 2, does not. In Price equation terms, that means that the variable &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt;, which denotes the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; becomes: &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The next generation of 2 individuals is drawn in a very simple way. First we draw the first, and then we draw the second. That makes it a Wright-Fisher process. At both draws the new individual could be the offspring of individual no 1 or of individual no 2. Reproduction is asexual, hence the offspring is a perfect copy of its parent. Now here comes the important thing. We assume that at both draws, the probability of no 1 from the parent population - the one with the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt;, while the probability of no 2 from the parent population - the one without the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;1-p&amp;lt;/math&amp;gt;. That gives us four possible transitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Price1Setting.jpg|400px|center|thumb|Four possible transitions]]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What the new generation will be is a random variable. What the current generation is, '''is not'''; the current generation is simply given. We can however think of a ''hypothetical'' chance experiment such that, in combination with the actual random transition, we get two random variables, between which we can define a covariance. So here is the recipe. &lt;br /&gt;
&lt;br /&gt;
1) Draw one of the individuals from the parent population (this is the hypothetical random variable).&lt;br /&gt;
&lt;br /&gt;
2) Draw the next generation (this is the actual random thing that happens in the the transition).&lt;br /&gt;
&lt;br /&gt;
The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is now defined as the genotype of the parent. That is a simple, albeit hypothetical random variable: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left(&lt;br /&gt;
X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt;, which is the number of offspring that the parent that has been drawn begets. This is a slightly more complicated random variable, because the chances depend on which one of the two possible parents has been chosen. So we get a (not too long) list of conditional probabilities. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=0 | X=0\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1 | X=0\right) = 2p \left( 1-p\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=2 | X=0\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The other conditional probabilities are the reverse, because the parent of a new individual is the one if it is not the other, and vice versa.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=0|X=1\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1|X=1\right) =2p\left( 1-p\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=2|X=1\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  &amp;lt;math&amp;gt;X &amp;lt;/math&amp;gt; and  &amp;lt;math&amp;gt;Y &amp;lt;/math&amp;gt; are pretty well defined, so we can also compute the covariance of these two actual random variables.&lt;br /&gt;
&lt;br /&gt;
Let us first look at expectations...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{E}\left[ X\right]=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ X\right] =\sum_{x=0,1}x\mathbb{P}\left( X=x\right) =\mathbb{P}\left( X=1\right) =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For obvious symmetry reasons; the total number of offspring is 2, and either one could be the parent, so ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =1&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =\sum_{x=0,1}\sum_{y=0,1,2}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{y=1,2}\sum_{x=0,1}y\mathbb{P}\left( X=x\right) \mathbb{P}\left(Y=y|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \left( \frac{1}{2}\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot 2p\left( 1-p\right) \right) +2\cdot \left( \frac{1}{2}\cdot p^{2}+\frac{1}{2}\cdot \left( 1-p\right) ^{2}\right) = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
... and ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] = p &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,1}\sum_{y=0,1,2}xy\mathbb{P}\left( X=x,Y=y\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(because &amp;lt;math&amp;gt;xy=0&amp;lt;/math&amp;gt; if either &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;y=0&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\sum_{x=1}\sum_{y=1,2}xy\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1,Y=1\right) +2\cdot \mathbb{P}\left(X=1,Y=2\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1\right) \cdot \mathbb{P}\left(Y=1|X=1\right) +2\cdot \mathbb{P}\left( X=1\right) \mathbb{P}\left(Y=2|X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \frac{1}{2}\cdot 2p\left( 1-p\right) +2\cdot \frac{1}{2}\cdot p^{2}= &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=p\left( 1-p\right) +p^{2}= p&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance is then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] &lt;br /&gt;
\mathbb{E}\left[ Y\right] =p-\frac{1}{2}\cdot 1=p-\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this very simple model ==&lt;br /&gt;
&lt;br /&gt;
An interesting question would be: is it good to have the gene? &lt;br /&gt;
&lt;br /&gt;
Or, if we do statistics: suppose we know that the process has this form, but we  don't know the value of ''p''. Then the question becomes: is ''p&amp;gt;1/2'', or, equivalently, is ''Cov( X,Y) &amp;gt;0''? Below we will try to answer that question. But first we will look at what the Price equation does to all of this.&lt;br /&gt;
&lt;br /&gt;
For a given transition, the Price equation constitutes an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N}\sum_{i}q_{i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; (For this particular model this quantity is 0.5).&lt;br /&gt;
&lt;br /&gt;
The frequency of the gene in the offspring population is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation 1.0 then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this simple case for N = 2 this amounts to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i}}{2}\right] &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
The point where confusion starts, is that George Price named the right hand side of this equation ''Cov(z,q)''. The claim of the Price equation - which we contend - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. The central issue here is that this ''Cov(z,q)'' is discussed as if it were a real covariance. Is that correct? &lt;br /&gt;
&lt;br /&gt;
Try yourself!&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial1.Tutorial1.class&amp;quot;  height=&amp;quot;400&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency ''Q'' can go up by 1/2, remain what it is, or go down by 1/2. The value of this so-called ''Covariance'' just follows that change in frequency (and because it is not a real covariance, we will use quotation marks from now on). This creates an illusion of understanding, because whatever happens, the covariance changes along with the outcome of the chance experiment. In other words: '''the data explain the data'''. &lt;br /&gt;
&lt;br /&gt;
This is, of course, not OK; the true and well-defined covariance is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) = p-\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This does not depend on the realisation. Cov(X,Y) defines the properties of the chance experiment, and the realisation of this chance experiment defines &amp;quot;Cov(z,q)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==What would a probability theorist do?==&lt;br /&gt;
&lt;br /&gt;
Try to figure out the transition probabilities for the suggested model. It seems that you are a proper probability theorist, because that is what you just did.  Congrats!&lt;br /&gt;
&lt;br /&gt;
== What would a proper statistician do? ==&lt;br /&gt;
&lt;br /&gt;
If you are interested in statistics, which is only natural if you care for evolution, and you do not know the true model that generates the transitions, then you would want to try to answer the question what $p$ is. Is ''p&amp;gt;1/2''? Then having the gene is good for reproduction. Is ''p&amp;lt;1/2''? Then not. &lt;br /&gt;
&lt;br /&gt;
Is ''p=1/2''? Then it is good nor bad. So how do we find out? Well, the thing with statistics is that you will never find out for sure. All we can do is try to find ways to estimate this ''p'', or design tests on if and how ''p'' differs from ''1/2'', that will help us make statements about the true model with some confidence. Here are a few such statements.&lt;br /&gt;
&lt;br /&gt;
===Estimation of p===&lt;br /&gt;
&lt;br /&gt;
One of the reasons that so many are convinced of the value of the Price equation is that it ''almost'' hits the nail on the head (even though it misses the head completely). So here we go with what sometimes feels as an indication that the Price equation is not so wrong after all. If you sense this in yourself, just return to the interactive part above.&lt;br /&gt;
&lt;br /&gt;
If you draw a new generation, then that new generation comes with a &amp;quot;Cov(z,q)&amp;quot; . With probability &amp;lt;math&amp;gt;p^{2}&amp;lt;/math&amp;gt; you draw  two 1's, which implies  &amp;quot;Cov(z,q)&amp;quot;=+1/2. With probability &amp;lt;math&amp;gt;(1-p) ^{2}&amp;lt;/math&amp;gt; you draw  two 0's, which implies &amp;quot;Cov(z,q)&amp;quot;=-1/2. So&amp;quot;Cov(z,q)&amp;quot; is actually a random variable itself, the characteristics of which we can look at. Two natural characteristics are its expected value and its variance. Now the expectation of this so-called variance is, luckily,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}. &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i} }{2}\right] = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=\sum_{z_{1}=0,1,2}\left[ \frac{z_{1}q_{1}}{2}-\frac{q_{1}}{2}\right] &lt;br /&gt;
\mathbb{P}\left( Z_{1}=z_{1}\right) = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=-\frac{1}{2}\cdot \left( 1-p\right) ^{2}+0\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot p^{2}=p-\frac{1}{2}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the realisation varies quite a bit, as we have seen in interactive part above. This is reflected in the variance of &amp;quot;Cov(z,q)&amp;quot;;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] = \frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \left( ^{\prime \prime }Cov\left( z,q\right) ^{\prime&lt;br /&gt;
\prime }\right) ^{2}\right] -\mathbb{E}^{2}\left[ \left( ^{\prime \prime}Cov\left( z,q\right) ^{\prime \prime }\right) \right] =\frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This variance can be reduced though if we take a large sample. Suppose that we have individuals ''i=1,...,n'' with the gene, and individuals ''i=n+1,...,2n''&lt;br /&gt;
without it. Now we draw the next generation in the same way as before, which looks a bit more general; ''2n'' individuals are drawn, and at every draw&lt;br /&gt;
individual ''i'' has a probability with which it is drawn to reproduce. For ''i=1,...,n'' this probability is &amp;lt;math&amp;gt;\frac{p_{1}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
For ''i=n+1,...,2n'' this probability is &amp;lt;math&amp;gt;\frac{p_{0}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. For this transition, one can show that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =p-\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\lim_{n\rightarrow \infty }Var\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we indeed define &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime \prime }Cov\left( z,q\right)^{\prime \prime }&amp;lt;/math&amp;gt;  as &amp;lt;math&amp;gt;\frac{1}{2n}\left(\sum_{i=1}^{2n}z_{i}q_{i}- \sum_{i=1}^{2n}q_{i}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }+\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is an unbiased estimator of ''p'' - because &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The quantity &amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }&amp;lt;/math&amp;gt; is also regularly referred to as the ''sample'' covariance, which is not the true covariance (true covariance = fixed property of two random variables, sample covariance = itself a random variable).&lt;br /&gt;
&lt;br /&gt;
===Testing properties of p ===&lt;br /&gt;
&lt;br /&gt;
The ''sample'' covariance is typically also used as input for in tests of the type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{0} : p=\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{1} : p\neq \frac{1}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here?== &lt;br /&gt;
&lt;br /&gt;
Not. For determining the properties of the model, the Price equation did not help, and in fact cannot even be of use. We found the transition&lt;br /&gt;
probabilities just by doing probability calculations. For doing statistics the Price equation did not help either. And yes, the Price equation applied to one actual draw does have the sample covariance of that draw in it, and the sample covariance is a useful thing, but we do not need the Price&lt;br /&gt;
equation for knowing that the sample covariance is useful. The sample covariance has been around forever; it was there well before George Price&lt;br /&gt;
was born, and it is used in parameter estmation and hypothesis testing in all other fields of science, where no one has ever heard of G.R. Price. And, most importantly, using the sample covariance is obviously not the same as using the Price equation. It is using the sample covariance.&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 10:48:01 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_1.0</comments>		</item>
		<item>
			<title>Price 1.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_1.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* The Price equation for this very simple model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A very simple model ==&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 2 individuals. We depart from a  population in which individual no 1 has &amp;quot;the&amp;quot; gene, while the other, individual no 2, does not. In Price equation terms, that means that the variable &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt;, which denotes the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; becomes: &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The next generation of 2 individuals is drawn in a very simple way. First we draw the first, and then we draw the second. That makes it a Wright-Fisher process. At both draws the new individual could be the offspring of individual no 1 or of individual no 2. Reproduction is asexual, hence the offspring is a perfect copy of its parent. Now here comes the important thing. We assume that at both draws, the probability of no 1 from the parent population - the one with the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt;, while the probability of no 2 from the parent population - the one without the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;1-p&amp;lt;/math&amp;gt;. That gives us four possible transitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Price1Setting.jpg|400px|center|thumb|Four possible transitions]]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What the new generation will be is a random variable. What the current generation is, '''is not'''; the current generation is simply given. We can however think of a ''hypothetical'' chance experiment such that, in combination with the actual random transition, we get two random variables, between which we can define a covariance. So here is the recipe. &lt;br /&gt;
&lt;br /&gt;
1) Draw one of the individuals from the parent population (this is the hypothetical random variable).&lt;br /&gt;
&lt;br /&gt;
2) Draw the next generation (this is the actual random thing that happens in the the transition).&lt;br /&gt;
&lt;br /&gt;
The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is now defined as the genotype of the parent. That is a simple, albeit hypothetical random variable: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left(&lt;br /&gt;
X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt;, which is the number of offspring that the parent that has been drawn begets. This is a slightly more complicated random variable, because the chances depend on which one of the two possible parents has been chosen. So we get a (not too long) list of conditional probabilities. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=0 | X=0\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1 | X=0\right) = 2p \left( 1-p\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=2 | X=0\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The other conditional probabilities are the reverse, because the parent of a new individual is the one if it is not the other, and vice versa.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=0|X=1\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1|X=1\right) =2p\left( 1-p\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=2|X=1\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  &amp;lt;math&amp;gt;X &amp;lt;/math&amp;gt; and  &amp;lt;math&amp;gt;Y &amp;lt;/math&amp;gt; are pretty well defined, so we can also compute the covariance of these two actual random variables.&lt;br /&gt;
&lt;br /&gt;
Let us first look at expectations...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{E}\left[ X\right]=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ X\right] =\sum_{x=0,1}x\mathbb{P}\left( X=x\right) =\mathbb{P}\left( X=1\right) =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For obvious symmetry reasons; the total number of offspring is 2, and either one could be the parent, so ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =1&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =\sum_{x=0,1}\sum_{y=0,1,2}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{y=1,2}\sum_{x=0,1}y\mathbb{P}\left( X=x\right) \mathbb{P}\left(Y=y|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \left( \frac{1}{2}\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot 2p\left( 1-p\right) \right) +2\cdot \left( \frac{1}{2}\cdot p^{2}+\frac{1}{2}\cdot \left( 1-p\right) ^{2}\right) = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
... and ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] = p &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,1}\sum_{y=0,1,2}xy\mathbb{P}\left( X=x,Y=y\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(because &amp;lt;math&amp;gt;xy=0&amp;lt;/math&amp;gt; if either &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;y=0&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\sum_{x=1}\sum_{y=1,2}xy\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1,Y=1\right) +2\cdot \mathbb{P}\left(X=1,Y=2\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1\right) \cdot \mathbb{P}\left(Y=1|X=1\right) +2\cdot \mathbb{P}\left( X=1\right) \mathbb{P}\left(Y=2|X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \frac{1}{2}\cdot 2p\left( 1-p\right) +2\cdot \frac{1}{2}\cdot p^{2}= &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=p\left( 1-p\right) +p^{2}= p&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance is then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] &lt;br /&gt;
\mathbb{E}\left[ Y\right] =p-\frac{1}{2}\cdot 1=p-\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this very simple model ==&lt;br /&gt;
&lt;br /&gt;
An interesting question would be: is it good to have the gene? &lt;br /&gt;
&lt;br /&gt;
Or, if we do statistics: suppose we know that the process has this form, but we  don't know the value of ''p''. Then the question becomes: is ''p&amp;gt;1/2'', or, equivalently, is ''Cov( X,Y) &amp;gt;0''? Below we will try to answer that question. But first we will look at what the Price equation does to all of this.&lt;br /&gt;
&lt;br /&gt;
For a given transition, the Price equation constitutes an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N}\sum_{i}q_{i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; (For this particular model this quantity is 0.5).&lt;br /&gt;
&lt;br /&gt;
The frequency of the gene in the offspring population is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation 1.0 then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this simple case for N = 2 this amounts to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i}}{2}\right] &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
The point where confusion starts, is that George Price named the right hand side of this equation ''Cov(z,q)''. The claim of the Price equation - which we contend - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. The central issue here is that this ''Cov(z,q)'' is discussed as if it were a real covariance. Is that correct? &lt;br /&gt;
&lt;br /&gt;
Try yourself!&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial1.Tutorial1.class&amp;quot;  height=&amp;quot;400&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency ''Q'' can go up by 1/2, remain what it is, or go down by 1/2. The value of this so-called ''Covariance'' just follows that change in frequency (and because it is not a real covariance, we will use quotation marks from now on). This creates an illusion of understanding, because whatever happens, the covariance changes along with the outcome of the chance experiment. In other words: '''the data explain the data'''. &lt;br /&gt;
&lt;br /&gt;
This is, of course, not OK; the true and well-defined covariance is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) = p-\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This does not depend on the realisation. Cov(X,Y) defines the properties of the chance experiment, and the realisation of this chance experiment defines &amp;quot;Cov(z,q)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==What would a proper probability theorist do?==&lt;br /&gt;
&lt;br /&gt;
Try to figure out the transition probabilities for the suggested model. It seems that you are a proper probability theorist, because that is what you just did.  Congrats!&lt;br /&gt;
&lt;br /&gt;
== What would a proper statistician do? ==&lt;br /&gt;
&lt;br /&gt;
If you are interested in statistics, which is only natural if you care for evolution, and you do not know the true model that generates the transitions, then you would want to try to answer the question what $p$ is. Is ''p&amp;gt;1/2''? Then having the gene is good for reproduction. Is ''p&amp;lt;1/2''? Then not. &lt;br /&gt;
&lt;br /&gt;
Is ''p=1/2''? Then it is good nor bad. So how do we find out? Well, the thing with statistics is that you will never find out for sure. All we can do is try to find ways to estimate this ''p'', or design tests on if and how ''p'' differs from ''1/2'', that will help us make statements about the true model with some confidence. Here are a few such statements.&lt;br /&gt;
&lt;br /&gt;
===Estimation of p===&lt;br /&gt;
&lt;br /&gt;
One of the reasons that so many are convinced of the value of the Price equation is that it ''almost'' hits the nail on the head (even though it misses the head completely). So here we go with what sometimes feels as an indication that the Price equation is not so wrong after all. If you sense this in yourself, just return to the interactive part above.&lt;br /&gt;
&lt;br /&gt;
If you draw a new generation, then that new generation comes with a &amp;quot;Cov(z,q)&amp;quot; . With probability &amp;lt;math&amp;gt;p^{2}&amp;lt;/math&amp;gt; you draw  two 1's, which implies  &amp;quot;Cov(z,q)&amp;quot;=+1/2. With probability &amp;lt;math&amp;gt;(1-p) ^{2}&amp;lt;/math&amp;gt; you draw  two 0's, which implies &amp;quot;Cov(z,q)&amp;quot;=-1/2. So&amp;quot;Cov(z,q)&amp;quot; is actually a random variable itself, the characteristics of which we can look at. Two natural characteristics are its expected value and its variance. Now the expectation of this so-called variance is, luckily,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}. &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i} }{2}\right] = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=\sum_{z_{1}=0,1,2}\left[ \frac{z_{1}q_{1}}{2}-\frac{q_{1}}{2}\right] &lt;br /&gt;
\mathbb{P}\left( Z_{1}=z_{1}\right) = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=-\frac{1}{2}\cdot \left( 1-p\right) ^{2}+0\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot p^{2}=p-\frac{1}{2}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the realisation varies quite a bit, as we have seen in interactive part above. This is reflected in the variance of &amp;quot;Cov(z,q)&amp;quot;;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] = \frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \left( ^{\prime \prime }Cov\left( z,q\right) ^{\prime&lt;br /&gt;
\prime }\right) ^{2}\right] -\mathbb{E}^{2}\left[ \left( ^{\prime \prime}Cov\left( z,q\right) ^{\prime \prime }\right) \right] =\frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This variance can be reduced though if we take a large sample. Suppose that we have individuals ''i=1,...,n'' with the gene, and individuals ''i=n+1,...,2n''&lt;br /&gt;
without it. Now we draw the next generation in the same way as before, which looks a bit more general; ''2n'' individuals are drawn, and at every draw&lt;br /&gt;
individual ''i'' has a probability with which it is drawn to reproduce. For ''i=1,...,n'' this probability is &amp;lt;math&amp;gt;\frac{p_{1}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
For ''i=n+1,...,2n'' this probability is &amp;lt;math&amp;gt;\frac{p_{0}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. For this transition, one can show that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =p-\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\lim_{n\rightarrow \infty }Var\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we indeed define &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime \prime }Cov\left( z,q\right)^{\prime \prime }&amp;lt;/math&amp;gt;  as &amp;lt;math&amp;gt;\frac{1}{2n}\left(\sum_{i=1}^{2n}z_{i}q_{i}- \sum_{i=1}^{2n}q_{i}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }+\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is an unbiased estimator of ''p'' - because &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The quantity &amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }&amp;lt;/math&amp;gt; is also regularly referred to as the ''sample'' covariance, which is not the true covariance (true covariance = fixed property of two random variables, sample covariance = itself a random variable).&lt;br /&gt;
&lt;br /&gt;
===Testing properties of p ===&lt;br /&gt;
&lt;br /&gt;
The ''sample'' covariance is typically also used as input for in tests of the type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{0} : p=\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{1} : p\neq \frac{1}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here?== &lt;br /&gt;
&lt;br /&gt;
Not. For determining the properties of the model, the Price equation did not help, and in fact cannot even be of use. We found the transition&lt;br /&gt;
probabilities just by doing probability calculations. For doing statistics the Price equation did not help either. And yes, the Price equation applied to one actual draw does have the sample covariance of that draw in it, and the sample covariance is a useful thing, but we do not need the Price&lt;br /&gt;
equation for knowing that the sample covariance is useful. The sample covariance has been around forever; it was there well before George Price&lt;br /&gt;
was born, and it is used in parameter estmation and hypothesis testing in all other fields of science, where no one has ever heard of G.R. Price. And, most importantly, using the sample covariance is obviously not the same as using the Price equation. It is using the sample covariance.&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 10:46:32 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_1.0</comments>		</item>
		<item>
			<title>Price 1.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_1.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* A very simple model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A very simple model ==&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 2 individuals. We depart from a  population in which individual no 1 has &amp;quot;the&amp;quot; gene, while the other, individual no 2, does not. In Price equation terms, that means that the variable &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt;, which denotes the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; becomes: &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The next generation of 2 individuals is drawn in a very simple way. First we draw the first, and then we draw the second. That makes it a Wright-Fisher process. At both draws the new individual could be the offspring of individual no 1 or of individual no 2. Reproduction is asexual, hence the offspring is a perfect copy of its parent. Now here comes the important thing. We assume that at both draws, the probability of no 1 from the parent population - the one with the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt;, while the probability of no 2 from the parent population - the one without the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;1-p&amp;lt;/math&amp;gt;. That gives us four possible transitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Price1Setting.jpg|400px|center|thumb|Four possible transitions]]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What the new generation will be is a random variable. What the current generation is, '''is not'''; the current generation is simply given. We can however think of a ''hypothetical'' chance experiment such that, in combination with the actual random transition, we get two random variables, between which we can define a covariance. So here is the recipe. &lt;br /&gt;
&lt;br /&gt;
1) Draw one of the individuals from the parent population (this is the hypothetical random variable).&lt;br /&gt;
&lt;br /&gt;
2) Draw the next generation (this is the actual random thing that happens in the the transition).&lt;br /&gt;
&lt;br /&gt;
The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is now defined as the genotype of the parent. That is a simple, albeit hypothetical random variable: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left(&lt;br /&gt;
X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt;, which is the number of offspring that the parent that has been drawn begets. This is a slightly more complicated random variable, because the chances depend on which one of the two possible parents has been chosen. So we get a (not too long) list of conditional probabilities. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=0 | X=0\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1 | X=0\right) = 2p \left( 1-p\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=2 | X=0\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The other conditional probabilities are the reverse, because the parent of a new individual is the one if it is not the other, and vice versa.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=0|X=1\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1|X=1\right) =2p\left( 1-p\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=2|X=1\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  &amp;lt;math&amp;gt;X &amp;lt;/math&amp;gt; and  &amp;lt;math&amp;gt;Y &amp;lt;/math&amp;gt; are pretty well defined, so we can also compute the covariance of these two actual random variables.&lt;br /&gt;
&lt;br /&gt;
Let us first look at expectations...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{E}\left[ X\right]=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ X\right] =\sum_{x=0,1}x\mathbb{P}\left( X=x\right) =\mathbb{P}\left( X=1\right) =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For obvious symmetry reasons; the total number of offspring is 2, and either one could be the parent, so ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =1&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =\sum_{x=0,1}\sum_{y=0,1,2}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{y=1,2}\sum_{x=0,1}y\mathbb{P}\left( X=x\right) \mathbb{P}\left(Y=y|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \left( \frac{1}{2}\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot 2p\left( 1-p\right) \right) +2\cdot \left( \frac{1}{2}\cdot p^{2}+\frac{1}{2}\cdot \left( 1-p\right) ^{2}\right) = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
... and ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] = p &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,1}\sum_{y=0,1,2}xy\mathbb{P}\left( X=x,Y=y\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(because &amp;lt;math&amp;gt;xy=0&amp;lt;/math&amp;gt; if either &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;y=0&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\sum_{x=1}\sum_{y=1,2}xy\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1,Y=1\right) +2\cdot \mathbb{P}\left(X=1,Y=2\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1\right) \cdot \mathbb{P}\left(Y=1|X=1\right) +2\cdot \mathbb{P}\left( X=1\right) \mathbb{P}\left(Y=2|X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \frac{1}{2}\cdot 2p\left( 1-p\right) +2\cdot \frac{1}{2}\cdot p^{2}= &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=p\left( 1-p\right) +p^{2}= p&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance is then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] &lt;br /&gt;
\mathbb{E}\left[ Y\right] =p-\frac{1}{2}\cdot 1=p-\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this very simple model ==&lt;br /&gt;
&lt;br /&gt;
An interesting question would be: is it good to have the gene? &lt;br /&gt;
&lt;br /&gt;
Or, if we do statistics: suppose we know that the process has this form, but we  don't know the value of ''p''. Then the question becomes: is ''p&amp;gt;1/2'', or, equivalently, is ''Cov( X,Y) &amp;gt;0''. Below we will try to answer that question. But first we will look at what the Price equation does to all of this.&lt;br /&gt;
&lt;br /&gt;
For a given transition, the Price equation constitutes an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N}\sum_{i}q_{i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; (For this particular model this quantity is 0.5).&lt;br /&gt;
&lt;br /&gt;
The frequency of the gene in the offspring population is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation 1.0 then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this simple case for N = 2 this amounts to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i}}{2}\right] &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
The point where confusion starts, is that George Price named the right hand side of this equation ''Cov(z,q)''. The claim of the Price equation - which we contend - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. The central issue here is that this ''Cov(z,q)'' is discussed as if it were a real covariance. Is that correct? &lt;br /&gt;
&lt;br /&gt;
Try yourself!&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial1.Tutorial1.class&amp;quot;  height=&amp;quot;400&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency ''Q'' can go up by 1/2, remain what it is, or go down by 1/2. The value of this so-called ''Covariance'' just follows that change in frequency (and because it is not a real covariance, we will use quotation marks from now on). This creates an illusion of understanding, because whatever happens, the covariance changes along with the outcome of the chance experiment. In other words: '''the data explain the data'''. &lt;br /&gt;
&lt;br /&gt;
This is, of course, not OK; the true and well-defined covariance is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) = p-\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This does not depend on the realisation. Cov(X,Y) defines the properties of the chance experiment, and the realisation of this chance experiment defines &amp;quot;Cov(z,q)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==What would a proper probability theorist do?==&lt;br /&gt;
&lt;br /&gt;
Try to figure out the transition probabilities for the suggested model. It seems that you are a proper probability theorist, because that is what you just did.  Congrats!&lt;br /&gt;
&lt;br /&gt;
== What would a proper statistician do? ==&lt;br /&gt;
&lt;br /&gt;
If you are interested in statistics, which is only natural if you care for evolution, and you do not know the true model that generates the transitions, then you would want to try to answer the question what $p$ is. Is ''p&amp;gt;1/2''? Then having the gene is good for reproduction. Is ''p&amp;lt;1/2''? Then not. &lt;br /&gt;
&lt;br /&gt;
Is ''p=1/2''? Then it is good nor bad. So how do we find out? Well, the thing with statistics is that you will never find out for sure. All we can do is try to find ways to estimate this ''p'', or design tests on if and how ''p'' differs from ''1/2'', that will help us make statements about the true model with some confidence. Here are a few such statements.&lt;br /&gt;
&lt;br /&gt;
===Estimation of p===&lt;br /&gt;
&lt;br /&gt;
One of the reasons that so many are convinced of the value of the Price equation is that it ''almost'' hits the nail on the head (even though it misses the head completely). So here we go with what sometimes feels as an indication that the Price equation is not so wrong after all. If you sense this in yourself, just return to the interactive part above.&lt;br /&gt;
&lt;br /&gt;
If you draw a new generation, then that new generation comes with a &amp;quot;Cov(z,q)&amp;quot; . With probability &amp;lt;math&amp;gt;p^{2}&amp;lt;/math&amp;gt; you draw  two 1's, which implies  &amp;quot;Cov(z,q)&amp;quot;=+1/2. With probability &amp;lt;math&amp;gt;(1-p) ^{2}&amp;lt;/math&amp;gt; you draw  two 0's, which implies &amp;quot;Cov(z,q)&amp;quot;=-1/2. So&amp;quot;Cov(z,q)&amp;quot; is actually a random variable itself, the characteristics of which we can look at. Two natural characteristics are its expected value and its variance. Now the expectation of this so-called variance is, luckily,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}. &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i} }{2}\right] = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=\sum_{z_{1}=0,1,2}\left[ \frac{z_{1}q_{1}}{2}-\frac{q_{1}}{2}\right] &lt;br /&gt;
\mathbb{P}\left( Z_{1}=z_{1}\right) = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=-\frac{1}{2}\cdot \left( 1-p\right) ^{2}+0\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot p^{2}=p-\frac{1}{2}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the realisation varies quite a bit, as we have seen in interactive part above. This is reflected in the variance of &amp;quot;Cov(z,q)&amp;quot;;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] = \frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \left( ^{\prime \prime }Cov\left( z,q\right) ^{\prime&lt;br /&gt;
\prime }\right) ^{2}\right] -\mathbb{E}^{2}\left[ \left( ^{\prime \prime}Cov\left( z,q\right) ^{\prime \prime }\right) \right] =\frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This variance can be reduced though if we take a large sample. Suppose that we have individuals ''i=1,...,n'' with the gene, and individuals ''i=n+1,...,2n''&lt;br /&gt;
without it. Now we draw the next generation in the same way as before, which looks a bit more general; ''2n'' individuals are drawn, and at every draw&lt;br /&gt;
individual ''i'' has a probability with which it is drawn to reproduce. For ''i=1,...,n'' this probability is &amp;lt;math&amp;gt;\frac{p_{1}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
For ''i=n+1,...,2n'' this probability is &amp;lt;math&amp;gt;\frac{p_{0}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. For this transition, one can show that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =p-\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\lim_{n\rightarrow \infty }Var\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we indeed define &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime \prime }Cov\left( z,q\right)^{\prime \prime }&amp;lt;/math&amp;gt;  as &amp;lt;math&amp;gt;\frac{1}{2n}\left(\sum_{i=1}^{2n}z_{i}q_{i}- \sum_{i=1}^{2n}q_{i}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }+\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is an unbiased estimator of ''p'' - because &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The quantity &amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }&amp;lt;/math&amp;gt; is also regularly referred to as the ''sample'' covariance, which is not the true covariance (true covariance = fixed property of two random variables, sample covariance = itself a random variable).&lt;br /&gt;
&lt;br /&gt;
===Testing properties of p ===&lt;br /&gt;
&lt;br /&gt;
The ''sample'' covariance is typically also used as input for in tests of the type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{0} : p=\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{1} : p\neq \frac{1}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here?== &lt;br /&gt;
&lt;br /&gt;
Not. For determining the properties of the model, the Price equation did not help, and in fact cannot even be of use. We found the transition&lt;br /&gt;
probabilities just by doing probability calculations. For doing statistics the Price equation did not help either. And yes, the Price equation applied to one actual draw does have the sample covariance of that draw in it, and the sample covariance is a useful thing, but we do not need the Price&lt;br /&gt;
equation for knowing that the sample covariance is useful. The sample covariance has been around forever; it was there well before George Price&lt;br /&gt;
was born, and it is used in parameter estmation and hypothesis testing in all other fields of science, where no one has ever heard of G.R. Price. And, most importantly, using the sample covariance is obviously not the same as using the Price equation. It is using the sample covariance.&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 10:45:52 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_1.0</comments>		</item>
		<item>
			<title>Price 1.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_1.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* A very simple model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A very simple model ==&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 2 individuals. We depart from a  population in which individual no 1 has &amp;quot;the&amp;quot; gene, while the other, individual no 2, does not. In Price equation terms, that means that the variable &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt;, which denotes the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; becomes: &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The next generation of 2 individuals is drawn in a very simple way. First we draw the first, and then we draw the second. That makes it a Wright-Fisher process. At both draws the new individual could be the offspring of individual no 1 or of individual no 2. Reproduction is asexual, hence the offspring is a perfect copy of its parent. Now here comes the important thing. We assume that at both draws, the probability of no 1 from the parent population - the one with the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt;, while the probability of no 2 from the parent population - the one without the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;1-p&amp;lt;/math&amp;gt;. That gives us four possible transitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Price1Setting.jpg|400px|center|thumb|Four possible transitions]]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What the new generation will be is a random variable. What the current generation is, '''is not'''; the current generation is simply given. We can however think of a ''hypothetical'' chance experiment such that, in combination with the actual random transition, we get two random variables, between which we can define a covariance. So here is the recipe. &lt;br /&gt;
&lt;br /&gt;
1) Draw one of the individuals from the parent population (this is the hypothetical random variable).&lt;br /&gt;
&lt;br /&gt;
2) Draw the next generation (this is the actual random thing that happens in the the transition).&lt;br /&gt;
&lt;br /&gt;
The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is now defined as the genotype of the parent. That is a simple, albeit hypothetical random variable: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left(&lt;br /&gt;
X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt;, which is the number of offspring that the parent that has been drawn begets. This is a slightly more complicated random variable, because the chances depend on which one of the two possible parents has been chosen. So we get a (not too long) list of conditional probabilities. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=0 | X=0\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1 | X=0\right) = 2p \left( 1-p\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=2 | X=0\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The other conditional probabilities are the reverse,because the parent of a new individual is the one if it is not the other, and vice versa...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=0|X=1\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1|X=1\right) =2p\left( 1-p\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=2|X=1\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  &amp;lt;math&amp;gt;X &amp;lt;/math&amp;gt; and  &amp;lt;math&amp;gt;Y &amp;lt;/math&amp;gt; are pretty well defined, so we can also compute the covariance of these two actual random variables...&lt;br /&gt;
&lt;br /&gt;
Let us first look at expectations...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{E}\left[ X\right]=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ X\right] =\sum_{x=0,1}x\mathbb{P}\left( X=x\right) =\mathbb{P}\left( X=1\right) =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For obvious symmetry reasons; the total number of offspring is 2, and either one could be the parent, so ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =1&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =\sum_{x=0,1}\sum_{y=0,1,2}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{y=1,2}\sum_{x=0,1}y\mathbb{P}\left( X=x\right) \mathbb{P}\left(Y=y|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \left( \frac{1}{2}\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot 2p\left( 1-p\right) \right) +2\cdot \left( \frac{1}{2}\cdot p^{2}+\frac{1}{2}\cdot \left( 1-p\right) ^{2}\right) = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] = p &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,1}\sum_{y=0,1,2}xy\mathbb{P}\left( X=x,Y=y\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(because &amp;lt;math&amp;gt;xy=0&amp;lt;/math&amp;gt; if either &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;y=0&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\sum_{x=1}\sum_{y=1,2}xy\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1,Y=1\right) +2\cdot \mathbb{P}\left(X=1,Y=2\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1\right) \cdot \mathbb{P}\left(Y=1|X=1\right) +2\cdot \mathbb{P}\left( X=1\right) \mathbb{P}\left(Y=2|X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \frac{1}{2}\cdot 2p\left( 1-p\right) +2\cdot \frac{1}{2}\cdot p^{2}= &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=p\left( 1-p\right) +p^{2}= p&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance is then...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] &lt;br /&gt;
\mathbb{E}\left[ Y\right] =p-\frac{1}{2}\cdot 1=p-\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this very simple model ==&lt;br /&gt;
&lt;br /&gt;
An interesting question would be: is it good to have the gene? &lt;br /&gt;
&lt;br /&gt;
Or, if we do statistics: suppose we know that the process has this form, but we  don't know the value of ''p''. Then the question becomes: is ''p&amp;gt;1/2'', or, equivalently, is ''Cov( X,Y) &amp;gt;0''. Below we will try to answer that question. But first we will look at what the Price equation does to all of this.&lt;br /&gt;
&lt;br /&gt;
For a given transition, the Price equation constitutes an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N}\sum_{i}q_{i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; (For this particular model this quantity is 0.5).&lt;br /&gt;
&lt;br /&gt;
The frequency of the gene in the offspring population is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation 1.0 then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this simple case for N = 2 this amounts to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i}}{2}\right] &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
The point where confusion starts, is that George Price named the right hand side of this equation ''Cov(z,q)''. The claim of the Price equation - which we contend - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. The central issue here is that this ''Cov(z,q)'' is discussed as if it were a real covariance. Is that correct? &lt;br /&gt;
&lt;br /&gt;
Try yourself!&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial1.Tutorial1.class&amp;quot;  height=&amp;quot;400&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency ''Q'' can go up by 1/2, remain what it is, or go down by 1/2. The value of this so-called ''Covariance'' just follows that change in frequency (and because it is not a real covariance, we will use quotation marks from now on). This creates an illusion of understanding, because whatever happens, the covariance changes along with the outcome of the chance experiment. In other words: '''the data explain the data'''. &lt;br /&gt;
&lt;br /&gt;
This is, of course, not OK; the true and well-defined covariance is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) = p-\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This does not depend on the realisation. Cov(X,Y) defines the properties of the chance experiment, and the realisation of this chance experiment defines &amp;quot;Cov(z,q)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==What would a proper probability theorist do?==&lt;br /&gt;
&lt;br /&gt;
Try to figure out the transition probabilities for the suggested model. It seems that you are a proper probability theorist, because that is what you just did.  Congrats!&lt;br /&gt;
&lt;br /&gt;
== What would a proper statistician do? ==&lt;br /&gt;
&lt;br /&gt;
If you are interested in statistics, which is only natural if you care for evolution, and you do not know the true model that generates the transitions, then you would want to try to answer the question what $p$ is. Is ''p&amp;gt;1/2''? Then having the gene is good for reproduction. Is ''p&amp;lt;1/2''? Then not. &lt;br /&gt;
&lt;br /&gt;
Is ''p=1/2''? Then it is good nor bad. So how do we find out? Well, the thing with statistics is that you will never find out for sure. All we can do is try to find ways to estimate this ''p'', or design tests on if and how ''p'' differs from ''1/2'', that will help us make statements about the true model with some confidence. Here are a few such statements.&lt;br /&gt;
&lt;br /&gt;
===Estimation of p===&lt;br /&gt;
&lt;br /&gt;
One of the reasons that so many are convinced of the value of the Price equation is that it ''almost'' hits the nail on the head (even though it misses the head completely). So here we go with what sometimes feels as an indication that the Price equation is not so wrong after all. If you sense this in yourself, just return to the interactive part above.&lt;br /&gt;
&lt;br /&gt;
If you draw a new generation, then that new generation comes with a &amp;quot;Cov(z,q)&amp;quot; . With probability &amp;lt;math&amp;gt;p^{2}&amp;lt;/math&amp;gt; you draw  two 1's, which implies  &amp;quot;Cov(z,q)&amp;quot;=+1/2. With probability &amp;lt;math&amp;gt;(1-p) ^{2}&amp;lt;/math&amp;gt; you draw  two 0's, which implies &amp;quot;Cov(z,q)&amp;quot;=-1/2. So&amp;quot;Cov(z,q)&amp;quot; is actually a random variable itself, the characteristics of which we can look at. Two natural characteristics are its expected value and its variance. Now the expectation of this so-called variance is, luckily,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}. &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i} }{2}\right] = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=\sum_{z_{1}=0,1,2}\left[ \frac{z_{1}q_{1}}{2}-\frac{q_{1}}{2}\right] &lt;br /&gt;
\mathbb{P}\left( Z_{1}=z_{1}\right) = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=-\frac{1}{2}\cdot \left( 1-p\right) ^{2}+0\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot p^{2}=p-\frac{1}{2}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the realisation varies quite a bit, as we have seen in interactive part above. This is reflected in the variance of &amp;quot;Cov(z,q)&amp;quot;;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] = \frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \left( ^{\prime \prime }Cov\left( z,q\right) ^{\prime&lt;br /&gt;
\prime }\right) ^{2}\right] -\mathbb{E}^{2}\left[ \left( ^{\prime \prime}Cov\left( z,q\right) ^{\prime \prime }\right) \right] =\frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This variance can be reduced though if we take a large sample. Suppose that we have individuals ''i=1,...,n'' with the gene, and individuals ''i=n+1,...,2n''&lt;br /&gt;
without it. Now we draw the next generation in the same way as before, which looks a bit more general; ''2n'' individuals are drawn, and at every draw&lt;br /&gt;
individual ''i'' has a probability with which it is drawn to reproduce. For ''i=1,...,n'' this probability is &amp;lt;math&amp;gt;\frac{p_{1}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
For ''i=n+1,...,2n'' this probability is &amp;lt;math&amp;gt;\frac{p_{0}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. For this transition, one can show that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =p-\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\lim_{n\rightarrow \infty }Var\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we indeed define &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime \prime }Cov\left( z,q\right)^{\prime \prime }&amp;lt;/math&amp;gt;  as &amp;lt;math&amp;gt;\frac{1}{2n}\left(\sum_{i=1}^{2n}z_{i}q_{i}- \sum_{i=1}^{2n}q_{i}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }+\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is an unbiased estimator of ''p'' - because &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The quantity &amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }&amp;lt;/math&amp;gt; is also regularly referred to as the ''sample'' covariance, which is not the true covariance (true covariance = fixed property of two random variables, sample covariance = itself a random variable).&lt;br /&gt;
&lt;br /&gt;
===Testing properties of p ===&lt;br /&gt;
&lt;br /&gt;
The ''sample'' covariance is typically also used as input for in tests of the type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{0} : p=\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{1} : p\neq \frac{1}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here?== &lt;br /&gt;
&lt;br /&gt;
Not. For determining the properties of the model, the Price equation did not help, and in fact cannot even be of use. We found the transition&lt;br /&gt;
probabilities just by doing probability calculations. For doing statistics the Price equation did not help either. And yes, the Price equation applied to one actual draw does have the sample covariance of that draw in it, and the sample covariance is a useful thing, but we do not need the Price&lt;br /&gt;
equation for knowing that the sample covariance is useful. The sample covariance has been around forever; it was there well before George Price&lt;br /&gt;
was born, and it is used in parameter estmation and hypothesis testing in all other fields of science, where no one has ever heard of G.R. Price. And, most importantly, using the sample covariance is obviously not the same as using the Price equation. It is using the sample covariance.&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 10:44:13 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_1.0</comments>		</item>
		<item>
			<title>Price 1.0</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price_1.0</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* A very simple model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
[[Price | Go to the front-page of Price equation tutorials ]]&lt;br /&gt;
&lt;br /&gt;
== A very simple model ==&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a population of 2 individuals. We depart from a  population in which individual no 1 has &amp;quot;the&amp;quot; gene, while the other, individual no 2, does not. In Price equation terms, that means that the variable &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt;, which denotes the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; becomes: &amp;lt;math&amp;gt;q_{1}=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;q_{2}=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The next generation of 2 individuals is drawn in a very simple way. First we draw the first, and then we draw the second. That makes it a Wright-Fisher process. At both draws the new individual could be the offspring of individual no 1 or of individual no 2. Reproduction is asexual, hence the offspring is a perfect copy of its parent. Now here comes the important thing. We assume that at both draws, the probability of no 1 from the parent population - the one with the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt;, while the probability of no 2 from the parent population - the one without the gene - to be drawn for reproduction is &amp;lt;math&amp;gt;1-p&amp;lt;/math&amp;gt;. That gives us four possible transitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Price1Setting.jpg|400px|center|thumb|Four possible transitions]]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What the new generation will be is a random variable. What the current generation is, '''is not'''; the current generation is simply given. We can however think of a ''hypothetical'' chance experiment such that, in combination with the actual random transition, we get two random variables, between which we can define a covariance. So here is the recipe. &lt;br /&gt;
&lt;br /&gt;
1) Draw one of the individuals from the parent population (this is the hypothetical random variable).&lt;br /&gt;
&lt;br /&gt;
2) Draw the next generation (this is the actual random thing that happens in the the transition).&lt;br /&gt;
&lt;br /&gt;
The random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is now defined as the genotype of the parent. That is a simple, albeit hypothetical random variable: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left(&lt;br /&gt;
X=1\right) =\mathbb{P}\left( X=0\right) =\frac{1}{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Then we define the random variable &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt;, which is the number of offspring that the parent that has been drawn begets. This is a slightly more complicated random variable, because the chances depend on which one of the two possible parents have been chosen. So we get a (not too long) list of conditional probabilities. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=0 | X=0\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1 | X=0\right) = 2p \left( 1-p\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=2 | X=0\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The other conditional probabilities are the reverse,because the parent of a new individual is the one if it is not the other, and vice versa...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbb{P}\left( Y=0|X=1\right) = \left( 1-p\right) ^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=1|X=1\right) =2p\left( 1-p\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{P}\left( Y=2|X=1\right) =p^{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  &amp;lt;math&amp;gt;X &amp;lt;/math&amp;gt; and  &amp;lt;math&amp;gt;Y &amp;lt;/math&amp;gt; are pretty well defined, so we can also compute the covariance of these two actual random variables...&lt;br /&gt;
&lt;br /&gt;
Let us first look at expectations...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{E}\left[ X\right]=\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ X\right] =\sum_{x=0,1}x\mathbb{P}\left( X=x\right) =\mathbb{P}\left( X=1\right) =\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For obvious symmetry reasons; the total number of offspring is 2, and either one could be the parent, so ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =1&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ Y\right] =\sum_{x=0,1}\sum_{y=0,1,2}y\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\sum_{y=1,2}\sum_{x=0,1}y\mathbb{P}\left( X=x\right) \mathbb{P}\left(Y=y|X=x\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \left( \frac{1}{2}\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot 2p\left( 1-p\right) \right) +2\cdot \left( \frac{1}{2}\cdot p^{2}+\frac{1}{2}\cdot \left( 1-p\right) ^{2}\right) = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] = p &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ XY\right] =\sum_{x=0,1}\sum_{y=0,1,2}xy\mathbb{P}\left( X=x,Y=y\right)  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(because &amp;lt;math&amp;gt;xy=0&amp;lt;/math&amp;gt; if either &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;y=0&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =\sum_{x=1}\sum_{y=1,2}xy\mathbb{P}\left( X=x,Y=y\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1,Y=1\right) +2\cdot \mathbb{P}\left(X=1,Y=2\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \mathbb{P}\left( X=1\right) \cdot \mathbb{P}\left(Y=1|X=1\right) +2\cdot \mathbb{P}\left( X=1\right) \mathbb{P}\left(Y=2|X=1\right) = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =1\cdot \frac{1}{2}\cdot 2p\left( 1-p\right) +2\cdot \frac{1}{2}\cdot p^{2}= &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=p\left( 1-p\right) +p^{2}= p&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The covariance is then...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) =\mathbb{E}\left[ XY\right] -\mathbb{E}\left[ X\right] &lt;br /&gt;
\mathbb{E}\left[ Y\right] =p-\frac{1}{2}\cdot 1=p-\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Price equation for this very simple model ==&lt;br /&gt;
&lt;br /&gt;
An interesting question would be: is it good to have the gene? &lt;br /&gt;
&lt;br /&gt;
Or, if we do statistics: suppose we know that the process has this form, but we  don't know the value of ''p''. Then the question becomes: is ''p&amp;gt;1/2'', or, equivalently, is ''Cov( X,Y) &amp;gt;0''. Below we will try to answer that question. But first we will look at what the Price equation does to all of this.&lt;br /&gt;
&lt;br /&gt;
For a given transition, the Price equation constitutes an identity. The frequency of the gene in the parent population is, in general, defined as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{1}=\frac{1}{N}\sum_{i}q_{i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of individuals, and &amp;lt;math&amp;gt;q_{i}&amp;lt;/math&amp;gt; is the frequency of the gene in individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; (For this particular model this quantity is 0.5).&lt;br /&gt;
&lt;br /&gt;
The frequency of the gene in the offspring population is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}=\frac{\sum_{i=1}^{N}z_{i}q_{i}}{\sum_{i=1}^{N}z_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;z_{i}&amp;lt;/math&amp;gt; is the number of times individual &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the parent population was drawn for reproduction. The Price equation 1.0 then is the following identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\triangle Q=Q_{2}-Q_{1}=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q_{2}-Q_{1} =\frac{\sum_{i}z_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\sum_{i}z_{i}q_{i}+\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}-\frac{1}{N}\sum_{i}z_{i}\sum_{i}q_{i}}{\sum_{i}z_{i}}-\frac{1}{N}\sum_{i}q_{i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=N\left[ \frac{\frac{1}{N}\sum_{i}z_{i}q_{i}-\left( \frac{1}{N}\sum_{i}z_{i}\right) \left( \frac{1}{N}\sum_{i}q_{i}\right) }{\sum_{i}z_{i}}\right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{N}{\sum_{i}z_{i}}\left[ \frac{\sum_{i}z_{i}q_{i}}{N}-\left( \frac{\sum_{i}z_{i}}{N}\right) \left( \frac{\sum_{i}q_{i}}{N}\right) \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this simple case for N = 2 this amounts to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\triangle Q=\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i}}{2}\right] &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Confusion ==&lt;br /&gt;
&lt;br /&gt;
The point where confusion starts, is that George Price named the right hand side of this equation ''Cov(z,q)''. The claim of the Price equation - which we contend - is that the equation unveils that a change in frequency - &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; - is explained by the covariance between having the gene and the number of offspring - ''Cov(z,q)''. The central issue here is that this ''Cov(z,q)'' is discussed as if it were a real covariance. Is that correct? &lt;br /&gt;
&lt;br /&gt;
Try yourself!&lt;br /&gt;
&amp;lt;java_applet code=&amp;quot;tutorial1.Tutorial1.class&amp;quot;  height=&amp;quot;400&amp;quot; width=&amp;quot;600&amp;quot; archive=&amp;quot;Price.jar&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tried a few times, you may have found out that &amp;lt;math&amp;gt;\triangle Q&amp;lt;/math&amp;gt; can attain different values; the next generation is a random draw, which implies that the frequency ''Q'' can go up by 1/2, remain what it is, or go down by 1/2. The value of this so-called ''Covariance'' just follows that change in frequency (and because it is not a real covariance, we will use quotation marks from now on). This creates an illusion of understanding, because whatever happens, the covariance changes along with the outcome of the chance experiment. In other words: '''the data explain the data'''. &lt;br /&gt;
&lt;br /&gt;
This is, of course, not OK; the true and well-defined covariance is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Cov\left( X,Y\right) = p-\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This does not depend on the realisation. Cov(X,Y) defines the properties of the chance experiment, and the realisation of this chance experiment defines &amp;quot;Cov(z,q)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==What would a proper probability theorist do?==&lt;br /&gt;
&lt;br /&gt;
Try to figure out the transition probabilities for the suggested model. It seems that you are a proper probability theorist, because that is what you just did.  Congrats!&lt;br /&gt;
&lt;br /&gt;
== What would a proper statistician do? ==&lt;br /&gt;
&lt;br /&gt;
If you are interested in statistics, which is only natural if you care for evolution, and you do not know the true model that generates the transitions, then you would want to try to answer the question what $p$ is. Is ''p&amp;gt;1/2''? Then having the gene is good for reproduction. Is ''p&amp;lt;1/2''? Then not. &lt;br /&gt;
&lt;br /&gt;
Is ''p=1/2''? Then it is good nor bad. So how do we find out? Well, the thing with statistics is that you will never find out for sure. All we can do is try to find ways to estimate this ''p'', or design tests on if and how ''p'' differs from ''1/2'', that will help us make statements about the true model with some confidence. Here are a few such statements.&lt;br /&gt;
&lt;br /&gt;
===Estimation of p===&lt;br /&gt;
&lt;br /&gt;
One of the reasons that so many are convinced of the value of the Price equation is that it ''almost'' hits the nail on the head (even though it misses the head completely). So here we go with what sometimes feels as an indication that the Price equation is not so wrong after all. If you sense this in yourself, just return to the interactive part above.&lt;br /&gt;
&lt;br /&gt;
If you draw a new generation, then that new generation comes with a &amp;quot;Cov(z,q)&amp;quot; . With probability &amp;lt;math&amp;gt;p^{2}&amp;lt;/math&amp;gt; you draw  two 1's, which implies  &amp;quot;Cov(z,q)&amp;quot;=+1/2. With probability &amp;lt;math&amp;gt;(1-p) ^{2}&amp;lt;/math&amp;gt; you draw  two 0's, which implies &amp;quot;Cov(z,q)&amp;quot;=-1/2. So&amp;quot;Cov(z,q)&amp;quot; is actually a random variable itself, the characteristics of which we can look at. Two natural characteristics are its expected value and its variance. Now the expectation of this so-called variance is, luckily,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}. &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \frac{\sum_{i}z_{i}q_{i}}{2}-\frac{\sum_{i}q_{i} }{2}\right] = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=\sum_{z_{1}=0,1,2}\left[ \frac{z_{1}q_{1}}{2}-\frac{q_{1}}{2}\right] &lt;br /&gt;
\mathbb{P}\left( Z_{1}=z_{1}\right) = &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
=-\frac{1}{2}\cdot \left( 1-p\right) ^{2}+0\cdot 2p\left( 1-p\right) +\frac{1}{2}\cdot p^{2}=p-\frac{1}{2}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the realisation varies quite a bit, as we have seen in interactive part above. This is reflected in the variance of &amp;quot;Cov(z,q)&amp;quot;;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] = \frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;toggledisplay&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
Var\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =\mathbb{E}\left[ \left( ^{\prime \prime }Cov\left( z,q\right) ^{\prime&lt;br /&gt;
\prime }\right) ^{2}\right] -\mathbb{E}^{2}\left[ \left( ^{\prime \prime}Cov\left( z,q\right) ^{\prime \prime }\right) \right] =\frac{1}{2}p\left( 1-p\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/toggledisplay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This variance can be reduced though if we take a large sample. Suppose that we have individuals ''i=1,...,n'' with the gene, and individuals ''i=n+1,...,2n''&lt;br /&gt;
without it. Now we draw the next generation in the same way as before, which looks a bit more general; ''2n'' individuals are drawn, and at every draw&lt;br /&gt;
individual ''i'' has a probability with which it is drawn to reproduce. For ''i=1,...,n'' this probability is &amp;lt;math&amp;gt;\frac{p_{1}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
For ''i=n+1,...,2n'' this probability is &amp;lt;math&amp;gt;\frac{p_{0}}{np_{1}+np_{0}}&amp;lt;/math&amp;gt;. For this transition, one can show that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{E}\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =p-\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\lim_{n\rightarrow \infty }Var\left[ \frac{\sum_{i=1}^{2n}z_{i}q_{i}}{2n}-\frac{\sum_{i=1}^{2n}q_{i}}{2n}\right] =0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we indeed define &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime \prime }Cov\left( z,q\right)^{\prime \prime }&amp;lt;/math&amp;gt;  as &amp;lt;math&amp;gt;\frac{1}{2n}\left(\sum_{i=1}^{2n}z_{i}q_{i}- \sum_{i=1}^{2n}q_{i}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }+\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is an unbiased estimator of ''p'' - because &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbb{E}\left[ ^{\prime \prime }Cov\left( z,q\right) ^{\prime \prime }\right] =p-\frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The quantity &amp;lt;math&amp;gt;^{\prime\prime }Cov\left( z,q\right) ^{\prime \prime }&amp;lt;/math&amp;gt; is also regularly referred to as the ''sample'' covariance, which is not the true covariance (true covariance = fixed property of two random variables, sample covariance = itself a random variable).&lt;br /&gt;
&lt;br /&gt;
===Testing properties of p ===&lt;br /&gt;
&lt;br /&gt;
The ''sample'' covariance is typically also used as input for in tests of the type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{0} : p=\frac{1}{2} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
H_{1} : p\neq \frac{1}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== So how does the Price equation help here?== &lt;br /&gt;
&lt;br /&gt;
Not. For determining the properties of the model, the Price equation did not help, and in fact cannot even be of use. We found the transition&lt;br /&gt;
probabilities just by doing probability calculations. For doing statistics the Price equation did not help either. And yes, the Price equation applied to one actual draw does have the sample covariance of that draw in it, and the sample covariance is a useful thing, but we do not need the Price&lt;br /&gt;
equation for knowing that the sample covariance is useful. The sample covariance has been around forever; it was there well before George Price&lt;br /&gt;
was born, and it is used in parameter estmation and hypothesis testing in all other fields of science, where no one has ever heard of G.R. Price. And, most importantly, using the sample covariance is obviously not the same as using the Price equation. It is using the sample covariance.&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 10:42:14 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price_1.0</comments>		</item>
		<item>
			<title>Price</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Evolution is all about transitions. One generation gives birth to the next, which gives birth to yet another generation, in an endless chain of transitions. These transitions don't just go anywhere; some transitions are more likely than others. First of all we beget offspring that is likely to bear some similarity with ourselves.  And how likely we are to get offspring at all, and how many, tends to depend on certain heritable characteristics. The relative likelihood of some transitions and the relative improbability of others imply that we can make informed guesses as to where this endless chain of transitions came from and where it is going. That is what the science of evolution does.&lt;br /&gt;
&lt;br /&gt;
The Price equation zooms in on transitions from one generation to the next. This suggests that it could be a fundamental tool for understanding this&lt;br /&gt;
process of evolution. It was formulated by George Richard Price in 1970 [http://www.nature.com/nature/journal/v227/n5257/abs/227520a0.html in an article in Nature], and acclaimed by some, maybe even quite a few, to be a fundamental ingredient for models of evolution ([http://dx.doi.org/10.1016/j.cub.2008.01.005 Gardner], [http://dx.doi.org/10.1006/jtbi.1995.0148 Frank], [http://dx.doi.org/10.1006/jtbi.2002.3015 Grafen]). We think not. We think it is an unintended hoax. The reason why it is hard to identify it as such is that it is all about probability theory and statistics, and those two topics are just not that easy. The following tutorial will help by looking at what proper probability theory or statistics would do and compare that to what the Price equation does to numbers that represent those transitions. There is [http://dx.doi.org/10.1016/j.jtbi.2005.04.026 an article with the same message], but this tutorial makes it simpler, by allowing you to play around with models, data and samples yourself. At some points you may find that the steps the tutorial takes are evident and all too easy, but it is possible that after a few steps, as simple as they are, you may nonetheless feel confused enough to make you want to retrace your steps and be happy, the second time around, that they are that simple. Or not, in which case you will just have an easy journey to a deep understanding why the Price equation is not what some say it is.&lt;br /&gt;
&lt;br /&gt;
==Price 1.0: A very simple model ==&lt;br /&gt;
We will begin with the simplest real model that we can think of. No sex, no shrinking or expanding populations, no frequency dependence, no&lt;br /&gt;
complications whatsoever. Just two individuals that are ready to reproduce. Asexually. This gives us a version of the Price equation that is even&lt;br /&gt;
simpler than the first version by Price himself. And it will give us probability theory and statistics that is relatively nice and easy too, and therefore an excellent start that helps us get acquainted to the joys of rigour and precision.&lt;br /&gt;
&lt;br /&gt;
[[Price 1.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 1.0 Applet | Go straight to the software]]&lt;br /&gt;
&lt;br /&gt;
== Price 2.0: A model with sexual reproduction ==&lt;br /&gt;
&lt;br /&gt;
If we add sexual reproduction, everything gets slightly more complicated, the proper statistics as well as the Price equation. This makes&lt;br /&gt;
the statistics much more fun, and it makes the failure of the Price equation to be of any help even more salient. We like to keep it relatively simple though, so for the moment we do not assume actual different sexes, but we do assume that every individual is diploid&lt;br /&gt;
&lt;br /&gt;
[[Price 2.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 2.0 Applet | Go straight to the software]]&lt;br /&gt;
&lt;br /&gt;
== Price 3.0: A model with frequency dependence ==&lt;br /&gt;
&lt;br /&gt;
We go back to the asexual model, but now we will take a model with frequency dependence. This will be a bit more complicated, but we can still use a basic, well known model. They are paired randomly, and play a game in those pairs. The game gives them payoffs according to a payoff matrix&lt;br /&gt;
&lt;br /&gt;
[[Price 3.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 3.0 Applet | Go straight to the software]]&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 10:40:33 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price</comments>		</item>
		<item>
			<title>Price</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Evolution is all about transitions. One generation gives birth to the next, which gives birth to yet another generation, in an endless chain of transitions. These transitions don't just go anywhere; some transitions are more likely than others. First of all we beget offspring that is likely to bear some similarity with ourselves.  And how likely we are to get offspring at all, and how many, tends to depend on certain heritable characteristics. The relative likelihood of some transitions and the relative improbability of others imply that we can make informed guesses as to where this endless chain of transitions came from and where it is going. That is what the science of evolution does.&lt;br /&gt;
&lt;br /&gt;
The Price equation zooms in on transitions from one generation to the next. This suggests that it could be a fundamental tool for understanding this&lt;br /&gt;
process of evolution. It was formulated by George Richard Price in 1970 [http://www.nature.com/nature/journal/v227/n5257/abs/227520a0.html in an article in Nature], and acclaimed by some, maybe even quite a few, to be a fundamental ingredient for models of evolution ([http://dx.doi.org/10.1016/j.cub.2008.01.005 Gardner], [http://dx.doi.org/10.1006/jtbi.1995.0148 Frank], Grafen). We think not. We think it is an unintended hoax. The reason why it is hard to identify it as such is that it is all about probability theory and statistics, and those two topics are just not that easy. The following tutorial will help by looking at what proper probability theory or statistics would do and compare that to what the Price equation does to numbers that represent those transitions. There is [http://dx.doi.org/10.1016/j.jtbi.2005.04.026 an article with the same message], but this tutorial makes it simpler, by allowing you to play around with models, data and samples yourself. At some points you may find that the steps the tutorial takes are evident and all too easy, but it is possible that after a few steps, as simple as they are, you may nonetheless feel confused enough to make you want to retrace your steps and be happy, the second time around, that they are that simple. Or not, in which case you will just have an easy journey to a deep understanding why the Price equation is not what some say it is.&lt;br /&gt;
&lt;br /&gt;
==Price 1.0: A very simple model ==&lt;br /&gt;
We will begin with the simplest real model that we can think of. No sex, no shrinking or expanding populations, no frequency dependence, no&lt;br /&gt;
complications whatsoever. Just two individuals that are ready to reproduce. Asexually. This gives us a version of the Price equation that is even&lt;br /&gt;
simpler than the first version by Price himself. And it will give us probability theory and statistics that is relatively nice and easy too, and therefore an excellent start that helps us get acquainted to the joys of rigour and precision.&lt;br /&gt;
&lt;br /&gt;
[[Price 1.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 1.0 Applet | Go straight to the software]]&lt;br /&gt;
&lt;br /&gt;
== Price 2.0: A model with sexual reproduction ==&lt;br /&gt;
&lt;br /&gt;
If we add sexual reproduction, everything gets slightly more complicated, the proper statistics as well as the Price equation. This makes&lt;br /&gt;
the statistics much more fun, and it makes the failure of the Price equation to be of any help even more salient. We like to keep it relatively simple though, so for the moment we do not assume actual different sexes, but we do assume that every individual is diploid&lt;br /&gt;
&lt;br /&gt;
[[Price 2.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 2.0 Applet | Go straight to the software]]&lt;br /&gt;
&lt;br /&gt;
== Price 3.0: A model with frequency dependence ==&lt;br /&gt;
&lt;br /&gt;
We go back to the asexual model, but now we will take a model with frequency dependence. This will be a bit more complicated, but we can still use a basic, well known model. They are paired randomly, and play a game in those pairs. The game gives them payoffs according to a payoff matrix&lt;br /&gt;
&lt;br /&gt;
[[Price 3.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 3.0 Applet | Go straight to the software]]&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 10:37:06 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price</comments>		</item>
		<item>
			<title>Price</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Evolution is all about transitions. One generation gives birth to the next, which gives birth to yet another generation, in an endless chain of transitions. These transitions don't just go anywhere; some transitions are more likely than others. First of all we beget offspring that is likely to bear some similarity with ourselves.  And how likely we are to get offspring at all, and how many, tends to depend on certain heritable characteristics. The relative likelihood of some transitions and the relative improbability of others imply that we can make informed guesses as to where this endless chain of transitions came from and where it is going. That is what the science of evolution does.&lt;br /&gt;
&lt;br /&gt;
The Price equation zooms in on transitions from one generation to the next. This suggests that it could be a fundamental tool for understanding this&lt;br /&gt;
process of evolution. It was formulated by George Richard Price in 1970 [http://www.nature.com/nature/journal/v227/n5257/abs/227520a0.html in an article in Nature], and acclaimed by some, maybe even quite a few researchers, to be a fundamental ingredient for models of evolution ([http://dx.doi.org/10.1016/j.cub.2008.01.005 Gardner], [http://dx.doi.org/10.1006/jtbi.1995.0148 Frank], Grafen). We think not. We think it is an unintended hoax. The reason why it is hard to identify it as such is that it is all about probability theory and statistics, and those two topics are just not that easy. The following tutorial will help by looking at what proper probability theory or statistics would do and compare that to what the Price equation does to numbers that represent those transitions. There is [http://dx.doi.org/10.1016/j.jtbi.2005.04.026 an article with the same message], but this tutorial makes it simpler, by allowing you to play around with models, data and samples yourself. At some points you may find that the steps the tutorial takes are evident and all too easy, but it is possible that after a few steps, as simple as they are, you may nonetheless feel confused enough to make you want to retrace your steps and be happy, the second time around, that they are that simple. Or not, in which case you will just have an easy journey to a deep understanding why the Price equation is not what some say it is.&lt;br /&gt;
&lt;br /&gt;
==Price 1.0: A very simple model ==&lt;br /&gt;
We will begin with the simplest real model that we can think of. No sex, no shrinking or expanding populations, no frequency dependence, no&lt;br /&gt;
complications whatsoever. Just two individuals that are ready to reproduce. Asexually. This gives us a version of the Price equation that is even&lt;br /&gt;
simpler than the first version by Price himself. And it will give us probability theory and statistics that is relatively nice and easy too, and therefore an excellent start that helps us get acquainted to the joys of rigour and precision.&lt;br /&gt;
&lt;br /&gt;
[[Price 1.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 1.0 Applet | Go straight to the software]]&lt;br /&gt;
&lt;br /&gt;
== Price 2.0: A model with sexual reproduction ==&lt;br /&gt;
&lt;br /&gt;
If we add sexual reproduction, everything gets slightly more complicated, the proper statistics as well as the Price equation. This makes&lt;br /&gt;
the statistics much more fun, and it makes the failure of the Price equation to be of any help even more salient. We like to keep it relatively simple though, so for the moment we do not assume actual different sexes, but we do assume that every individual is diploid&lt;br /&gt;
&lt;br /&gt;
[[Price 2.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 2.0 Applet | Go straight to the software]]&lt;br /&gt;
&lt;br /&gt;
== Price 3.0: A model with frequency dependence ==&lt;br /&gt;
&lt;br /&gt;
We go back to the asexual model, but now we will take a model with frequency dependence. This will be a bit more complicated, but we can still use a basic, well known model. They are paired randomly, and play a game in those pairs. The game gives them payoffs according to a payoff matrix&lt;br /&gt;
&lt;br /&gt;
[[Price 3.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 3.0 Applet | Go straight to the software]]&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 10:36:45 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price</comments>		</item>
		<item>
			<title>Price</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Evolution is all about transitions. One generation gives birth to the next, which gives birth to yet another generation, in an endless chain of transitions. These transitions don't just go anywhere; some transitions are more likely than others. First of all we beget offspring that is likely to bear some similarity with ourselves.  And how likely we are to get offspring at all, and how many, tends to depend on certain heritable characteristics. The relative likelihood of some transitions and the relative improbability of others imply that we can make informed guesses as to where this endless chain of transitions came from and where it is going. That is what the science of evolution does.&lt;br /&gt;
&lt;br /&gt;
The Price equation zooms in on transitions from one generation to the next. This suggests that it could be a fundamental tool for understanding this&lt;br /&gt;
process of evolution. It was formulated by George Richard Price in 1970 [http://www.nature.com/nature/journal/v227/n5257/abs/227520a0.html in an article in Nature], and acclaimed by some, maybe even quite a few researchers, to be a fundamental ingredient for models of evolution (Gardner, [http://dx.doi.org/10.1006/jtbi.1995.0148 Frank], Grafen). We think not. We think it is an unintended hoax. The reason why it is hard to identify it as such is that it is all about probability theory and statistics, and those two topics are just not that easy. The following tutorial will help by looking at what proper probability theory or statistics would do and compare that to what the Price equation does to numbers that represent those transitions. There is [http://dx.doi.org/10.1016/j.jtbi.2005.04.026 an article with the same message], but this tutorial makes it simpler, by allowing you to play around with models, data and samples yourself. At some points you may find that the steps the tutorial takes are evident and all too easy, but it is possible that after a few steps, as simple as they are, you may nonetheless feel confused enough to make you want to retrace your steps and be happy, the second time around, that they are that simple. Or not, in which case you will just have an easy journey to a deep understanding why the Price equation is not what some say it is.&lt;br /&gt;
&lt;br /&gt;
==Price 1.0: A very simple model ==&lt;br /&gt;
We will begin with the simplest real model that we can think of. No sex, no shrinking or expanding populations, no frequency dependence, no&lt;br /&gt;
complications whatsoever. Just two individuals that are ready to reproduce. Asexually. This gives us a version of the Price equation that is even&lt;br /&gt;
simpler than the first version by Price himself. And it will give us probability theory and statistics that is relatively nice and easy too, and therefore an excellent start that helps us get acquainted to the joys of rigour and precision.&lt;br /&gt;
&lt;br /&gt;
[[Price 1.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 1.0 Applet | Go straight to the software]]&lt;br /&gt;
&lt;br /&gt;
== Price 2.0: A model with sexual reproduction ==&lt;br /&gt;
&lt;br /&gt;
If we add sexual reproduction, everything gets slightly more complicated, the proper statistics as well as the Price equation. This makes&lt;br /&gt;
the statistics much more fun, and it makes the failure of the Price equation to be of any help even more salient. We like to keep it relatively simple though, so for the moment we do not assume actual different sexes, but we do assume that every individual is diploid&lt;br /&gt;
&lt;br /&gt;
[[Price 2.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 2.0 Applet | Go straight to the software]]&lt;br /&gt;
&lt;br /&gt;
== Price 3.0: A model with frequency dependence ==&lt;br /&gt;
&lt;br /&gt;
We go back to the asexual model, but now we will take a model with frequency dependence. This will be a bit more complicated, but we can still use a basic, well known model. They are paired randomly, and play a game in those pairs. The game gives them payoffs according to a payoff matrix&lt;br /&gt;
&lt;br /&gt;
[[Price 3.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 3.0 Applet | Go straight to the software]]&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 10:33:47 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price</comments>		</item>
		<item>
			<title>Price</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Evolution is all about transitions. One generation gives birth to the next, which gives birth to yet another generation, in an endless chain of transitions. These transitions don't just go anywhere; some transitions are more likely than others. First of all we beget offspring that is likely to bear some similarity with ourselves.  And how likely we are to get offspring at all, and how many, tends to depend on certain heritable characteristics. The relative likelihood of some transitions and the relative improbability of others imply that we can make informed guesses as to where this endless chain of transitions came from and where it is going. That is what the science of evolution does.&lt;br /&gt;
&lt;br /&gt;
The Price equation zooms in on transitions from one generation to the next. This suggests that it could be a fundamental tool for understanding this&lt;br /&gt;
process of evolution. It was formulated by George Richard Price in 1970 [http://www.nature.com/nature/journal/v227/n5257/abs/227520a0.html in an article in Nature], and acclaimed by some, maybe even quite a few researchers, to be a fundamental ingredient for models of evolution (Gardner, [http://dx.doi:10.1006/jtbi.1995.0148 Frank], Grafen). We think not. We think it is an unintended hoax. The reason why it is hard to identify it as such is that it is all about probability theory and statistics, and those two topics are just not that easy. The following tutorial will help by looking at what proper probability theory or statistics would do and compare that to what the Price equation does to numbers that represent those transitions. There is [http://dx.doi.org/10.1016/j.jtbi.2005.04.026 an article with the same message], but this tutorial makes it simpler, by allowing you to play around with models, data and samples yourself. At some points you may find that the steps the tutorial takes are evident and all too easy, but it is possible that after a few steps, as simple as they are, you may nonetheless feel confused enough to make you want to retrace your steps and be happy, the second time around, that they are that simple. Or not, in which case you will just have an easy journey to a deep understanding why the Price equation is not what some say it is.&lt;br /&gt;
&lt;br /&gt;
==Price 1.0: A very simple model ==&lt;br /&gt;
We will begin with the simplest real model that we can think of. No sex, no shrinking or expanding populations, no frequency dependence, no&lt;br /&gt;
complications whatsoever. Just two individuals that are ready to reproduce. Asexually. This gives us a version of the Price equation that is even&lt;br /&gt;
simpler than the first version by Price himself. And it will give us probability theory and statistics that is relatively nice and easy too, and therefore an excellent start that helps us get acquainted to the joys of rigour and precision.&lt;br /&gt;
&lt;br /&gt;
[[Price 1.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 1.0 Applet | Go straight to the software]]&lt;br /&gt;
&lt;br /&gt;
== Price 2.0: A model with sexual reproduction ==&lt;br /&gt;
&lt;br /&gt;
If we add sexual reproduction, everything gets slightly more complicated, the proper statistics as well as the Price equation. This makes&lt;br /&gt;
the statistics much more fun, and it makes the failure of the Price equation to be of any help even more salient. We like to keep it relatively simple though, so for the moment we do not assume actual different sexes, but we do assume that every individual is diploid&lt;br /&gt;
&lt;br /&gt;
[[Price 2.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 2.0 Applet | Go straight to the software]]&lt;br /&gt;
&lt;br /&gt;
== Price 3.0: A model with frequency dependence ==&lt;br /&gt;
&lt;br /&gt;
We go back to the asexual model, but now we will take a model with frequency dependence. This will be a bit more complicated, but we can still use a basic, well known model. They are paired randomly, and play a game in those pairs. The game gives them payoffs according to a payoff matrix&lt;br /&gt;
&lt;br /&gt;
[[Price 3.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 3.0 Applet | Go straight to the software]]&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 10:31:35 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price</comments>		</item>
		<item>
			<title>Price</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Evolution is all about transitions. One generation gives birth to the next, which gives birth to yet another generation, in an endless chain of transitions. These transitions don't just go anywhere; some transitions are more likely than others. First of all we beget offspring that is likely to bear some similarity with ourselves.  And how likely we are to get offspring at all, and how many, tends to depend on certain heritable characteristics. The relative likelihood of some transitions and the relative improbability of others imply that we can make informed guesses as to where this endless chain of transitions came from and where it is going. That is what the science of evolution does.&lt;br /&gt;
&lt;br /&gt;
The Price equation zooms in on transitions from one generation to the next. This suggests that it could be a fundamental tool for understanding this&lt;br /&gt;
process of evolution. It was formulated by George Richard Price in 1970 [http://www.nature.com/nature/journal/v227/n5257/abs/227520a0.html in an article in Nature], and acclaimed by some, maybe even quite a few researchers, to be a fundamental ingredient for models of evolution (Gardner, [doi:10.1006/jtbi.1995.0148 Frank], Grafen). We think not. We think it is an unintended hoax. The reason why it is hard to identify it as such is that it is all about probability theory and statistics, and those two topics are just not that easy. The following tutorial will help by looking at what proper probability theory or statistics would do and compare that to what the Price equation does to numbers that represent those transitions. There is [http://dx.doi.org/10.1016/j.jtbi.2005.04.026 an article with the same message], but this tutorial makes it simpler, by allowing you to play around with models, data and samples yourself. At some points you may find that the steps the tutorial takes are evident and all too easy, but it is possible that after a few steps, as simple as they are, you may nonetheless feel confused enough to make you want to retrace your steps and be happy, the second time around, that they are that simple. Or not, in which case you will just have an easy journey to a deep understanding why the Price equation is not what some say it is.&lt;br /&gt;
&lt;br /&gt;
==Price 1.0: A very simple model ==&lt;br /&gt;
We will begin with the simplest real model that we can think of. No sex, no shrinking or expanding populations, no frequency dependence, no&lt;br /&gt;
complications whatsoever. Just two individuals that are ready to reproduce. Asexually. This gives us a version of the Price equation that is even&lt;br /&gt;
simpler than the first version by Price himself. And it will give us probability theory and statistics that is relatively nice and easy too, and therefore an excellent start that helps us get acquainted to the joys of rigour and precision.&lt;br /&gt;
&lt;br /&gt;
[[Price 1.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 1.0 Applet | Go straight to the software]]&lt;br /&gt;
&lt;br /&gt;
== Price 2.0: A model with sexual reproduction ==&lt;br /&gt;
&lt;br /&gt;
If we add sexual reproduction, everything gets slightly more complicated, the proper statistics as well as the Price equation. This makes&lt;br /&gt;
the statistics much more fun, and it makes the failure of the Price equation to be of any help even more salient. We like to keep it relatively simple though, so for the moment we do not assume actual different sexes, but we do assume that every individual is diploid&lt;br /&gt;
&lt;br /&gt;
[[Price 2.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 2.0 Applet | Go straight to the software]]&lt;br /&gt;
&lt;br /&gt;
== Price 3.0: A model with frequency dependence ==&lt;br /&gt;
&lt;br /&gt;
We go back to the asexual model, but now we will take a model with frequency dependence. This will be a bit more complicated, but we can still use a basic, well known model. They are paired randomly, and play a game in those pairs. The game gives them payoffs according to a payoff matrix&lt;br /&gt;
&lt;br /&gt;
[[Price 3.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 3.0 Applet | Go straight to the software]]&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 10:30:45 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price</comments>		</item>
		<item>
			<title>Price</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Evolution is all about transitions. One generation gives birth to the next, which gives birth to yet another generation, in an endless chain of transitions. These transitions don't just go anywhere; some transitions are more likely than others. First of all we beget offspring that is likely to bear some similarity with ourselves.  And how likely we are to get offspring at all, and how many, tends to depend on certain heritable characteristics. The relative likelihood of some transitions and the relative improbability of others imply that we can make informed guesses as to where this endless chain of transitions came from and where it is going. That is what the science of evolution does.&lt;br /&gt;
&lt;br /&gt;
The Price equation zooms in on transitions from one generation to the next. This suggests that it could be a fundamental tool for understanding this&lt;br /&gt;
process of evolution. It was formulated by George Richard Price in 1970 [http://www.nature.com/nature/journal/v227/n5257/abs/227520a0.html in an article in Nature], and acclaimed by some, maybe even quite a few researchers, to be a fundamental ingredient for models of evolution (link Gardner, Frank, Grafen). We think not. We think it is an unintended hoax. The reason why it is hard to identify it as such is that it is all about probability theory and statistics, and those two topics are just not that easy. The following tutorial will help by looking at what proper probability theory or statistics would do and compare that to what the Price equation does to numbers that represent those transitions. There is [http://dx.doi.org/10.1016/j.jtbi.2005.04.026 an article with the same message], but this tutorial makes it simpler, by allowing you to play around with models, data and samples yourself. At some points you may find that the steps the tutorial takes are evident and all too easy, but it is possible that after a few steps, as simple as they are, you may nonetheless feel confused enough to make you want to retrace your steps and be happy, the second time around, that they are that simple. Or not, in which case you will just have an easy journey to a deep understanding why the Price equation is not what some say it is.&lt;br /&gt;
&lt;br /&gt;
==Price 1.0: A very simple model ==&lt;br /&gt;
We will begin with the simplest real model that we can think of. No sex, no shrinking or expanding populations, no frequency dependence, no&lt;br /&gt;
complications whatsoever. Just two individuals that are ready to reproduce. Asexually. This gives us a version of the Price equation that is even&lt;br /&gt;
simpler than the first version by Price himself. And it will give us probability theory and statistics that is relatively nice and easy too, and therefore an excellent start that helps us get acquainted to the joys of rigour and precision.&lt;br /&gt;
&lt;br /&gt;
[[Price 1.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 1.0 Applet | Go straight to the software]]&lt;br /&gt;
&lt;br /&gt;
== Price 2.0: A model with sexual reproduction ==&lt;br /&gt;
&lt;br /&gt;
If we add sexual reproduction, everything gets slightly more complicated, the proper statistics as well as the Price equation. This makes&lt;br /&gt;
the statistics much more fun, and it makes the failure of the Price equation to be of any help even more salient. We like to keep it relatively simple though, so for the moment we do not assume actual different sexes, but we do assume that every individual is diploid&lt;br /&gt;
&lt;br /&gt;
[[Price 2.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 2.0 Applet | Go straight to the software]]&lt;br /&gt;
&lt;br /&gt;
== Price 3.0: A model with frequency dependence ==&lt;br /&gt;
&lt;br /&gt;
We go back to the asexual model, but now we will take a model with frequency dependence. This will be a bit more complicated, but we can still use a basic, well known model. They are paired randomly, and play a game in those pairs. The game gives them payoffs according to a payoff matrix&lt;br /&gt;
&lt;br /&gt;
[[Price 3.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 3.0 Applet | Go straight to the software]]&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 10:28:15 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price</comments>		</item>
		<item>
			<title>Price</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Price</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Price equation]]&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Evolution is all about transitions. One generation gives birth to the next, which gives birth to yet another generation, in an endless chain of transitions. These transitions don't just go anywhere; some transitions are more likely than others. First of all we beget offspring that is likely to bear some similarity with ourselves.  And how likely we are to get offspring at all, and how many, tends to depend on certain heritable characteristics. The relative likelihood of some transitions and the relative improbability of others imply that we can make informed guesses as to where this endless chain of transitions came from and where it is going. That is what the science of evolution does.&lt;br /&gt;
&lt;br /&gt;
The Price equation zooms in on transitions from one generation to the next. This suggests that it could be a fundamental tool for understanding this&lt;br /&gt;
process of evolution. It was formulated by George Richard Price in 1970 [http://www.nature.com/nature/journal/v227/n5257/abs/227520a0.html in an article in Nature], and acclaimed by some, maybe even quite a few researchers, to be a fundamental ingredient for models of evolution (link Gardner, Frank, Grafen). We think not. We think it is an unintended hoax. The reason why it is hard to identify it as such is that it is all about probability theory and statistics, and those two topics are just not that easy. The following tutorial will help by looking at what proper probability theory or statistics would do and compare that to what the Price equation does to numbers that represent those transitions. There is [http://dx.doi.org/10.1016/j.jtbi.2005.04.026 an article with the same message], but this tutorial makes it simpler, by allowing you to play around with models, data and samples yourself. At some points you may find that the steps the tutorial takes are evident and all too easy, but it is possible that after a few steps, as simple as they are, you may nonetheless feel confused enough to make you want to retrace your steps and be happy, the second time around, that they are that simple. Or not, in which case you will just have an easy journey to a deep understanding why the Price equation is not what some say it is. Enjoy!&lt;br /&gt;
&lt;br /&gt;
==Price 1.0: A very simple model ==&lt;br /&gt;
We will begin with the simplest real model that we can think of. No sex, no shrinking or expanding populations, no frequency dependence, no&lt;br /&gt;
complications whatsoever. Just two individuals that are ready to reproduce. Asexually. This gives us a version of the Price equation that is even&lt;br /&gt;
simpler than the first version by Price himself. And it will give us probability theory and statistics that is relatively nice and easy too, and therefore an excellent start that helps us get acquainted to the joys of rigour and precision.&lt;br /&gt;
&lt;br /&gt;
[[Price 1.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 1.0 Applet | Go straight to the software]]&lt;br /&gt;
&lt;br /&gt;
== Price 2.0: A model with sexual reproduction ==&lt;br /&gt;
&lt;br /&gt;
If we add sexual reproduction, everything gets slightly more complicated, the proper statistics as well as the Price equation. This makes&lt;br /&gt;
the statistics much more fun, and it makes the failure of the Price equation to be of any help even more salient. We like to keep it relatively simple though, so for the moment we do not assume actual different sexes, but we do assume that every individual is diploid&lt;br /&gt;
&lt;br /&gt;
[[Price 2.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 2.0 Applet | Go straight to the software]]&lt;br /&gt;
&lt;br /&gt;
== Price 3.0: A model with frequency dependence ==&lt;br /&gt;
&lt;br /&gt;
We go back to the asexual model, but now we will take a model with frequency dependence. This will be a bit more complicated, but we can still use a basic, well known model. They are paired randomly, and play a game in those pairs. The game gives them payoffs according to a payoff matrix&lt;br /&gt;
&lt;br /&gt;
[[Price 3.0 | Go to the Tutorial ]]&lt;br /&gt;
&lt;br /&gt;
[[Price 3.0 Applet | Go straight to the software]]&lt;/div&gt;</description>
			<pubDate>Mon, 20 Sep 2010 10:26:27 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Price</comments>		</item>
		<item>
			<title>Main Page</title>
			<link>http://evolutionandgames.nl/wiki/index.php?title=Main_Page</link>
			<description>&lt;p&gt;Matthijs.van.veelen:&amp;#32;/* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction == &lt;br /&gt;
This wiki is mantained by Julian Garcia and Matthijs van Veelen.&lt;br /&gt;
We study &amp;lt;math&amp;gt;\sum{i=0}{n}\alpha^2+\beta^2=1&amp;lt;/math&amp;gt; the evolution of helping behavior using mathematical and computational models.&lt;br /&gt;
&lt;br /&gt;
== Papers, Tutorials and Software == &lt;br /&gt;
&lt;br /&gt;
* '''[[Repeated Games| In and Out of Equilibrium: Evolution in Repeated Games with Discounting]]'''.&lt;br /&gt;
&lt;br /&gt;
* '''[[Sociality|It takes grouping and cooperation to get sociality]]'''.&lt;br /&gt;
&lt;br /&gt;
* '''[[Parochialism|Evolution of Parochial Behavior by Multilevel Selection]]''' (under construction).&lt;br /&gt;
&lt;br /&gt;
* '''[[Repeated Games and Population Structure|Repeated Games and Population Structure]]''' (under construction).&lt;br /&gt;
&lt;br /&gt;
''more to come...''&lt;br /&gt;
&lt;br /&gt;
== What do I need in my computer ==&lt;br /&gt;
&lt;br /&gt;
The software is written in Java 5.0. See [[How to use the software]] for more details.&lt;br /&gt;
&lt;br /&gt;
== Contact us == &lt;br /&gt;
&lt;br /&gt;
'''Julián García''' - j ''dot'' garcia ''at'' feweb ''dot'' vu ''dot'' nl&lt;br /&gt;
&lt;br /&gt;
'''Matthijs van Veelen''' - c ''dot'' m ''dot'' vanveelen ''at'' uva ''dot'' nl&lt;/div&gt;</description>
			<pubDate>Tue, 20 Apr 2010 11:09:00 GMT</pubDate>			<dc:creator>Matthijs.van.veelen</dc:creator>			<comments>http://evolutionandgames.nl/wiki/index.php?title=Talk:Main_Page</comments>		</item>
	</channel>
</rss>