Archive for the ‘Uncategorized’ Category

FiveThirtyEight in conjunction with Facebook recently released a map of Facebook likes for presidential candidates by county.   It’s interesting data, and gives a relatively high resolution map of where candidate loyalties lie.  Although it’s clearly not a random sample of likely voters it can be used to fill in some of the gaps of traditional polling.

Here I attempt to use this data to get an idea of what the electoral college could look like under different candidate matchups.  The assumption I use is that the election will be a close race, with essentially 50% popular vote for each candidate.  Facebook likes are going to be a biased sample of the voting population, but we can adjust for some of that bias by looking only at the candidates performance in a state relative to their national average.  I assume each candidate remains popular in states they are already popular in, then assign each state to the candidate that has the strongest relative support in that state.

There is some danger of reading too much into this data. I’m under no pretenses that this will be a full prediction of how the states will vote on November 8th. The number of likes at this stage in the primary will not match fully with the number of votes in a general election eight months from now.   I expect the effect of partisan voters lining up behind their party’s nominee will make the final electoral map appear like an average of these maps and historical swing state maps.   So solidly Republican states like Alaska will likely ultimately remain red, even if Trump is unpopular there.  Additionally there are likely large biases still remaining in the data – for instance, if Hispanic voters are less likely to use Facebook, are these maps accurate for those states with large Hispanic populations?  Still I do believe there is a value in this data, in showing states and regions where a candidate will be surprisingly competitive. This can be seen as a rough prediction of tipping point states, which can be seen to vary dependent on the candidate matchup. I expect the political campaigns are looking at their own versions of similar maps as they chose where best to spend their resources.  Enjoy!

Sanders vs Trump


Click the map to create your own at 270toWin.com

Advantage Trump. This means Trump would win the electoral college if the popular vote were tied (which it may not be).  In a more lopsided election, the candidate with the higher popular vote would win.

This map is the most interesting because it shows a matchup between two very unconventional candidates. Trump is a political outsider and not consistantly a Republican, while Bernie spent his Senate career as an Independent. Both candidates appeal to voters outside of their traditional party bases. Trump’s main advantage geographically is his strong support in Democratic mid-Atlantic states. Trump is very weak in the West overall, allowing him to lose the traditional Republican strongholds of Alaska and Utah in this model. Unfortunately for Sanders many of these Western states he performs well in are not worth that many points. Bernie’s current weakness with black voters means he is not able to penetrate into the South to bring states like North Carolina and Virginia into play. Bernie performs well in states near Vermont, but loses some key high value states.  It may not be a coincidence that Trump does well in the casino and resort states of Nevada, New Jersey and Florida.

Sanders vs Cruz


Click the map to create your own at 270toWin.com

Advantage Cruz.

Cruz generally performs very well in traditional Republican states and the south, leaving the battle to be fought primarily in standard swing states. In all of the matchups I look at Republicans have the advantage in Florida, a key high-value swing state. Bernie’s lack of competitiveness in North Carolina and Virginia means he starts at a disadvantage in swing states.  Sanders holds the Northeast but is unable to pry away states in the midwest and loses some crucial swing states.

You’ll notice Montana is colored a lighter shade of blue. Since I’m relying not on the raw Facebook data, but on rounded data from the fivethirtyeight website, for some states it’s difficult to tell which candidate has the advantage. For that reason I don’t attempt to predict the margin of victory for each candidate. Montana is a state that appears to lean towards Bernie, but is within my margin of error so is colored a lighter shade. Candidates which have lower overall numbers of Facebook likes have a larger margin of error. Since Bernie and Trump are the most popular on Facebook, their map is the most accurate. I also generated a Clinton- Bush map, but the accuracy was too poor to predict states accurately due to Bush’s relative unpopularity on Facebook.

Sanders vs Rubio


Click the map to create your own at 270toWin.com

Advantage Sanders.

