Showing posts with label Data Analysis. Show all posts
Showing posts with label Data Analysis. Show all posts

Wednesday, September 15, 2010

E-Mail Analysis

My cousin turned me onto this nifty widget Google Chrome has that will analyze you're Gmail inbox and give you a pretty cool graph. It is located here. I have been using Gmail as my primary email for over 6 years now. That's a large number of emails that I've sent and received. It comes out to almost 25,000 archived emails. I once read a great blog post by my good friend Brian where he ran an analysis of his Inbox. It was pretty interesting and I wanted to do something similar. I tried for like five minutes trying to figure out how to download all my email data as CSV, and then gave up and drank a Keystone Ice. I found that while the Ice was harder to come by, the black label looked really cool.

Blue are all emails, Red are sent emails

I had assumed the top chart would look something like this. It's like you can tell which months classes started and finished each year. The second chart gives some information that I always wondered about. How much of my email traffic comes through early in the week. Well if November of 2008 is any indication, Mondays and Tuesday accounted for like 50% of the email traffic in a given week. You can also see that like most people I receive emails at a much larger rate than I send them by about a 1:10 ratio. But that's pretty common.

So where did all those emails come from? Let's go to the chart.

Wow. Of the 25,000 emails I have archived about 1 in 8 are facebook (blue) related. That is a little scary. The other ones are from the U of M class web-based site Ctools (red), online risk (orange) and emails from bus drivers (green). Combined these account for like a third of all the emails I've ever received. It looks like I played a lot of online risk in July of 2008. The really cool graph is the bottom right. I've stopped getting emails from my classes which makes sense. My online risk playing must have gone downhill. I am definitely less social judging by my reduced use of Facebook to near Sophomore year levels. Finally, my job doesn't spam my personal email address so often. It looks like I much be more boring now. Maybe that is the cause of the reduced blogging.

Perhaps I'll do some more graphing of my emails to try and determine exactly when I started overusing the term "buttmuncher" in my emails.

Saturday, April 3, 2010

Baseball Betting Analysis

I've decided to use the analysis I conducted on NFL season over/unders and apply it to Baseball.

The first thing that I did was compare the Vegas estimated total wins for the baseball against the possible number of total wins. I added all the teams over/unders and got 2441.5. Which is amazing because the baseball season only consists of 2430 games. That leaves 11.5 wins unaccounted for. The reason that this occurs is that most sports fans like to bet on their team to do well. Because off all this action on the overs, Vegas moves the lines to attract the betting on the other side.

Not only are the over/unders inflated on the aggregate, they are also somewhat normalized. During the 2009 season there were 5 teams that had less than 70 wins, Vegas predicts that no team this year will have below 70 wins. There have been at least 4 teams that go below 70 wins each of the last 5 years. If I could make a prop bet that at least three teams will have less than 70 wins, I would take it.

Here is a chart that compares this years predictions vs. last years results:
For comparison, I took the variance in number of wins between 2010 and 2009. Vegas predictions have a variance of 46.56 while the actual variance last year was 126.40.

I believe most of those 11 phantom wins that Vegas is predicting will affect teams in the bottom half of the league. Fans being hopelessly optimistic will always believe (and bet) that their teams will do better than expected. For football I actually compared the teams to their schedule and used Vegas's own odds to predict how well they would do against other teams. Since I don't have time to compare a 2430 game MLB season, I think I'll just bet the under on each of the bottom 7 teams. I'll throw a little more money on the ones at the very bottom.

Even though I don't know much about baseball I can still confidently predict the results of teams that I cannot name a player on the roster. 6 months from now I'll see how good my predictions were.

Bets:
Pittsburgh Pirates - under 70
Son Diego Padres - under 71
Toronto Blue Jays - under 71
Washington Nationals- under 71
Kansas City Royals - under 71.5
Baltimore Orioles - under 74
Houston Astros - under 74.5

Tuesday, September 8, 2009

NFL Team Analysis

Last night I finished my lengthy analysis of my calculated expected wins vs, Vegas odds. But while I was typing up this post I started to realize that teams bye weeks weren't lining up with this season schedule. Then I realized that I had done my analysis using the 2005 NFL schedule. Which means I had to redo everything. But all the information from the first post is still accurate. Again, the theme was bet on unders, and most likely there will be more teams that finish with less than 5 wins than Vegas predicts.

Tonight I redid part of my analysis, but unfortunately I didn't not have time to analyze every team, but I focused on teams that were expected to go under .500 and that had decent payouts.

After spending many additional hours developing odds for each team I am disappointed to realize that my analysis indicates that one of the safest bets is betting against the Detroit Lions. This greatly disappointments me.

