Welcome to the site!



Click "Get Started" above or click here to create a free account. Already have an account?
Login

Intro, caveat, info for geeks

The good news first: I've made significant progress towards getting the program launched towards completion. Basically everything but a few utilities (like the ability to get a password reminder or to change your password or e-mail address) is functional... at least in FireFox.

The bad news: As mentioned, while approaching alpha level functionality in the sense that while a lot more stuff WORKS and the site now DOES stuff, but sometimes bugs will crop up, and for instance, while configuring a team, the large number of active elements (the popup windows, the draggable players, etc. will cause browser issues that must be resolved by reloading the page.) Note: Once you drag a player into a lineup spot on the team configuration page his information is saved and when you reload the page your configuration will not be lost, but if you don't see the "Player Locked In" animation, that hasn't been saved.

Bad news, part 2: if you use Internet Exploder the site will act funky and not quite as described below since I haven't yet worked out the cross-browser bugs. There are a bajillion reasons you should use Firefox and not IE (and I say this as a Microsoft-defender and Mac-hater) and you can find out how and why you should switch here. So while I've discovered a few minor bugs that pop up infrequently in Firefox (most of which go away by reloading the page as far as JavaScript) and I'd be interested to hear about the site just not working in older versions of FF particularly, it should work for the most part for FF, but in IE it won't work properly, and I know this and will get to that.

That said, let me get this out of the way right here. Officially as of 7/28/09 we're open-source! Click here to download a .zip which mirrors the file structure of all the various files for the site exactly (which, online, are all just dumped unceremoniously into the /ta directory for the most part except for a few image directories.) For any tech-geeks interested in helping out shoot me an email at adam at baseballmarkovchain dot org with what you're interested in working on... I'll write a bit towards the end towards future directions where I want to take this thing which might whet your interest. As for any JavaScript gurus the cross-browser issue has to do with the different way which IE7 and IE8 parse the Document Object Model. It's a bit frustrating b/c the bug is in a beta version of Yahoo's very awesome free suite of user JavaScript user interface tools; I mean that only in the sense that I have no clue how to go into their code and hack it and I (irrationally) hoped that they had totally written their code so it was at least IE7/8 & Firefox 3.x compatible so I have to rewrite a bunch of my code at a fairly deep level. Definitely for the final product while I obviously will get it to work in IE the real focus on having everything spot on will be for Firefox since IE sucks--but that's beyond the scope of this article.

The gist of what the site does

While once on the inside you will get much more detailed instructions on how to use particular features of the site, what buttons to click, how to work the configuraton pages, etc., the premise of the site is this. Basically, you create a username and password (don't use a meaningful password, I can see it in the database.) Once you've done that, you can log-in at which point you need to configure a team before anything interesting will happen. You do so by picking from a list of any of the 30 teams which brings you to that team's configuration page. From there, each player on the active roster is shown, and can either be given a default configuration (a baseline projection of what they'll do this year based on a rolling average of their last 3 years and this years statistics) with one click or a customized configuration (with buttons saying "D" and "cfg" respectively doing those things.) This creates the data that will be incorporated into a mathematical model of baseball (or at least a baseball team's offense) called a Markov Chain. To learn more about Markov Chains and why they're the focus of this simulation web-site check out this blog-post. Once a player's projection is configured the box in which his name appears changes visually (its texture looks more "grippy" and when you mouseover it you will see a "draggable" cursor and the box becomes a draggable object which you then drag to a specific role on the team, for instance, leadoff hitter, or ace starter, or closer. If the page with all the configuring, dragging and dropping stops working, simply hit refresh (or Ctrl+R) and any players who you drug to a specific role on the team will have been automatically saved and the page will work again. A team is configured enough to use for simulations once you have a full lineup of hitters (or for national league teams, the 1-8 hitters) and 8 or more pitchers, of whom 4 must be put into the starting pitcher slots. There is a "My Teams" page which shows you whether a team can be used in simulations and if not how far away you are from having enough players configured on a given team before it will work. Once you have a team which can be used in a simulation, you click on the "My Sims" button or the link on the page that shows up when you log-in which provides links to the various simulators, of which there are several different types, both involving only a single team and aspects about it like how they'd fare over a whole season, as well as league-wide simulators which can incorporate your projections in simulating the rest of an ongoing season.

Try it out!

We're glad to announce that you can now play with the site without having to sign up... for a relatively stable user (where only I can change the player configurations) that has a bunch of teams set up so you can see how the simulations work use the username "twins" and the password "rule" If you want to be able to modify players then use the username "anything" and password "goes" but be aware that obviously since anybody can use this username that your data might get wiped out and all sorts of crazy stuff might happen. It's a totally public account.

The point

Using this site, it is possible to configure one or a few teams that you care about at the level of how their individual players will perform relative to expectations, what players will hit in what spots in the order, what pitchers will get the most time on the mound, and create a model of your team or teams which can then be used to generate a customized version of the "Playoff Odds" type projected end of year standings and odds that a given team will win the division or the wild-card that have become so popular in recent years. While these pages are fine, how they work is a black-box, and changing the model to incorporate views you hold about certain players or teams is impossible. While I assume most users will find this to be the most interesting simulation and will only configure one or a few teams (presumably their favorite team and its important rivals) one can also simulate other information about their offense, pitching and defense, and do other league-wide simulations which can include 0 through 30 customized team configurations, although practically I'd imagine most people will use only a few custom teams.

Again if you want to read more about how a markov chain of baseball works this is a good primer and a couple other blog posts also discuss it in more depth.

What it doesn't do (yet)

I need to finish all the basic utilities, fix the IE bugs, and then I'll have a working alpha version of the site. Optimizing the Javascript so that it works for 5 or 6 player configurations and then needs to be refreshed is another goal.

As far as other simulations now that I have the schedule loaded in and you can do league-wide simulations, things I'm considering will be improving the model of a team amd how it works: allowing you to have a platoon or an uneven split of time in a lineup spot, including more statistical events like base-stealing and base-running, allowing you to use MLB players on the 40 man roster not on the 25 man roster (e.g. a star player out for a few weeks on the 15 day DL.) As far as new simulations, I would eventually want to let you simulate the playoffs either given the results of a projected season or selecting 8 arbitrary teams.

At any rate, there's plenty of work left to be done, but if you use Firefox and read the directions, the site will work as advertised and you can see a customized version of the now-ubiquitous amongst stat-junkies "Playoff Odds" standings sheet that incorporates your biased and predictions.

-A.L. 8/13/09

Important note

In order to keep track of your movements at all times and control your mind make the fun website work(!) WE WILL leave dangerous "cookies" of information on your hard drive. If you remember the hysteria from the early 2000s while seemingly an innocuous way to anonymously and durably identify you when you login by storing 6 characters of data on your computer this is actually a form of government mind control and/or one link in a vast international criminal conspiracy, I haven't decided which. Which is a poor attempt at humor which means: you need to have JavaScript (no shit) and cookies enabled for the site to work. It will even throw errors(!) if you don't have your cookies turned on.