*Presidential Probit Model*work as a working paper that is available from the Social Science Research Network.

# Towards Non-Linear Models on Quantized Data: A Support Vector Machine for the Presidential Election Data

August 03, 2010 23:55To finalize our analysis of the Presidential election data, I will quickly compare the usage of a *Support Vector Machine*, which is a modern classification engine based on research by *Vapnik et al.*, with that of the *probit model*. The *SVM* is implemented in several packages for *R*; in the following we will use that from the *kernlab* package. The code fragments below illustrate how to compute the *probit* and *SVM* models on our data.

pmodel<-glm(PRES~HEIGHT+CHANGE,family=binomial(link='probit'),data=presdata)

presdata$PROBIT<-predict(pmodel,type='response')

library(kernlab)

kmodel<-ksvm(PRES~HEIGHT+CHANGE,type='C-svc',data=presdata)

presdata$SVM<-predict(kmodel)

The table below illustrates the output of both models:

YEAR | PROBIT | SVM | PRES |

1896 | 0.15 | 0 | 1 |

1900 | 0.60 | 1 | 1 |

1904 | 0.24 | 0 | 1 |

1908 | 0.69 | 1 | 1 |

1912 | 0.34 | 0 | 0 |

1916 | 0.45 | 0 | 0 |

1920 | 1.00 | 1 | 1 |

1924 | 0.71 | 1 | 1 |

1928 | 0.74 | 1 | 1 |

1932 | 0.15 | 0 | 0 |

1936 | 0.03 | 0 | 0 |

1940 | 0.80 | 1 | 0 |

1944 | 0.25 | 0 | 0 |

1948 | 0.80 | 1 | 0 |

1952 | 0.90 | 1 | 1 |

1956 | 0.90 | 1 | 1 |

1960 | 0.39 | 0 | 0 |

1964 | 0.15 | 0 | 0 |

1968 | 0.90 | 1 | 1 |

1972 | 0.84 | 1 | 1 |

1976 | 0.34 | 0 | 0 |

1980 | 0.83 | 1 | 1 |

1984 | 0.96 | 1 | 1 |

1988 | 0.96 | 1 | 1 |

1992 | 0.45 | 0 | 0 |

1996 | 0.24 | 0 | 0 |

2000 | 0.80 | 1 | 1 |

2004 | 0.48 | 0 | 1 |

2008 | 0.02 | 0 | 0 |

We see from the above table that the *SVM* is categorizing the data quite accurately, but it can tell us nothing about the *likelihood* of a particular outcome — because that is not what it has been asked to do. We also built our *SVM* using the parameter set indicated by our *probit analysis*, because that system gave us tools to investigate those choices. However, the *SVM* did accomplish something that we only *implicitly* asked of the *probit analysis*, which is to classify the data. Although the *probit* probabilities are useful *out-of-sample* in a *Bayesian sense*, *in-sample* they do not help us quantify the success of the method — we have to *overlay* an *ad hoc* classification scheme to permit that interpretation.

# Towards Non-Linear Models on Quantized Data: A Probit Analysis of Presidential Elections Part II

August 03, 2010 15:55To finish off our “toy” example of using *Discrete Dependent Variables* analysis, following on from the discussion of our data, we will use the *probit* link function and the NY Times data to test each of our variables for inclusing in a model forecasting the probability to a Republican President. The predictors are:

*height*difference (Republican candidate height in feet minus Democrat candidate height in feet);*weight*difference (Republican candidate weight in pounds minus Democrate candidate weight in pounds);*incumbency*i.e. the prior value of the Presidential Party state variable; and,*change*i.e. the value of the Presidential Party state variable at two lags.

I am going to perform this analysis in *RATS*, but to continue from the prior post I will also illustrate the command used in *R* to fit such models.

summary(glm(PRES ~ HEIGHT + WEIGHT + INCUMBENCY + CHANGE,

family=binomial(link="probit"), data=presdata))

The results are:

Variable | Likelihood Ratio | ParameterEstimate | |||

λ | α | ||||

HEIGHT | 6.422 | 0.01127461 | 3.1360 | ± | 1.4517 |

HEIGHT+WEIGHT | 0.487 | 0.48538310 | 2.6919 | ± | 1.6049 |

HEIGHT+INCUMBENCY | 0.761 | 0.38315424 | 3.0773 | ± | 1.4722 |

HEIGHT+CHANGE | 5.273 | 0.02165453 | 3.6310 | ± | 1.5546 |

This analysis performed on all data up to and including 2004 — replicating the original *out-of-sample* nature of the 2008 election. With over 98% confidence we reject the null hypothesis and add the *HEIGHT* variable to the model. We then test the remaining variables and will over 97% confidence add *CHANGE* to the model including *HEIGHT*.

The above chart illustrates the implied probabilities extracted from the estimated model. (The shading illustrates the actual party selection.) Out of sample, this exhibits a very strong prediction that President Barack Obama would have been elected and, given the unknown stature of his coming opponent, a marginal probability favouring his relection. Finally, after entertaining ourselves with this “toy” model, we will return to applying this methodology to market data in a coming post.