My method was to determine a teams chance at winning by taking the square of the teams expected wins and dividing by the sum of both teams expected wins. So the odds of a home team winning are Home^2/(Home^2+Away^2). So if the home team was expected to win 7 games and the away was expected to win 11, the home teams chance of winning would be 7^2/(7^2+11^2) or about 29%. Using this I ended up with each teams expected number of wins. I then compared them to the over/under odds for that team. In my last post I determined that betting unders is the way to go, because there cannot be 132 wins amongst the 32 teams and there will be a few ties sprinkled in there too.

Here are 3 Under picks that I might consider making.

Detroit Lions, O/U: 4.5, Expected Wins: 3.62, +105
From the numbers it is quite easy to see why there is no likely way this team wins 5 games. They are only playing four teams that are expected to have sub .500 seasons. There opponents are expected to win 8.43 games on average. In order to get the 5 wins they are going to need to beat the four bottom teams they face. But even their computed odds of beating their weakest opponent (St. Louis) is 28%. There odds of winning all 4 is 0.5%. Like I said before, I would be surprised if the worst team in the league gets 5 wins. Plus this bet has a positive payout of $105 for every $100 bet.

Tampa Bay, O/U 5.5, Expected Wins : 4.61, +105
I would write an entire paragraph on how Tampa Bay isn't going to win a single game because they have absolutely no offense. But I'm here to look at quantitative numbers not qualitative. Tampa Bay is only playing ONE team that is expected to go under .500. That team is Miami who is expected to have 7 wins, but maybe you should hold off on this until you finish the entire post. To win this bet Tampa Bay has to win at least 6 games. My calculations indicate that Tampa has about an average 30% chance of winning any given game. Also this is another bet with a better than 2:1 payout.

Miami, O/U 7, Expected Wins: 6.32, +100
Miami doesn't have as much of a difference between my expected number of wins and the Vegas line, but it is still rather large. Miami is playing three games against opponents slated to win less than 8 games, but two of the are the Jets who are expected to win 7.5 games. The real thing to look at is Miami's overall opponents who are picked to win an average 8.84 games. That's some stiff competition for a team trying to win 7 games. Miami only plays one team which is expected to be worse than it, and that is Tampa Bay. For this bet to lose Miami would have to win 8 games in a division where every other team is expected to be better than you. Note: this bet offers even pay.

The one vital aspect to these last two picks are that the teams have to play each other. Not only do they have to play each other, but they are each others easiest game of the season. Both teams are counting on the win to get above their over/under. Miami will not win 7 games with a loss against Tampa Bay, and it will be equally hard for Tampa to win 5 without getting the easy one against Miami. This game should serve as to cover one of the two bets, and then if the winning team doesn't beat their O/U you have a double payout. If these two teams tie, I will be a very happy man.

Again, the great thing about these three bets is that they pay even money or better. Usually in sports betting you have to put up 110 for every 100 you want to win. So these bets should earn some cash.

Initial NFL Betting Analysis

As you all must know, I spend a lot of my spare time doing useless analysis.

But occasionally my statistical analysis can make me money. I spent so much time researching Big Ten college football teams that I've barely had time to look at NFL. I don't like betting NFL games. Mostly because both teams are very well figured out and the odds makers are much more accurate than college football. In College Football I have the edge because I can spend more time evaluating each team in a match up that the guy who has to handicap 60 games. But the only thing about NFL betting that really interests me is betting on regular season wins. Because sport books put out lines on all teams it is possible to look at each team compared to the strength of each team they face. Eventually you create a spreadsheet with each team and the expected wins of each team they play and that looks like this.

And now you can analyze each team compared to the teams they play. I'll do this analysis over the next few nights. A few drawbacks of this analysis are that; each opponent plays different teams and each team has a different strength of schedule which affects their line, the amount you have to risk to win $100 varies with each bet. I.E. right now you have to bet $135 on the lions winning 4.5 games to win $100, but you only have to bet 95 on the Lions winning less than 4.5 games to win $100. So the lines don't necessarily match up evenly.

But the only analysis that I have done is on some overall numbers, comparing predicted outcomes to last years actual outcomes.


The first row of this chart shows that teams are on average overvalued by an eighth of a win. There have to be equal amounts of wins and losses. The reason for this is that there are lots of casual bettors that will bet their team to win more games regardless of the O/U line.

The other noticeable thing about this chart is that there are a lot of teams that are expected to go over .500. This is possible and reasonable, but in order for this to happen there have to be a lot of above average teams and there have to be a good number of terrible teams. But the odds makers are predicting that there aren't. For last year to have 16 teams go over .500 there were 6 teams that achieved less than 5 wins. But this year the bookmakers expect 18 teams to go over .500 with only one team getting less than 5 wins. Either they're expecting all the teams under .500 to go 5-11 or 6-10 or people should start betting the unders.

Also only one team getting over 11 wins? Over the last 5 regular seasons there were an average of 4.6teams getting more that 11 wins a season. Maybe betting overs on some Superbowl favorites is in order.

