Tag baseball (8)
take me out to the ballgame
Mood: cheerful
Posted on 2007-06-28 13:06:00
Tags: baseball politics
Words: 298
djedi and I went to the Orioles-Yankees game last night. It was fun! Roger Clemens was pitching for the Yankees (which I didn't know when I bought the tickets, but a nice surprise), and it was a good game.
- There were a lot of Yankees jerseys and Yankees fans there. I'd say (judging by the noise of the crowd) probably about half and half. Wasn't expecting that.
- The temperature at first pitch was a sweltering 97 degrees (when this was announced there was a lot of ooohing, as Baltimore isn't supposed to be that hot!)
- At the "O" of "O say does that star-spangled...", everyone yelled "O!", presumably for the Orioles. I thought this was weird. (I don't remember the Houston Rockets doing that...)
- The next section over, an old guy fainted (or something) during the first inning (presumably due to heat stroke or something). The medical people got there very quickly, brought some ice, and eventually carted him off. He was talking, so it didn't look too bad.
- They had a scoreboard race between innings with Ketchup, Mustard, and Relish. (go Mustard!) Pretty standard fare, except they printed season statistics beforehand! ("Ketchup started off slowly winning 2 of the first 13, but then went on a tear winning 4 of the next 6") Awesomeness.
- During the seventh inning stretch, "Take Me Out to the Ballgame" was not sung! Unconscionable. (some country song was, which would have been appropriate afterwards, like the Astros do with "Deep in the Heart of Texas")
O's won 4-0 (take that, Yankees fans!) in a real pitcher's duel.
Dems force Cheney to flip-flop on secret docs - apparently defunding his office was threat enough for him to stop claiming he's not in the executive branch. (although he's still not giving up his secret papers)
epic flying mount!!
Mood: excited
Posted on 2007-06-20 09:07:00
Tags: ljbackup baseball rice worldofwarcraft
Words: 200
With the help of djedi, I bought my epic flying mount last night! (big screenshot of required money) It, in a word, is awesome. I will have to see about getting one of the cooler looking ones (right now it's green) but it is super fast.
One of the advantages of putting my sample LJ backup online (created with LJBackup</shamelessPlug>), besides the neat statistics, is that when people do searches and click through I get to see it. Like, I'm one of only two results on Google for "homer 3d" "fermat's last theorem" (the search leads to here), which someone clicked through to last night. Oddly enough, Google doesn't find the original LJ post...
Rice plays NC State today (and tomorrow, if necessary) at 2PM Eastern - if they win one of these games, they advance to the championship series! Go Owls!
Also, LiveJournal will be selling permanent accounts starting Friday for one week. They cost $150 and you're a permanent member for life (like being a paid member but you get more space and userpics). I considered it but I think I'm going to pass for now. (the last permanent account sale was in 2005 so they're pretty rare)
baseball series probabilities
Mood: curious and mathy
Posted on 2006-06-30 09:36:00
Tags: baseball math
Words: 790
So when Rice was in the NCAA baseball tournament and College World Series, I thought about how one baseball game or even a three-game series weren't really enough to determine which team was better, which is why MLB playoff series are 5 or 7 games, which certainly seems enough to tell for sure which team is better. Trying to figure out how true that was, I modeled it mathematically:
So, let's be formal here: the Astros are playing the Blue Jays, and the Astros have an x chance of beating the Blue Jays in any given game. (for 0 <= x <= 1) Assume that we have no prior knowledge of x - i.e. the probability of x is evenly distributed from 0 to 1. Given that the Astros beat the Blue Jays, what is the probability that x >= .5? (that is, the Astros are "better" than the Blue Jays)
Since the probability that the Astros beat the Blue Jays in one game is simply x, we're looking at the area under the curve y = x, which is of course the integral of x. So the probability that x >= .5 is just (the integral of x from .5 to 1)/(the integral of x from 0 to 1) = (1/2 - 1/8)/(1/2) = 3/4.
(hmm, this would look a lot nicer in LaTeX)
The nice thing about this method is that it easily generalizes - let's say that the Astros beat the Blue Jays two times. Since the probability that the Astros win both games is x^2, the probability that x >= .5 is (the integral of x^2 from .5 to 1)/(the integral of x^2 from 0 to 1) = (1/3 - 1/24)/(1/3) = 7/8.
And let's say the Astros beat the Blue Jays in a best out of 3 series. The probability that the Astros win the series is x^2 + 2*(1-x)*x^2 = 3*x^2 - 2*x^3, so the probability x >= .5 is (1/2 - 3/32)/(1/2) = 13/16, which is .8125. (which is less than 7/8, which smells wrong to me, but sort of makes sense because a best of 3 series always chooses a winner, while "winning 2 games" doesn't. Feel free to start checking my math at this point, though :-) )
If the Astros beat the Blue Jays in a best out of 5 series, the probability that the Astros win the series is x^3 + 3*(1-x)*x^3 + 6*(1-x)^2*x^3 = 10*x^3 - 15*x^4 + 6*x^5. So the probability that x >= .5 is (1/2 - 5/64)/(1/2) = 27/32, which is about .844.
Finally, for a best out of 7 series, the probability that the Astros win the series is x^4 + 4*(1-x)*x^4 + 10*(1-x)^2*x^4 + 20*(1-x)^3*x^4 = 35*x^4 - 84*x^5 + 70*x^6 - 20*x^7. So the probability that x >= .5 is (1/2 - 35/512)/(1/2) = 221/256, which is about .863.
# games in series Probability winner is "better" team
1 .75
3 .8125
5 .844
7 .863
So, this is all well and good, but the results seems a little unrealistic - I find it hard to believe that the best team wins 3 out of 4 times in just a single game. Let's try to remove some of the simplifying assumptions.
In the real world, the Astros beating the Blue Jays 100% of the time is just not going to happen. If we look at the final MLB standings from 2005, no team had a winning percentage below .3 or above .7, so let's try using .3 <= x <= .7 instead of 0 <= x <= 1. So we just have to recalculate all the integrals. This leads to the following results, assuming my math is correct (thanks to this numerical integrator):
# games in series Probability winner is "better" team
1 .6
3 .646
5 .678
7 .702
These probabilities seems a bit more realistic.
Finally, we've been assuming that x is distributed uniformly, but I'd say more teams are close in relative ability to each other. So let's try distributing x as a probability function over .3 to .7. We can use a "tent" function that peaks at .5 - something like 1 - 5 * abs(x-.5). (this hits the points (.3, 0), (.5, 1), and (.7, 1)). Again, this is relatively easy to calculate - we just multiply the expression we were integrating by (1 - 5 * abs(x - .5)). Doing this leads to our final results:
# games in series Probability winner is "better" team
1 .567
3 .598
5 .621
7 .639
So there you have it - under this model, even a 7 game series will only pick the better team 64% of the time. The probability function may have been a little too harsh here, so the 70% in table 2 might be a better guideline.
To make this more accurate, we should recognize that even if the Astros have an x chance of beating the Blue Jays, on any particular night the starting pitcher for both teams adds a bit of variance to that factor. This might be interesting to look at at some point.
Thanks for reading this far! Comments (especially pointing at mistakes) are most welcome.
wheeee
Mood: buzzed
Posted on 2006-06-09 13:48:00
Tags: baseball baseballstats
Words: 244
I'm having one of those days (really, one of those "last few days") where things are going very well (codewise). I left work yesterday with a mysterious problem, and solved it quickly this morning (my idea of what the problem was was right on, just needed a little more tweaking), which is always a good feeling. Also, I had a large mocha this morning, so I've reached a state of higher consciousness.
Nachos for lunch (not just nachos, mind you, but suuuuper nachos!) is awesome. Nachos for dinner (as I did at the astros game last week) is also good.
Inspired by the baseball books I've been reading, I present the expected runs per inning finder. There isn't a whole lot of data, but it's rather interesting. For example, if you have a runner on first with no outs, you never want to sacrifice him to second - the probability of having a zero-run inning goes from 57.6% to 59.3%. Sacrifices in general usually aren't worth it on a runs scored per inning basis, although they can be if you really just need a run.
From a technical standpoint, I used XPath for the first time, and got it to work with IE and Firefox without too much trouble. I also added more Retrosheet data to both the expected runs per inning finder and the Win Expectancy Finder.
The Texas Pride Festival is tomorrow in Austin. I'll be there!
Thank you, namaste, and good luck.
adrift
Mood: 4 8 15 16 23 42
Posted on 2006-06-05 14:48:00
Tags: baseball baseballstats
Words: 242
So djedi and I were home this last weekend to celebrate birthdays and other things. I had a good time - it was good to get to see my family again. The downside is that Carrie got me hooked on Lost, and I spent too much time this morning looking at lostpedia.com to find out more stuff I missed. Maybe I'll watch it next year...
I also got some new shoes, which are designed to help me not pronate (walk on the insides of my feet). My feet are mostly used to them now, and they do seem to feel better, so yay!
We also went to the Astros game Saturday night.
Since the game on Saturday was exciting, and the Astros almost came back in the 9th inning, I graphed the win expectancy throughout the game using my win expectancy grapher. The resulting image is below:

You can see the Astros got back up to a 20% chance of winning in the bottom of the ninth, which is pretty good.
I watched and listened to the end of the game on Sunday, which was exciting and went into extra innings - the win expectancy graph is below:

Whenever a game goes into extra innings, the win expectancy fluctuates wildly (since one run makes a huge differencE), and this game is no exception.
Tonight before and after game night, my goal is to get sound working on my computer. We'll see how that goes.
good wicked weekend
Mood: refreshed
Posted on 2005-11-07 09:41:00
Tags: baseball baseballstats
Words: 680
So I had a good weekend. The plan for the weekend was to see "Wicked" in Houston on Friday, visit Vickie and Mae-Mae (sp?) (some kids that David homeschooled a while ago) on Saturday, and go to the Renaissance Festival on Sunday. Mission accomplished!
Friday - Unfortunately the show was at 8:00 so we decided to leave Austin by 3:30 to make sure we got there on time (and we could meet up with abstractseaweed and Leigh Ann and carpool). This meant I had to leave work at 3, which would have maybe been OK except that I was kinda in the middle of debugging something important with someone else and I had to 'fess up I was leaving early, at which he was not terribly pleased. (the good news is that the problem turned out to be nothing) Anyway, so djedi and wildrice13 and I drove down there, and all was going well until we stopped on 290 for an hour and 15 minutes (there was apparently an accident a few miles ahead). So we turned off the car, switched drivers, got out, etc. Which was OK, except now we were worried about making the show. After traffic started moving again, I was driving as fast as I could while still being safe. We stopped at Wendy's to grab dinner and eat it on the way. Note to self: if you have to eat in the car while driving, don't get a hamburger! Get chicken nuggets or something.
Anyway, we made it to the show skipping both of our planned stops (abstractseaweed ended up not coming) and made it with 10 minutes to spare. The show was quite good - djedi and I had only listened to the soundtrack, so we had a basic idea of the story, but we missed a lot of important points!
- Who Nessa was - she's referenced in a few songs, but she turns out to be pretty important.
- Elphaba's mother cheated on her father, not the other way around. In retrospect, this should have been painfully obvious.
- The bit in "Dancing Through Life" where Glinda tells Elphaba that she and this hat "deserve each other". Hah!
- Boq is pretty mean/evil, it turns out.
- Glinda and Elphaba are friends at the end.
- The ending is actually surprisingly happy from what I expected. It was a little too happy for me at first, but I guess it's OK.
Anyway, the singing was top-notch (although there was a time or two where there should have been a "moment" between the singers and the orchestra that was a little out of sync) - even the random chorus members had fabulous voices. I really liked the "As Long As You're Mine" song between Elphaba and Fiero...they both had especially nice voices. The lighting was very well done - lots of colors and patterns and whatnot to really set the mood of particular scenes.
Anyway, enough about that. It was very good, and I was reminded that I should get into more musicals (and thanks to onefishclappin for giving the "Wicked" soundtrack to djedi :-) )
Saturday - We slept late and watched "Eulogy", which was pretty good although a bit weird. We then met Vickie and Mae-Mae at the Cheesecake Factory in Sugarland - unfortunately I had eaten a lot at lunch so I wasn't too hungry, but still managed to split a piece of cheesecake with djedi. Mmm! Anyway, they're cute kids, and I got a couple pictures that I'll put up sometime this week.
Sunday - Went to church, picked up wildrice13 and headed out to the Renaissance Festival, which is a good hour and a half away from Houston. By the time we got there we were starving for lunch, so we ate, saw a few shows (including the Ded Bob Show, always a classic) and walked around a lot. Unfortunately, it was very warm, so we left a little early and headed back to Austin.
That's about it. I wrote a baseball Win Expectancy grapher that uses the probabilities from my Win Expectancy finder, so I'm probably about done with that project for now.
Just another day...
Mood: confused (at work)
Music: Phil Collins - "Another Day In Paradise"
Posted on 2005-10-24 13:06:00
Tags: baseball astros baseballstats
Words: 146
Wow...the weekend did not treat the Astros well. Down 2-0 isn't horrible, though, especially because they're coming home. And Berkman has had two good games, which is promising. The walk-off home run last night hurt, but not nearly as bad as the Pujols one. I'm mostly just happy they made it here at this point. (although I do hope they win a few at home!)
I threw together a PHP script, so you can now calculate baseball Win Expectancy given a situation. I may work on it some more at some point...
The last week or so, I've had some trouble getting to sleep - nothing serious but it's been taking me at least half an hour to get to sleep. I'm gonna try avoiding caffeine this week and see if that helps.
Edit: meant to link to this article about win expectancy. So now I did!
Yay Astros!
Mood: hopped up on baseball
Music: E. J. Jones -"Castle of Dromore"
Posted on 2005-10-20 09:21:00
Tags: baseball astros baseballstats
Words: 246
Hooray!
My nervous energy yesterday launched me into a new project. It started when I read the Crawfish Boxes (an Astros blog that is part of a network started by the founder of Daily Kos) after the 18 inning Game 4 of the Atlanta series. They talked about how amazing the game was, and talked about WPA, which after reading a link to the Hardball Times, discovered was the statistical relative frequency that a team will win in a given situation. They linked to the Win Expectancy Finder, which calculates WPA and is based on the data file that Phil Birnbaum put together that he made from Retrosheet game data. However, he only did games from 1979-1990, and Retrosheet has many more event logs for games.
So I decided to try to write a parser for them and create a data file like Birnbaum's, except with more games. It turns out the data file format is kinda hard to parse, but I have a script that mostly does it, so I'm somewhat close to my goal. I need to test it on more games - almost finished testing it on all 2004 games and tweaking it to make it work (luckily, there's redundant data in the files so I can fairly quickly tell when I did something wrong).
Anyway, that's my new project, and hopefully I'll put something up soon. I worked on it a lot last night before going to magic and while watching the game.
This backup was done by LJBackup.