Republicans seem to be losing their grip on certain Western states, and Sanders is well positioned to take advantage of this.  Sanders comes out ahead due to strength along Rocky Mountain states and the NorthEast.  Marco Rubio’s support falls mainly in traditional Republican states in the South, with potential to secure states with large Hispanic populations like Arizona and Florida.  Rubio captures the south but doesn’t expand the map to put any traditional Democratic states on the table.

Clinton vs Trump


Click the map to create your own at 270toWin.com

Advantage Clinton.

This is a very close map.  Trump is actually more popular then Clinton in Bernie territory of New Hampshire and Maine. He also tends to do very strongly in mid-Atlantic states. Clinton served as senator in New York, and it appears this gives her the advantage necessary to keep Trump from stealing New Jersey. Clinton pulls out ahead in this scenario only by managing to win Texas.  For years there has been talk of Texas potentially becoming a swing state. This scenario shows Clinton actually contesting this large prize due to the difference in support between her and Trump in towns along the border.

Clinton vs Cruz


Click the map to create your own at 270toWin.com

Advantage Clinton.

This is the most conventional map. Each candidate represents the core of their party, with Clinton as the establishment Democratic candidate and Cruz as the self-appointed king of the Tea Party (the new Republican establishment). It is not surprising that the map follows traditional swing state boundaries, which I see as a vindication of this method. The only slight surprise here is Ted Cruz winning New Mexico. However there’s some possibility that New Mexico, with Hispanics making up 40% of the voting population, may not be modeled as well as other states by the Facebook data. While Ted Cruz solidly holds on to all areas of Republican territory, including the Western states that Trump and Rubio are weaker in, he fails to show much appeal outside these regions.  Cruz appears to have zero appeal in the Northeast and is generally outperformed by Clinton in most swing states.  Clinton wins by sticking to traditional Obama Democrat and swing states, staying competitive in Virginia.

Clinton vs Rubio


Click the map to create your own at 270toWin.com

Advantage Rubio.

This map is also fairly traditional, as an election between the two establishment party picks. Rubio does well in all traditional Republican states, and is able to deliver the South, while remaining competitive in traditional swing states. He is seen as winning New Mexico and keeping Clinton from making inroads into Virginia.  This is consistant with the perception that Rubio nullifies some of Clinton’s advantage among minority voters. Likewise, Clinton is able to hold the Northeast but not expand heavily into new territory in the West or win key swing states.  A slight bump is seen in Arkansas, home of the Clintons, but she is not anticipated to win the state.

General Conclusions

It would appear that Republicans have the electoral college advantage in North Carolina, Florida and Ohio this year, making a collection of smaller states crucial to determining the outcome of a close election.   For Clinton the path to victory is very similar to Obama’s 2012 path.   However if either Trump or Sanders are in the general election, the map changes considerably.  Trump’s areas of strength seem to be locations were his businesses have a presence.  The states where he received the most google searches between 2004 and 2014 match closely with the states he is shown as leading.

Advertisements

Neat things my Amiibo can do

Posted: January 12, 2015 in Uncategorized

I recently bought a Yoshi Amiibo for Super Smash Bros for Wii U. It’s a figurine with a chip inside of it that can be used to store a somewhat customizable computer character. I didn’t really expect much but it looked like a fun little toy. A Nintendo PR person had claimed that the toys would learn based on your play style, such that if you never played with items your Amiibo wouldn’t either. I suspected that it was mostly PR speak, and that the Yoshi would simply upgrade from a preset level 1 AI to a preset level 50 AI. It turns out there is some truth to it.

By the time my Yoshi reached level 50 it was winning most party matches. It particularly favored the egg throw technique. I used to play as Yoshi on the N64 so I decided to go one on one against it, Final Destination, no items. I narrowly beat it, but on subsequent matches I was unable to repeat the trick. It appeared my Yoshi was learning.

My personal play style involves a lot of aerial attacks. I noticed the Yoshi had become very skilled at throwing eggs, and was effectively countering my ability to approach him from the sky (especially since I was lousy at doing aerial dodges on the Wii U controller). I was only really able to get many hits in by remaining on the ground.

