Wednesday 28 March 2012

Using R to compare FTSE 100 bank share price performance


Click picture for bigger image. I think R Function of the Day is a great blog for people learning R and I wanted to use the stockPortfolio package to compare share price performance. In particular I wanted to see how the Chancellor is protecting our public investments in RBS and Lloyds especially compared to other banks in the FTSE 100. As it turns out the worst performaning banks are RBS and Lloyds since Mr Osborne took office are the one's he's nominally responsible for. Code below:

 
> require(stockPortfolio)
> ticker<-c("RBS.L","STAN.L","LLOY.L","HSBA.L", "BARC.L")
> returns<-getReturns(ticker, "week", start="2010-05-12") 
> plot(returns, main="FTSE 100 Bank share price performance since Osborne became Chancellor")

Sunday 4 March 2012

From Tweets to Polls

Sometimes a paper hits the spot. Previously I had been thinking about how accurate twitter sentiment analysis actually is, especially how does it compare to traditional polling? So what should I find but this excellent paper spot on the same subject. The answer it appears is not too bad but we're talking complement to rather than replacement of traditional polling.

From Tweets to Polls: Linking Text Sentiment to Public Opinion Time Series  by Brendan O’Connor, Ramnath Balasubramanyan, Bryan R. Routledge, Noah A. Smith

Abstract
We connect measures of public opinion measured from polls with sentiment measured from text. We analyze several surveys on consumer confidence and political opinion over the 2008 to 2009 period, and find they correlate to sentiment word frequencies in contemporaneous Twitter messages. While our results vary across datasets, in several cases the correlations are as high as 80%, and capture important large-scale trends. The results highlight the potential of text streams as a substitute
and supplement for traditional polling.


Link to pdf