Overall it appears that the odds makers are coming out pretty conservative. Last year there were 11 teams with over 11 wins or less than 5. Initial lines for this year have only 2 teams falling in those categories. Perhaps tomorrow I should also look at what the lines looked like going into last season.

Wednesday, September 2, 2009

Brian Analyses his Fantasy Football Draft

We just had our fantasy football draft and I've spent most of the night analyzing the results. Sometimes I think I do more engineering work at home than I do at the actual work. For reference my team is Power Dump. I'm sure you remember my team from last year.

I went through each team and looked at how their picks compared with average player picks. So for example Nick picked up Carson Plamer with the 68th overall pick. So far this year Carson Palmer has been taken with the 90.3 pick on average. So I took each teams average picks along with the average draft pick and compared them. I decided that many times the later rounds don't matter as much and people generally use those picks on risky players and players that won't really impact the team. So I also compared the first 12 rounds to drop out any crazy outliers from the final 5 rounds.

The average pick is the your average overall pick for those rounds. If you had a later picks then your average pick is obviously higher than someone who picked early in the draft. This accounts for the first 5 rounds being perfectly even. [We do a keeper league so the first 5 picks are preselected -ed] The average selection is the average overall pick that your players went for in all of Yahoo drafts.

IN DRAFT ORDER here are the results:

Fuck you Brad Watson
FIRST 12 ROUNDS:
Average Pick - 46.5
Average Selection - 54.5
FIRST 14 ROUNDS:
Average Pick - 54.3
Average Selection - 62.9
OVERALL
Average Pick - 66.0
Average Selection 70.9

Power Dump
FIRST 12 ROUNDS:
Average Pick - 47.0
Average Selection - 50.3
FIRST 14 ROUNDS:
Average Pick - 54.,9
Average Selection - 55.5
OVERALL
Average Pick - 66.7
Average Selection 64.7

Caketown Spartans
FIRST 12 ROUNDS:
Average Pick - 47.6
Average Selection - 46.0
FIRST 14 ROUNDS:
Average Pick - 55.5
Average Selection - 56.8
OVERALL
Average Pick - 67.4
Average Selection 67.1

CMU
FIRST 12 ROUNDS:
Average Pick - 48.2
Average Selection - 50.3
FIRST 14 ROUNDS:
Average Pick - 56.2
Average Selection - 56.1
OVERALL
Average Pick - 68.1
Average Selection 66.7

*Nick you did really well drafting the last 5 rounds. All your picks were below their average pick.

Shit
FIRST 12 ROUNDS:
Average Pick - 48.8
Average Selection - 57.4
FIRST 14 ROUNDS:
Average Pick - 56.8
Average Selection - 64.3
OVERALL
Average Pick - 68.9
Average Selection 75.3

Cougar Cornbread
FIRST 12 ROUNDS:
Average Pick - 49.4
Average Selection - 53.8
FIRST 14 ROUNDS:
Average Pick - 57.5
Average Selection - 59.5
OVERALL
Average Pick - 69.6
Average Selection 70.0

*Evan you also did rather well for yourself in the last 5 rounds

Go Blue
FIRST 12 ROUNDS:
Average Pick - 50.0
Average Selection - 48.0
FIRST 14 ROUNDS:
Average Pick - 58.1
Average Selection - 66.3
OVERALL
Average Pick - 70.3
Average Selection 74.4

Believe in Now
FIRST 12 ROUNDS:
Average Pick - 50.5
Average Selection - 47.2
FIRST 14 ROUNDS:
Average Pick - 58.8
Average Selection - 56.7
OVERALL
Average Pick - 71.0
Average Selection 66.7


So who had the best draft?

That is subjective to how much you value late round picks. But since it is my belief that the first 12 rounds are the ones that really matter I've computed the delta between the average pick and average selection to come up with a best draft ranking.

Best Draft Rankings:
1. Believe in Now (-3.3)
2. Caketown Spartans (-1.6)
3..CMU (+2.1)
4. Power Dump (+3.2)
5. Cougar Cornbread (+4.5)
6. Go Blue (+8.0) TIE
6. Fuck You Brad Watson (+8.0) TIE
8. Shit (+8.6)

Now we can look at who has the best team by average draft pick.

Best Team First 12 Rounds:
1. Caketown Spartans (46.0)
2. Believe in Now (47.2)
3. Power Dump (50.3) TIE
3. CMU (50.3) TIE
5. Cougar Cornbread (53.8)
6. Fuck You Brad Watson (54.5)
7. Shit (57.4)
8. Go Blue (58.0)

Finally we can rank the best teams overall.

Best Team Overall (All Rounds):
1. Power Dump (64.7)
2. Believe in Now (66.7) TIE
3. CMU (66.7) TIE
4. Caketown Spartans (67.1)
5. Cougar Cornbread (70.0)
6. Fuck You Brad Watson (70.9)
7. Go Blue (74.4)
8. Shit (75.3)


Note: This analysis doesn't include any transactions made after the draft.