By switching to Jigglypuff and luring him off the edge of the stage I was able to teach him how to edge guard. At first he was hesitant to jump off the stage, but eventually he began chasing me and using his down A or down spike moves. He didn’t connect too often, but he learned to perform the attack and make it back to the stage with decent consistency. At any rate he was better at spiking off stage than I was. He also seemed to have perfected the art of protecting his landings by throwing eggs at the edge of the stage.

Since I was playing Jigglypuff anyways I tried training on some of her moves. Yoshi was definitely able to learn character-specific moves. When I used the lullaby he would flash his shield on and off to protect himself while minimizing the drain of the shield’s charge. He quickly learned to dodge when I activated Jigglypuff’s over-B punch, although this would sometimes leave him vulnerable to her Rest attack. Although I believe he was adapting I was still able to connect these two attacks with enough effort. Amusingly he never seemed to realize I was completely vulnerable while sleeping.

Next I tried training him with mines only. He almost immediately realized that he should jump over instead of walking on mines, but had difficulty avoiding them altogether. Extensive mine training left him still unable to avoid rolling, dodging or jumping into mines.    He was easily lured into mines and it appeared that this training was useful only for making myself feel better about my inability to beat him in a fair fight.

All of this time spent on Final Destination seemed to have confused him when he arrived at Hyrule Temple. His egg throws were not nearly as effective with impenetrable walls, and he kept erratically leaving the fight to seek out some seemingly arbitrary location on the battlefield. The level 9 computers sought each other out, but he was content wandering about the stage, resulting in a victory with around 30 out of 99 lives left.

It seemed to me that Yoshi’s technique in close quarters combat was rather weak so I started pitching him against heavy hitters on small stages.   Eventually he wound up on Final Destination in a 99 stock against Ganondorf.  He clearly learned to read Ganondorf’s moves and could duck or dodge out of range with ease.  He won, but didn’t dominate.

After the match I rechallenged him as Yoshi.   It was clear that such a long time fighting only Ganondorf had affected his ability to combat other opponents, and he’d probably gotten a little too familiar with the idiosyncrasies of the opposing AI.   It wasn’t clear what he was trying to do, but it wasn’t very effective.   Fighting Ganondorf had probably forced him into a more counter-based technique, and he wasn’t able to read my moves as easily.    I beat him with 2 of 5 lives remaining – unheard of.

After putting him in a quick melee against other computers, I tried fighting him again.  He seemed back to his old egg-throwing self.  He was even able to snatch me out of the air with his tongue while I was mid ground-pound.  Unfortunately he seemed to have largely forgotten his Jigglypuff training.  It seems the AI is quite adept at learning to master a specific combat niche but has limited memory and will gradually overwrite older training as it enters a new environment.

The solar industry has been booming in recent years, but solar energy still represents only a tiny fraction of the United State’s energy supply. As a new way of visualizing the installed capacity of solar and other renewable energies in the United States I decided to compare our total energy production by source with the total energy consumption of various countries.    Note that this is different from the electricity consumption by each country, but instead attempts to account for the total energy consumed from all sources.

One surprising finding was that we have enough wind turbine capacity to provide for all of the energy needs of a country the size of Portugal.    We also have enough total renewable energy production to bring the United Kingdom fully green.  Check below for the full results.

The data I used is from the US Energy Information Administration. The US production data is for the latest year 2011, while for consumption I had to rely on slightly older 2009 data, but the numbers should still be fairly accurate.

Total Energy Consumption by Country: International Energy Statistics – Total Energy

US Energy Production by Source: Monthly Energy Report (Table 1.2)

I thought one way to see what values and concepts are most important to each of the presidential candidates is to see what they talk about the most.
I’ve seen this done with individual speeches before, but I wanted to accumulate a collection of speeches across the course of the candidates’ campaigns to see which ideas keep coming up.

