Sunday, November 2, 2008

Computing State Correlations in Elections Using (Only) Prediction Markets

(The post below is largely based on the work of Nikolay. I am responsible for all the mistakes.)

One thing that always puzzled me was how to compute correlations across electoral results in the state level. In 2006, there was some discussion about the accuracy of the prediction markets in predicting the outcome of the senate races. From the Computational Complexity blog:

For example, the markets gave a probability of winning 60% for each of Virginia and Missouri and the democrats needed both to take the senate. If these races were independent events, the probability that the democrats take both is 36% or a 64% chance of GOP senate control assuming no other surprises.
However, everyone will agree that races across states are not independent events. For example, if Obama wins Georgia (currently trading at 0.36), the probability of winning Ohio will be higher than 0.70, the current price of the Ohio.DEM contract. (As we will see later in the post, the price of Ohio, given that Democrats win Georgia, is close to 0.81.)

So, what we would like to estimate is, for two states A and B, what is the probability $Pr\{A|B\}$ that a candidate wins state $A$, given that the candidate won state $B$.

One way to model these dependencies is to run conditional prediction markets but this leads to an explosion of possible contracts. Participation and liquidity is not great even in the current markets for state-level elections, there is little hope that combinatorial markets will attract significant interest.

Another way to compute these probabilities is to use and expand the model described in my previous post about modeling volatility in prediction markets. Let's see how to do that.

Expressing Conditional Contracts using Ability Processes

Following this model, for each state we have a "ability difference processes" $S(t)$ that tracks the difference in abilities of the two candidates. If at expiration time $T$, $S(T)$ is positive, the candidate wins the state; otherwise the candidate loses. So, we can write:

$$Pr\{A|B\} = Pr\{ S_A(T) \geq 0 | S_B(T) \geq 0 F(t) \}$$

where $F(t)$ is the information available at time $t$. Using Bayes rule:

$Pr\{A|B\} = \frac{Pr\{ S_A(T)\geq 0, S_B(T)\geq 0 | F(t) \}}{Pr\{ S_B(T)\geq 0 | F(t) \}}$


In the equation above, $Pr\{ S_B(T)\geq 0 | F(t) \}$ is simply the price of the contract for state $B$ at time $t$, i.e., $\pi_B(t)$.

Pricing Joint Contracts using Ito Diffusions

The challenging term is the price of the joint contract $Pr\{ S_A(T)\geq 0, S_B(T)\geq 0 | F(t) \}$.

To price this contract, we generalize the Brownian motion model, and we assume that the joint movement of $S_A(t)$ and $S_B(t)$ is a 2d Brownian motion. Of course, we do not want the 2d motion to be independent! Since the $S_A(t)$ and $S_B(t)$ represent the abilities, they are correlated! So, we assume that the two Brownian motions have some (unknown) correlation $\rho$. Intuitively, if they are perfectly correlated, when $S_A(t)$ goes up, then $S_B(t)$ goes up by the same amount. If they are not correlated, the movement of $S_A$ does not give any information about the movement of $S_B$, and in this case $Pr\{A|B\} = Pr\{A\}$

Without going into much details, in this model the price of the joint contract is:

$\pi_{AB}(t) = Pr\{ S_A(T)>0, S_B(T)>0 | F(t) \} = N_\rho ( N^{-1}(\pi_A(t)), N^{-1}(\pi_B(t)) )$

where $N_\rho$ is the CDF of the standard bivariate normal distribution with correlation $\rho$ and $N^{-1}$ is the inverse CDF of the standard normal. Intuitively, this is nothing more than the generalization of the result that we presented in the previous post.

However, the big question remains: How do we compute the value $\rho$?

Now the neat part: We can infer $\rho$ by observing the past time series of the two state-level contracts. Why is that?

First of all, we know that the price changes of the contracts are given by:

$d\pi(t) = V(\pi(t), t) dW$, which gives $dW = \frac{d\pi(t)}{ V( \pi(t), t)} $,

We can observe $d\pi(t)$ over time. We also know that $V( \pi(t), t) = \frac{1}{\sqrt{T-t}} \cdot \varphi( N^{-1}( \pi(t) ) )$ is the instantaneous volatility of the a contract trading at price $\pi(t)$ at time $t$.

So essentially we take the price differences over time and we normalize them by the expected volatility. This process generates the "normalized" changes in abilities, over time and across states.

Therefore, we can now use standard correlation measures of time series to infer the hidden correlation of the ability processes. (And then compute the conditional probability.) If the two ability processes were powered by independent Brownian motions $W_A$ and $W_B$, then $dW_A$ and $dW_B$ would not exhibit any correlation. If the two processes are correlated, then we can measure their cross-correlation by observing their past behavior.

Now, by definition of cross-correlation we get:

$\rho \approx \Sigma_{i=o}^t \frac{ (\pi_A(i+1) - \pi_A(i)) \cdot (\pi_B(i+1) - \pi_B(i)) }{ V(\pi_A(i), i) \cdot V(\pi_B(i), i) }$