# Towards Non-Linear Models on Quantized Data: A Probit Analysis of Presidential Elections Part I

August 02, 2010 09:00This post is concerned with an analytical method that could be thought of as a half-way house between the standard linear models that work at lower frequencies and the non-linear models that we are hypothesizing are necessary to deal with highly quantized high frequency data. In common with our prior post, on computing bias in Presidential approval rating opinion polling, it is also using a *political* not *financial* data set. However, that merely changes the *meaning* of the analysis and not the *method* of analysis. (It actually represents a piece of work I did prior to the recent Presidential election, which happened to use this method, so I thought I'd include it here as it is entertaining.)

What I'm discussing are methods to deal with what are now known as *discrete dependent variables* in statistics. To my knowledge this methodology was pioneered by Chester Bliss in his analysis on the *Probability of Insect Toxicity* or *Probit Models*. Faced with a binary outcome (either the insects die, or they don't), a standard linear regression was unsuitable for estimating this quantity. Instead, Bliss decided to estimate the probability of the outcome via what we now call a *link function*.

Here Φ is the c.d.f. for the Normal (or other suitable) distribution. We note that this formalism is identical to that of the *Perceptron* in which the discriminant output of the system is a *sigmoid* (i.e. “S” shaped) function of an linear function of the data. However, unlike a typical *Neural Net*, which generally just describes a functional relationship of some kind, we have a specific probabilistic interpretation of the output of our system. Thus we can adopt the entire toolkit developed for maximum likelihood analysis to this problem. Specifically, if our models do not involve degenerate specifications, we can use the maximum likelihood ratio test to evaluate the utility of various composite hypotheses.

At this point I'm going to describe our data briefly, and then present our analysis in a later post. The data comes from the 6th. October, 2008, edition of the *New York Times*. Specifically an article entitled *The Measure of a President* (the currently linked to document contains corrections printed the next day). I have tabulated this data and it is available from this website. I have also included the outcome of the 2008 election, which was unknown at the the time the article was printed (and when my analysis was orignally done). You can download it and read it the analysis programme of your choice. For example, the following will load the data directly into *R and then create the needed auxiliary variables*.

presdata<-

read.table("http://www.gillerinvestments.com/Downloader/Files/Election.txt",

skip=6,col.names=c("YEAR","D_FT","D_IN","D_LB","R_FT","R_IN","R_LB","PRES"))

presdata$D_HT<-presdata$D_FT+presdata$D_IN/12.

presdata$R_HT<-presdata$R_FT+presdata$R_IN/12.

presdata$HEIGHT<-presdata$R_HT-presdata$D_HT

presdata$WEIGHT<-presdata$R_LB-presdata$D_LB

presdata$INCUMBENCY<-c(0,presdata$PRES[1:(length(presdata$PRES)-1)])

presdata$CHANGE<-c(1,0,presdata$PRES[1:(length(presdata$PRES)-2)])

This data presents the heights and weights of Presidential candidates since 1896, together with the binary outcome (“0” for a Democrat and “1” for a Republican — and this data is organized **alphabetically** not by any kind of *hidden preference*). The light hearted goal of the article was to investigate whether the public prefers the *lighter, taller* candidate over the *shorter, heavier* alternate. We are going to augment this data by computing the *Body Mass Index*, to ask whether the data public preferred the “healthier” candidate and also the first two lags of the Presidential party indicator, which we will call *incumbency* and *change* respectively. We will therefore seek to estimate the probability of a Republican President from this data via *Probit Analysis*. Results to follow.

Powered by BlogEngine.NET 1.4.5.0

Theme by Mads Kristensen | Modified by Mooglegiant

## RecentComments

- Towards Non-Linear Models on Quantized Data: A Probit Analysis of Presidential Elections Part II (1)
- July 2009 Data for the Dynamic Trading Risk Factor (1)
- The VIX is Very Volatile! (5)
- The VIX is Very Volatile! (5)
- The VIX is Very Volatile! (5)
- A Poor Man's Hedge Fund --- Relative Returns Analysis (1)
- Update on the VIX-GARCH Spread (4)
- Update on the VIX-GARCH Spread (4)
- Update on the VIX-GARCH Spread (4)
- Autometric Part II --- How is the Compact Model Portfolio Doing? (2)

Comment RSSGraham wrote: Just a quick note. The purpose of this article is … [More]

Menswear wrote: Good job man [More]

Graham wrote: I forgot to point out that Generalized Error Distr… [More]

Graham wrote: The GARCH solver is using the Generalized Error Di… [More]

Soham Das wrote: However, the innovations show definite evidence fo… [More]

reg cleaning wrote: I really enjoyed your article and found it to be v… [More]

Soham Das wrote: What I am considering is, if we have a hypothetica… [More]

Graham wrote: Hi Soham, You can, in fact, predict the volati… [More]

Soham Das wrote: Hi Dr.Giller, Will it be plausible to ask, if the… [More]

Graham wrote: We're performing a linear regression of the portfo… [More]