Presidential Probit: Waiting for the NBA Candidate

by Graham Giller February 25, 2012 22:40

If, as we seem to have discovered, the U.S. electorate prefers to elect the taller candidate, and this has been going on for at least the 120 years for which we have data, then it seems wholly reasonable that this information is fully known to candidates. This observation leads us to expect that there should be an upwards trend in candidate height very much as there has been an upward trend in the height of professional basketball players.

Trend in Height of Candidates for President

Above we have plotted all the candidates heights and a best fit regression line. This line is the result of a panel data analysis with individual effects and has a gradient of 0.0022 ± 0.0064 feet/year. The regression has an F statistic of 7.4 with 2 and 56 degrees of freedom and a p-Value of 0.001. Thus we can reject the hypothesis that there is no trend with over 99.9% confidence — the trend is clear to see in the figure.

I imagine the sporting career of an NBANBA player is brief. This data suggests that they should retire to national politics!

 

Presidential Probit Model: A Working Paper

by Graham Giller February 23, 2012 18:30
I wrote up the Presidential Probit Model work as a working paper that is available from the Social Science Research Network.  

Presidential Probit Model: A Bootstrap Simulation of Forecasting Skill

by Graham Giller February 22, 2012 16:11

Our presidential probit model, which describes success based on the appeal of tall candidates and a desire for change after two full terms, has an in-sample forecasting skill of 54%. To get a grip on the error on that measurement, I ran 10,000 bootstrap simulations of the process. The chart below suggests that the skill uncertainty is ±19% so this significance is at the 2.8σ level.

Bootstrap Simulation of Presidential Probit Model

 

Presidential Probit Model: Evaluating the Current Republican Candidates

by Graham Giller February 21, 2012 22:24

Previously on this blog I analysed the New York Times' presidential height and weight data. We built a probit model and found that the height difference and change variable (meaning the opposite of the outcome of the election two cycles ago), were significant. Neither weight difference or incumbency variable (meaning the outcome of the election one cycle ago) were significant. The full model is:

Prob(Republican Win) = Φ(constant+dHeight+change).

Here Φ(·) is the generalized linear model transfer function, which is the cumulative normal distribution for a probit model.

Taking the candidates heights from the internet we find (Barack Obama is 6'1.5" tall):

Newt Gingrich is 6' tall, Prob(Gingrich|Obama) = 16%

Mitt Romney is 6'1" tall, Prob(Romney|Obama) =  29%

Rick Santorum is 6'4" tall, Prob(Santorum|Obama) = 76%

If this model is a good predictor, then the Republicans should run Rick Santorum against Barack Obama for President of the USA.

You can find my RATS code to evaluate the probit model at Google Docs. Bear in mind that the purpose of this model is fun!

 

Asynchronous Tweet Queue from Java, Part II: The Queue

by Graham Giller February 17, 2012 21:03

The Tweet class described in the prior post has the defect of blocking on interaction across the wan with an internet service, twittertwitter, that does not guarantee that it can process your message within a negligible, or even with in a predictable, time. Frequently I code systems that have to guarantee a predictable and small response time and we can achieve that with twitter by dividing our task between two threads:

  1. the first thread stores your tweet in a queue and returns immediately;
  2. the second thread processes the queue, forwarding the tweets to twitter.
For this to work the average tweet rate cannot exceed the average total round trip time to process the tweets — otherwise the queue will back up. However, providing we do satistfy that constraint on average we can allow the response time to vary without impacting the thread doing the tweeting.

The TweetQueue class provides this multithreaded facility, which is incredibly easy to implement in Java.

To use the object we:

  1. Instantiate the object
    StatTrader.TweetQueue twitter = new StatTrader.TweetQueue(tokenKey,tokenSecret);
  2. Create a thread for the object
    Thread worker = new Thread(twitter);
  3. Start the thread
    worker.start();
  4. And use it
    twitter.Update("status");

That's it. I don't claim that this is original, but I find it useful so I thought I'd share.

 

Tags:

Asynchronous Tweet Queue from Java, Part I: Tweeting and OAuth

by Graham Giller February 16, 2012 12:30

I did an earlier experiment with twittertwitter, which you can read about at the SSRNSSRN.

That system used a very basic command line http client. For another reason I recently wrote a twitter client in JavaJava that implements an asynchronous queue manager so that the tweeting process does not block on the wan traffic and authenticates properly using OAUTHOAUTH. It uses the twitter4j library and wraps it even more to make just issuing tweets elementary.

You can access the first part, the Tweet class, here. This is what you have to do:

  1. Go to twitter and register an application. This generates a consumer key and secret.

  2. Generate a token and secret for your account by calling:
    twitter4j.auth.AccessToken at = StatTrader.Tweet.Generate(consumerKey,consumerSecret);
    Serialize(at);


  3. Instantiate a twitter object:
    twitter4j.auth.AccessToken at = Unserialize();
    StatTrader.Tweet twitter = new StatTrader.Tweet(at.getToken(),at.getTokenSecret());


  4. Tweet:
    twitter.Update("Status");

 

 

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen | Modified by Mooglegiant



RecentComments

Comment RSS

About the Author

Graham Giller - Headshot GRAHAM GILLER
Dr. Giller holds a doctorate from Oxford University in experimental elementary particle physics. His field of research was statistical astronomy using high energy cosmic rays. After leaving Oxford, he worked in the Process Driven Trading Group at Morgan Stanley, as a strategy researcher and portfolio manager. He then ran a CTA/CPO firm which concentrated on trading eurodollar futures using statistical models. From 2004, he has managed a private family investment office. In 2009, he joined a California based hedge fund startup, concentrating on high frequency alpha and volatility forecasting. My updated resume is on LinkedIn.

Pages


Disclaimer

Nothing on this site should be construed as a reccommendation to buy or sell any specific security nor as a solicitation of an order to buy or sell any specific security. Before making any trade for any reason you should consult your own financial advisor. The author may hold long or short positions in any of the securities discussed either before or after publication of an article mentioning such a security.

Copyright Notice

All post on this blog are © Copyright property of Giller Investments (New Jersey), LLC. All comments are the property of their respective authors and neither the author or this blog nor any entity associated with him are responsible for or accept any responsibility for their content. Offensive comments and spam may be removed at the authors discretion.

Data provided on this blog or through links to this blog are either property of Giller Investments (New Jersey), LLC or publicly available or derived from data that is publically available. Any data that is proprietary to Giller Investments (New Jersey), LLC is published here for the public interest and may be reproduced for private research or in public forums provided that suitable attribution and acknowledgement of ownership is made.

Privacy Policy

We use third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.