Quote:
Originally Posted by me
Rather than needing 7 different formulas
Correction: you'd need 15 formulas, though 6 would have a symmetrical counterpart with the variables flipped.
Quote:
Originally Posted by trup_qq
And for example it's the current NBA finals where it goes HHRRRHH (2-3-2)
The finals is 2-2-1-1-1 as of 2014. See for instance 2017, where Game 5 was @GS. And it hasn't changed in 2019 according to this link:
https://bleacherreport.com/articles/...tions-and-more
Quote:
How can I plug in what I think will be a team's moneyline for each individual game. Especially if I think it will be a different number.
This makes for 7 variables, so now the matrix method seems preferable. I went ahead and coded it in Julia:
Code:
function seriesprob(h::Vector{Float64}, p::Vector{Float64}, score::Vector{Int64})
(length(h)≠4 || length(p)≠3 || length(score)≠2) && error("vector lengths should be 4,3,2")
score[1]==3 && score[1]==3 && return h[4], 1-h[4]
score[1]==4 && return 1,0
score[2]==4 && return 0,1
x = 7 - (score[1] + score[2])
r = ones(Float64,4)-h
q = ones(Float64,3)-p
T = zeros(Float64, 18,18)
T[1:9, 1] = [1.0, 0.0, h[4], 0.0, 0.0, 0.0, q[3], h[3], q[2]]
T[2:6, 2] = [1.0, r[4], p[3], r[3], p[2]]
T[4,3] = q[3]
T[7,3] = p[3]
T[5,4] = h[3]
T[10,4] = r[3]
T[6,5] = q[2]
T[11,5] = p[2]
T[12,6] = p[1]
T[8:10, 7] = [r[3], 0.0, h[3]]
T[9,8] = p[2]
T[13,8] = q[2]
T[14,9] = q[1]
T[11:13, 10] = [q[2], 0.0, p[2]]
T[12,11] = q[1]
T[15,11] = p[1]
T[16,12] = r[2]
T[14:15, 13] = [p[1], q[1]]
T[17,14] = h[2]
T[16:17, 15] = [h[2], r[2]]
T[18,16] = r[1]
T[18,17] = h[1]
score[1]==2 && score[2]==3 && return (T^x)[4, 1:2]
score[1]==1 && score[2]==3 && return (T^x)[5, 1:2]
score[1]==0 && score[2]==3 && return (T^x)[6, 1:2]
score[1]==3 && score[2]==2 && return (T^x)[7, 1:2]
score[1]==3 && score[2]==1 && return (T^x)[8, 1:2]
score[1]==3 && score[2]==0 && return (T^x)[9, 1:2]
score[1]==2 && score[2]==2 && return (T^x)[10, 1:2]
score[1]==1 && score[2]==2 && return (T^x)[11, 1:2]
score[1]==0 && score[2]==2 && return (T^x)[12, 1:2]
score[1]==2 && score[2]==1 && return (T^x)[13, 1:2]
score[1]==2 && score[2]==0 && return (T^x)[14, 1:2]
score[1]==1 && score[2]==1 && return (T^x)[15, 1:2]
score[1]==0 && score[2]==1 && return (T^x)[16, 1:2]
score[1]==1 && score[2]==0 && return (T^x)[17, 1:2]
return (T^x)[18, 1:2]
end
Let h = P(higher seed wins a home game)
Let p = P(lower seed wins a home game)
The function's parameters are three vectors:
[h1, h2, h3, h4]
[p1, p2, p3]
[score1, score2] where score1 is the higher seed's score
Example: seriesprob([1.0, 1.0, .55, .5], [1.0, .6, .65], [2, 1])
If you're starting at Game 4 like above, then the higher seed's first 2 home probabilities won't affect the answer, nor will the lower seed's first home probability, so you can set them to 1.0 (or 1, but that's a few microseconds slower).
If the probabilities won't change, then instead of typing [.65, .65, .65, .65] you can type fill(.65, 4)
If you'd rather not install Julia, you can run the code here:
https://tio.run/#julia1x
Paste the function, then on the next line paste
Code:
println(seriesprob(...))
and replace ... with your parameters.
If you install Julia and run the code in the Julia console, you don't need the println(), just seriesprice(...)
The output is P(higher seed wins) followed by P(lower seed wins).
I checked it against my formula for a 2-1 score and the answer matches.