Conditional Probabilities using InTrade

OK, if you stayed with me so long, here are some of the strong correlations as observed and computed based on the InTrade data. How to read the table? If Democrats win state B, what is the probability Pr(A|B) that they will also win state A? To make comparisons easy, we also list the current price of the contracts A and B. The "lift" shows how much the conditional probability increases compared to the base probability. I skipped the cases when a state has very high probability, i.e., above 0.9 (as they are either uninformative) or very low probability, i.e., less than 0.2 (as they are highly unlikely to happen). I also list only state pairs with lift larger than 1.10. You can also get the list as an Excel spreadsheet.




Enjoy!

10 comments:

Alexey Loganchuk said...

Nifty! Also, i love how intuitive this approach is.

Have you tried doing basic PCA analysis on the whole historical data set? I'm just thinking, there are most likely some larger themes that would emerge.

Something like 'redneckness' (regress against some statistic about education), 'concern about economy' (against consumer confidence as far back as that goes), etc...

Bob Carpenter said...

While all this physics stuff sounds fun, you might also want to check out Andrew Gelman's and Jennifer Hill's more traditional (Bayesian) stats book Data Analysis Using Regression and Multilevel/Hierarchical Models. They discuss multilevel regression models of elections including individual effects for income and religion that are pooled by state. They specifically discuss accounting for correlations with random effects in multilevel models when the raw data's over-dispersed with respect to a model assuming independence.

Andrew and crew also have a more pop-oriented book that's all about American elections, called Red State, Blue State, Rich State, Poor State.

In terms of PCA, you see that a whole lot in analyses of voting, with matrices being simple voter vs. issue plus votes. There's often lots of missing data here. A really nice jumping off point is Aleks Jakulin's data mining in politics page, which includes examples of PCA among other factorization and clustering techniques.

nicka81 said...

Using Hierarchical Bayesian models for elections is a nice suggestion, how I believe it misses the main point of this post. If prediction markets are indeed efficient information aggregation mechanisms then all relevant information on individual state effects of income, religion, 'redneckness' etc. should be incorporated in prices. Ideally, by just observing contemporaneous variations in prices of all contracts, one should be able to identify all latent relationships relevant to conditional events. As our output shows, there is no need to know, for example, that Tennessee and Arkansas are geographically close or have similar demographics to identify that winning one state significantly increases the probability of winning another one. Of course, if the goal is to identify WHY it is so (whether it's similar income levels? or religion? or something else?), one has to incorporate appropriate variables into the model and in this case something like a random coefficients model or HB is the right tool.

nicka81 said...

Alexey, I'd love to do PCA on historical time series, only I don't know how to do this properly :). One should always be suspicious about using machine learning algorithms on financial data as it is never clear what is really learned. Even if we consider series of price differences, there is still significant autocorrelation effects due to "volatility clustering" in the data. I'm not sure if PCA will not be tricked by this. If you can give us any good references on using PCA for time series data, we would greatly appreciate that.

Panos Ipeirotis said...

@Bob: The basic idea is that you can discover correlation by observing only the behavior of the markets, without knowing any of the demographics, past history behavior, and so on.

For example, I wanted to replicate the Monte-Carlo simulations of fivethirtyeight.com but I do not have the data that they are using to compute the correlations. Using just the past movements of the state-level prediction markets, I can get the belief of the traders about the level of correlation between the states.

Vasilis V. said...

On a somewhat related note: I read an article about betting in presidantial (and presumably other) elections recently.

If such gambling is currently outlawed, how/why are prediction markets on elections allowed?

This is not a tongue in cheek question, btw.

nicka81 said...

Prediction market that we analyzed (InTrade) is physically located in Dublin and so is not subject to U.S. gambling laws. U.S. based prediction markets either have to operate with
"play money" or introduce other kinds of restrictions (like Iowa Political markets that use real money but limit traders' position to 500$).

Panos Ipeirotis said...

@Vassilis: Yes, as Nikolay mentioned we analyzed contracts from Intrade, a company based on Ireland. In the US only the Iowa markets are allowed to use real money for electoral contracts, the rest are using play money.

Anonymous said...

Forgive me but I got lost in following the probability above.

Is this post showing that movements of Prediction markets can be predicted to some extent, thus showing that they are inefficient?

Thanks in advance for the clarification.

Panos Ipeirotis said...

@Anonymous: No, this is not a claim for inefficiency (in fact, the described technique assumes efficiency).

What the technique allows, is the pricing of joint and conditional contracts given only the base contracts. In other words: given the two separate contracts for Ohio and Florida, what should be the price for an additional contract "winning both Ohio and Florida"?

Until now, we relied on having additional contracts to estimate such probabilities. (Or assumed that the two events are independent.) This technique shows how to price such joint contracts, even in the absence of independence.

Post a Comment