Patman
Rodent of Unusual Size
Re: Pairwise and Bracketology 2013 Edition
I still have to input the values (off to the internet!) and create a second function for the ecac third place game... but here we go
I should note that this is inefficient... technically i can get away with saying that win.prob.cts[i,j]=1-win.prob.cts[j,i]
but I don't need this to be optimally fast, it'll only take a few seconds and I only need to do it once.
edit: and of course, its full of bugs... :-/
edit #2: here we go... I went by the alphabetical ordering of jtw's two letter codes (because that was the easiest way to encode)... and all those numbers are hand inputs using Robin Lock's figures.
I still have to input the values (off to the internet!) and create a second function for the ecac third place game... but here we go
Code:
off.vctr=c(2.30,2.63,1.17,1.92,2.79,1.70,3.47,2.74,2.49,2.32,3.14,2.46,1.97,3.69,3.01,2.60,2.65,2.14,2.90,3.87,2.79,2.35,2.44,2.52,2.87,2.93,2.08,2.66,3.39,3.54,3.05,2.68,4.08,2.42,2.22,3.25,3.51,2.37,3.35,2.60,2.63,2.63,3.63,3.24,2.66,2.28,2.37,2.98,2.87,2.53,2.90,2.67,3.58,1.98,2.88,3.02,2.46,2.61,2.44,2.93)
def.vctr=c(2.92,2.64,4.29,3.71,2.64,4.07,2.68,2.59,2.34,2.49,2.81,3.93,2.48,2.91,2.80,3.09,2.32,2.89,2.42,2.20,2.34,2.98,3.38,2.82,2.82,2.49,2.56,3.20,3.37,2.01,2.13,1.60,1.77,2.39,2.60,2.67,2.06,3.38,2.18,2.85,2.85,2.74,2.75,2.16,2.40,2.90,3.68,2.24,1.54,3.09,2.21,3.78,2.16,5.82,2.88,2.30,2.79,1.81,1.85,2.76)
chodr.denom=2.74
win.prob.cts=matrix(0,59,59)
n.large=100
for(i in 1:59){
for(j in 1:59){
win.p=0
loss.p=0
tie.p=0
for(goals in 0:n.large){
if(goals>0){
win.p=dpois(goals,off.vctr[i]*def.vctr[j]/chodr.denom)*
ppois(goals-1,off.vctr[j]*def.vctr[i]/chodr.denom)+win.p
}#end if
tie.p=dpois(goals,off.vctr[i]*def.vctr[j]/chodr.denom)*
dpois(goals,off.vctr[j]*def.vctr[i]/chodr.denom)+tie.p
}#end for goals
win.prob.cts[i,j]=win.p+(off.vctr[i]*def.vctr[j])/(off.vctr[i]*def.vctr[j]+off.vctr[j]*def.vctr[i])*tie.p
}#end for j
}#end for i
win.prob.ot=matrix(0,59,59)
tie.prob.ot=matrix(0,59,59)
n.large=100
for(i in 1:59){
for(j in 1:59){
win.p=0
loss.p=0
tie.p=0
for(goals in 0:n.large){
if(goals>0){
win.p=dpois(goals,off.vctr[i]*def.vctr[j]/chodr.denom)*
ppois(goals-1,off.vctr[j]*def.vctr[i]/chodr.denom)+win.p
}#end if
tie.p=dpois(goals,off.vctr[i]*def.vctr[j]/chodr.denom)*
dpois(goals,off.vctr[j]*def.vctr[i]/chodr.denom)+tie.p
}#end for goals
win.ot.p=(off.vctr[i]*def.vctr[j])/(off.vctr[i]*def.vctr[j]+off.vctr[j]*def.vctr[i])*(1-exp(-(off.vctr[i]*def.vctr[j]+off.vctr[j]*def.vctr[i])/chodr.denom/12))
tie.ot.p=exp(-(off.vctr[i]*def.vctr[j]+off.vctr[j]*def.vctr[i])/chodr.denom/12)
win.prob.ot[i,j]=win.p+tie.p*win.ot.p
tie.prob.ot[i,j]=tie.p*tie.ot.p
}#end for j
}#end for i
I should note that this is inefficient... technically i can get away with saying that win.prob.cts[i,j]=1-win.prob.cts[j,i]
but I don't need this to be optimally fast, it'll only take a few seconds and I only need to do it once.
edit: and of course, its full of bugs... :-/
edit #2: here we go... I went by the alphabetical ordering of jtw's two letter codes (because that was the easiest way to encode)... and all those numbers are hand inputs using Robin Lock's figures.
Last edited: