9.5 Stochastic Processes
9.5.1 Multiple Transitions
after three plate appearances
After 3 Plate Appearances | ||
starting with bases empty and zero outs | ||
state | new_state | Prob |
---|---|---|
000 0 | 3 | 0.372 |
000 0 | 100 2 | 0.241 |
000 0 | 110 1 | 0.081 |
000 0 | 010 2 | 0.074 |
000 0 | 000 2 | 0.053 |
000 0 | 001 2 | 0.029 |
000 0 | 101 1 | 0.028 |
000 0 | 100 1 | 0.026 |
000 0 | 000 1 | 0.019 |
000 0 | 011 1 | 0.019 |
000 0 | 010 1 | 0.016 |
000 0 | 111 0 | 0.011 |
000 0 | 110 0 | 0.007 |
000 0 | 001 1 | 0.007 |
000 0 | 101 0 | 0.004 |
000 0 | 000 0 | 0.004 |
000 0 | 100 0 | 0.003 |
000 0 | 011 0 | 0.003 |
000 0 | 010 0 | 0.002 |
000 0 | 001 0 | 0.001 |
table code
P_matrix_3 |>
as_tibble(rownames = "state") |>
filter(state == "000 0") |>
pivot_longer(
cols = -state,
names_to = "new_state",
values_to = "Prob"
) |>
filter(Prob > 0) |>
arrange(desc(Prob)) |>
gt() |>
cols_align(align = "center") |>
data_color(columns = Prob,
palette = "inferno") |>
fmt_number(columns = Prob,
decimals = 3) |>
tab_header(title = "After 3 Plate Appearances",
subtitle = "starting with bases empty and zero outs")
9.5.2 Fundamental Matrix
\[N = (I - Q)^{-1}\]
## 000 0 000 1 000 2 001 0 001 1 001 2
## 1.05 0.75 0.60 0.01 0.03 0.05
Starting at the beginning of the inning (the “000 0” state)
- the average number of times the inning will be in the “000 0” state is 1.05
- the average number of times in the “000 1” state is 0.75
- the average number of times in the “000 2” state is 0.6
- etc.
## [1] 4.27
- the average number of plate appearances in a half-inning (before three outs) is 4.27.