For President Obama, whitehouse.gov has a collection of every public statement he’s made during his years in office. It’s a massive amount of data, but I’d like to compile it all into a single word cloud. So far I’m through about 1 year’s worth.
Other candidates don’t have as complete of a record, so I’m focusing on simply collecting their full speeches off of various websites. Since most candidates have 10 or fewer full speeches available online, I’m avoiding interviews and Q&A for the Republican candidates to avoid biasing the results too much with the opinions of the reporters.

What you see for the Republican candidates then is an illustration of their political platform as shaped by themselves through their major campaign speeches. There are clear differences in the emphasis of the different candidates.

Obama’s word cloud, by contrast is not nearly as controlled, since it amasses every statement he’s made over the vast array of issues a president must deal with. This includes major speeches, welcoming of award winners, meetings with foreign heads of state, townhalls and press briefings. As a result, Obama’s cloud becomes more broad and vague. Individual issues such as Iran are drowned out by the core repeating values and principles of his presidency as well as certain speech mannerisms. It’s interesting to study, and the overall shape of the cloud is something much less easily manipulated than that seen by the other candidates. A cloud of his campaign speeches or state of the union addresses would probably be more similar to those of the Republican candidates, but this shows more where his true core focus lies.

Rick Santorum
Wordle: Rick Santorum Speeches
Newt Gingrich
Wordle: Newt Gingrich Speeches
Mitt Romney
Wordle: Mitt Romney's Speeches
Rick Perry
Wordle: Rick Perry Speeches
Ron Paul
Wordle: Ron Paul Speeches
John Huntsman
Wordle: John Huntsman Speeches
Herman Cain
Wordle: Herman Cain Speeches
Michelle Bachmann
Wordle: Michelle Bachmann Speeches
Obama
Wordle: Obama 2011 statements

Names

Posted: December 6, 2011 in Uncategorized

The current #1 baby names are Isabella and Jacob.  Surprise!  Although the name Isabella had been gaining in popularity for the past decade, it spiked in 2005 with the release of the first Twilight book, and again in 2008 with the movie adaptation.   Jacob, which had already peaked in popularity in 1998 saw a similar uptick in popularity.    Edward, which has traditionally been a more common name, was not greatly affected by the release of the popular vampire franchise.

Patterns in baby name trends are interesting to watch.   Most parents don’t choose to invent their own name, but chose an existing name which suites their modern taste.   At the same time, many seem to want a more unique name for their child, so pick a slightly exotic name that is not in too widespread of usage.   This results in interesting naming fads where a name which is perceived as rare will suddenly burst into popularity only to quickly fade out once it becomes too mainstream.    These names will probably not die out completely however, since people tend to borrow names for their children from respected others, either from history, pop culture, or people that they know personally.    The bible is always a good place to go digging for names, and fuels recent popular names like Noah, Elijah and Jonah.

Pop culture names are relatively easy to track, and popular characters with relatively unusual names can make a big impact on the baby naming consciousness.   The name Trinity appeared out of nowhere after the release of the 1999 film The Matrix.  Harry Potter star Emma Watson may have helped boost her name’s popularity in recent years.  Other characters may have helped extinguish certain decent names by being too strongly associated.  Kermit was essentially dead as a name for humans by 1980, and Zelda is too strongly associated with video games for anyone other than Robin Williams’ daughter.    Ursula lost all hope of a comeback with the release of “The Little Mermaid”, but the same film boosted the name Ariel and may have helped Sebastian into legitimacy.    Some names, like Stella, are able to get their groove back by building from an established aging population.   Others, like most names containing the letter “U” are simply out of tune with modern taste.   Since character names are chosen similarly to baby names, they sometimes serve merely to accelerate names that were already gaining in popularity.   The name Luke exploded at the time of the 1977 release of Star Wars.  It’s unclear which movie was responsible, but the name Angelina skyrocketed concurrently with Angelina Jolie’s Hollywood debut.   Actress Reese Witherspoon singlehandedly brought her name out of obscurity in 1999.  Mariah Carey did similarly with a strong debut album in 1990.  The frequency of the name Elvis spiked following the singer’s debut around 1955, and again with his death in 1977.  Kierah saw a bounce after Knightley’s roles in Bend it Like Bekham and Pirates of the Caribbean.   The name Miley was essentially created in 2006 by the popularity of the Hannah Montanna star.   Likewise Xander appeared due to Buffy the vampire slayer in 1997, but neither name became too widespread.  Some names aren’t so lucky.  The name Katrina probably isn’t coming back for a while, after it was finished off by the 2005 Hurricane.

