I don't think "formula" or "equation" is an accurate representation of run expectancy. In its basic form, it's historical data, sorted (and averaged) into 24 spots in a matrix that comes from there being 3 numbers of outs (0,1 and 2) and each of the three bases might either be occupied or not (2x2x2=8 configurations). Here is an example compilation from game data 1950-2015: http://www.tangotiger.net/re24.html Now, I think FanGraphs goes to another level, and has some proprietary formulas that they use to adjust the real-world data for various purposes, such as to speculate on an era where offense is higher across the board. But those aren't formulas that people like us need, when putting the RE table to use. I guess you can say there is a "formula", of sorts, on how to use the table. When a plate appearance is finished, take the RA value of the new situation, subtract the RA value before the play started, and of course add any actual runs that were scored. That's the result, from either the batter's or the pitcher's perspective. Also, there are two main variations of the table: expected number of runs to score the rest of the inning, or the probability of scoring at least one run. In late innings, particularly the bottom of the ninth (which was the discussion point), the latter may be more important. But the numbers you crank, through this process, are at heart real life data, even if sliced and diced a few ways.