May has not been a great month for Donald. He is perhaps learning that the way he behaved in business is not acceptable in the office of POTUS. There is a possible suggestion that he interfered in the Russia link investigation. Getting rid of Comey may have lifted some pressure in the short term but it may create new problems for him over the summer.
The word cloud was generated from Trump's personal Twitter account for May. Everything was 'great' ... or at least that's the message Donald is trying to get out. Compare word clouds for March and April here.
The math behind Markov Chains can be intimidating but the basic idea is not. Imagine we have a system with two or more states. At a given time it is possible that the system will change from being in state A to being in state B or remaining in state A. For example a sleeping baby may continue to sleep or may wake up. There is a probability associated with each transition, in the diagram below there is a probability of 0.8 that when the system is in state A it will change to state B and a probability of 0.2 that it will remain in state A. And when in state B there is a probability of 0.3 that it will remain in B and 0.7 that it will return to state A.
Markov chains can be used to take words or n-grams and build tweets. Given a dataset of actual tweets the code starts with a word or n-gram chooses the most probable word or n-gram to follow and continues. The following code will generate some Trump-like tweets. Most of the tweets will not make sense because they are just semi-random collections of words and phrases.
import pandas as pd
with open('trumptweets.txt') as ip_file:
text = ip_file.read()
text_model = markovify.Text(text, state_size=2)
for i in range(5):
I used a dataset of Trump tweets available on Kaggle and combined it with some up to date tweets I scraped from his Twitter account. Some example output:
Give Trump lemons and he thanks me!
Disgrace I spoke with other countries where we just had the worst performing stocks on the cover.
No one has worse judgement than Hillary has bad judgement.
#ICYMI- watch this afternoons rally here:_ Thank you for coming!
If we define 'most interesting' as the person who got the most searches on Google from within Northern Ireland then the local politicians may be surprised/worried to learn that none of them make it into the top five. On May 10, 2017 the ranking was:
1. Jeremy Corbyn
2. Theresa May
3. Paul Nuttal
4. Tim Farron
5. Nicola Sturgeon
Three of the above politicians are leaders of parties that don't even organise in Northern Ireland.
A week ago the list was a little more encouraging for two of the local parties:
1. Theresa May
2. Jeremy Corbyn
3. Tim Farron
4. Arlene Foster
5. Gerry Adams
Sentiment analysis is difficult. I gave the following app some phrases to analyse, the results were not bad but not perfect.
phrase result comment
not a bad movie negative this is not a negative comment
the best use for this book would be as toilet paper positive this is definitely not positive
an excellent book positive good
this book is crap negative good
could be better negative good
this movie is a waste of money negative good
neither good nor bad negative I disagree, should be neutral
One of the early visible effects of Brexit was the drop in value of Sterling, see this post. More recently though the value of the pound has shown some modest recovery.
The break in the line graph around the end of Feb. is due to data missing from the dataset. The rise looks strong, but the following graph puts the modest rise in perspective.
The dataset is available on Github.
If the yellowstone super volcano erupted it would send an umbrella cloud high into the atmosphere and an area up to 500 miles in diameter would be covered by up to 4 inches of dust. Much of the mid west would be impacted. Sulphur dioxide would also be released in large quantities causing acid rain and a rapid cooling of surface temperature across the planet.
The dataset includes answers to the question: How familiar are you with the Yellowstone Supervolcano?
Yesterday Sinn Fein announced their candidate for N. Belfast, BBC story. It was a clever choice and will probably win them more votes. This is another seat where the SDLP have been in terminal decline for more than a decade but just refuse to die.
This means the nationalist vote is split just enough to ensure the DUP hold this seat. The unionist vote will be round 46% to 47%, the nationalist vote about the same. The unionist and nationalist votes have been converging for a while, I think this will continue or the nationalist vote will be slightly higher than the unionist. But the unionist vote is not split so they will win. The Alliance party have also increased their vote here but remain well behind the two main tribes.
There is nothing new about global warming deniers. In the 19th century a growing number of scientists accepted the evidence that carbon dioxide in the atmosphere could act like a green house - trapping heat. However there were other scientists who denied the evidence. By the twentieth century the deniers were in the minority. The following dataset from NOAA has several decades worth of carbon dioxide measurements. The increase is clear to see.
During this time we have seen new record high temperatures, bigger storms, melting ice and rising sea levels.
But despite the evidence Trump is a denier, his priorities are the economy and jobs and he believes it is better for the U.S. to invest in old finite fuel sources like coal rather than investing in limitless new technologies. It is possible that while other countries solve their energy needs with new technologies and innovation the U.S. will still be sending men down holes in the ground to dig out dirty black coal. The following tweet from Donald makes his attitude clear.
Prior to this he had blamed it all on the Chinese.
The Chinese certainly did their part in contributing to the increased carbon dioxide levels but it is not a hoax manufactured by them.