What names may the future hold?   I’d guess Justin Bieber might give an uptick to the declining Justin, although male names seem less clearly affected by pop culture and his target audience may still be a little young to bear children.    Here’s a long shot: Isaiah, as in Isaiah “Old Spice Man” Mustafa.

Travel Observations

Posted: November 25, 2011 in Uncategorized

Went on a trip to Australia!   I left at noon on Friday and didn’t arrive until the next Tuesday morning.   That’s about 3 full days of

Hong Kong skyrises seen from the train

traveling to get to my destination which is kind of a lot now that I think about it.   I flew to Dallas and back, spent a night in LA  due to a Qantas labor dispute that developed while we were pulling onto the runway, and eventually wound up spending a day in Hong Kong.

It’s interesting winding up in a country without the slightest bit of knowledge about the location.    I had no idea where Hong-Kong was located in China or even which language was predominant there.    With a 12 hour layover, the plan was to get out of the airport, find some Dim Sum and maybe purchase some cheap electronics.    Being stuck hanging around airports with business travelers the past few days had given me some iPad and smartphone envy and it was becoming clear I would need some means of accessing the internet.   So I was ready to buy whatever sketchy Android or tablet I could find off of the street, but I wound up being pleasantly surprised by the service at the reputable Fortress Electronics retailer.    I’m not sure if particular smartphones are really any cheaper at Hong-Kong retail stores, but the unlocked phone market is more mature so they had a much wider selection of devices across the price range than the Best-Buy in Irvine.

City-building in Hong Kong seems to rely a lot on copy-paste.   It’s as if they were too cheap to pay an architect for multiple building

this photo from the WSJ shows a more extreme case

designs so they just reused the same one over and over.   Riding the train from the airport it’s not unusual at all to see clusters of six or so of the same giant highrise housing.   It makes for some ugly city design, but it gets a little better once you get downtown where the real skyscrapers are.    It’s the world’s most vertical city, and sometimes looks absurd on the outskirts since there are very few supporting smaller buildings.    The look reminds me a bit of Limbo from Inception.    Wikipedia thinks Hong-Kong has one of the best skylines- maybe I should change this.

Speaking of being cheap, Hong Kong’s financial district is probably one of the best places in the world to change money, US to HKD was exchanged 7.7 one way and 7.8 the other way with no exchange fees (one place undercut to 7.79).   That’s pretty cut-throat!

Opera house as seen from botanical garden outlook

And speaking of architecture (skipping forward to Oz), the Sydney Opera House was a surprise highlight of the trip.   I’ve always known it to be one of the world’s iconic buildings, but the building is phenomenal to perceive and an absolute work of genius.     The location overlooking the harbor is extremely classy and the building manages to look beautifully elegant up close and from any angle.   I consider it the best piece of architecture in the world.

Australia is the perfect example of a parallel universe.    Arriving in the country I

that's a funny looking pidgeon...

immediately felt at home but as I continued on the train, small incongruous details began popping up.       What was that funny looking bird with the long beak?     And why where all of the girls dressed up with flowers in their hats like they came from 1940’s Britain?   Further along you’d notice the accents and the prevalence of meat pies.   And let’s not forget marsupials: you have kangaroos instead of deer and wallabies instead of rabbits.

Australian food isn’t so different, but a typical convenience store would feature different warm foods than our 7-11’s.   There’s the sausage roll, the meat pie, sausage crumble, and various other fried foods.   It all looked delicious, but the fried stuff I tried wasn’t very satisfying so I mostly stuck with meat pies.    The fast food chain pie-face puts a different face on each flavor of pie and I’d welcome the chain in the US at an appropriate price point.     Another of Australia’s food successes lies in their approach to the hamburger.   A burger will typically come with beets and cucumber slices on board.   The beet works as a great tomato alternative, but I think they’re usually both served together.   Bacon and eggs can also be served on the burger which makes it very hearty if not necessarily healthy.    Sweet chili sauce (Vietnamese?) is also a popular condiment, maybe more so than ketchup.   I first had it on a delicious chicken salad wrap, but it goes well with many things, even french fries.   Vegemite is extremely salty and I wasn’t sure what it was appropriate to eat it on – other tourists seemed to treat it mostly as a joke food.

I think I’ve made my main points by now but I’ll continue rambling about my trip, since this will probably be my main record of the journey.

Hong Kong airport stretches on into the distance

The Hong-Kong airport has an interesting roof making it look like one long tent.    One thing the Asian countries I’ve visited so far seem to excel at is placing malls inside transportation centers.    Most US airports I’ve been to have only a sprinkling of overpriced restaurants and souvenir/convenience stores.     I imagine recent security restrictions are to blame for some of this, but I know we can do better.   Dallas seemed to have a pretty good mall, and it seems a shame not to exploit the consumerism of trapped waiting tourists by offering them serious shopping options.     US public transportation is fairly poor, but the difference is blindingly obvious in subway stations.   A BART station is lucky to even have a nearby coffee shop, but in Japan every train station is an excuse for a giant underground mall.    The Hong-Kong station stretches from underground mall up partway into the skyscrapers and continues for several blocks via sky walkways.    There were many levels of city; the sky mall, the street-level shops, underground mall, and the businesses above in the high-rises.

Over the course of the trip I wound up flying a lot of airlines and watching a lot of in-flight movies.    Qantas seems a pretty nice airline, decent food, and hopefully they’ll pay for my rescheduled flights like they promised.   On my grounded flight I was put aboard a brand new refurbished 747 with Airbus seating (with carbon fiber!).   It was a very nice plane, and I would have liked to actually fly on it instead of just watching Transformers 3 (which is much better than 2).    I got a very bad impression of American Airlines.   This is mostly due to flying from California to Dallas and back (about 8 hours during dinner time) and not even receiving peanuts as a snack.  They served one Sprite each way.    Sure it’s a domestic flight, but the simple gesture of crackers or cookies makes a big difference.    This places United Airlines as my favored major US carrier.   I don’t know for sure if they would have given me peanuts, but when I missed my flight from Japan they put me on a free flight with a daytime layover in Hawaii, which is worth quite a few peanut points.    A similar occurrence on Delta resulted in a $300 penalty fee.

I almost missed my connecting flight in Sydney because the International terminal is located about 30 minutes by shuttle from the domestic terminal.   Transportation between the two terminals is very poorly organized by individual airlines.    Be careful when scheduling connecting flights.

In Australia we went to the zoo owned by the Steve Irwin family.   As you can imagine it has grown considerably in recent years and is now one of the largest zoos in Australia.   The zoo took a strong stance against hunting of Australian wildlife, so I wound up avoiding eating any kangaroos until I was sure they were farmed.   The kangaroo I tried on pizza tasted a bit like chewier lamb – pretty good.  They also sell stuffed kangaroo scrotums as charms/gag gifts, which is plain disturbing.

Scuba diving was fun, but I was pretty worried going in since I barely passed the certification.  At night they throw food to a bunch of sharks and then throw you in the water once they’ve gathered.    Considering the size of the sharks it’s a little disconcerting.

how many can you recognize?

When creating a new character design I propose this simple test.   If the character can be recognized by a sketch as minimalist as in Grégoire Guillemen’s famous capsules, then your character has the potential to become a successful cultural icon. Of course there’s plenty of applications where you can make a more mundane looking character, but for branding purposes a character should be instantly recognizable by a few simple colors and shapes.

On this note check out these minimalist Pokemon wallpapers at the 493 if you haven’t yet.