Hi?
Here is a small excerpt of my dataset. I could do it using Excel, but it would take too much time and could potentially lead to errors.
This dataset is the result of three different races (RNO). Each time, a rating was established for the first-place finisher. This rating will not change.
Now I want to calculate the rating for the 2nd and 3rd place finishers of each race. This rating will take into account the distance of the race and the winner’s times (TIME), (TPS EP), and (400F).
I want to creat new columns : EP1 ; LF1; SR1
This the excel formula for each column :
SR1 = (1-(WIN_TIME/HORSE_TIME)^(RACE_DIST/1000))*1000
Example for RNO1=> (1- (95,08/95,15)^(1600/1000))*1000
same formula for the 3rd but HORSE_TIME change
EP1 = (1-(71,41/71,93)^(1200/1000))*1000
LF1 = (1-(23,67/23,22)^(400/1000))*1000
Is it doable? Considering there are many races and often more than 10 runners.
Thanks
Br essai.xlsx (10.2 KB)
Thanks for your quick answer.
My problem is when the distance change.
In the formula for example :
SR1 = (1-(WIN_TIME/HORSE_TIME)^(RACE_DIST/1000))*1000
Example for RNO1=> (1- (95,08/95,15)^(1600/1000))*1000
same formula for the 3rd but HORSE_TIME change
EP1 = (1-(71,41/71,93)^(1200/1000))*1000
LF1 = (1-(23,67/23,22)^(400/1000))*1000
FULL DISTANCE is 1600
If the distance is 1200 = SR1 race distanc echange in the formula
EP1 …^(800/1000))*1000
Thanks
Br
SR is calculated for full distance = 1600 => therefore ^1600/1000 in formula
EP is calculated for distance = 1200 => therefore ^ 1200/1000 in formula
LF is calculated for distance = 400 => therefore ^400/1000 in formula.
Means: if Distance is 1600 then column SR to be calculated, EP and LF not required
if Distance is 1200 then column to be EP to be calculated, SR and LF not required
if Distance is 400 then column LF to be calculated, SR and EP not required.
Is that correct? If so I think I can easily amend.
If it is always the same logic - i.e. race distance is x:
SR calculated with ^x/1000, EP with ^((x-400)/1000) and LF always with ^400/1000 then this should work universally.
If the logic deviates for other distances (for whatever reason - not a horse racing expert here ), then it might be worthwhile to put together a mapping table that maps distance to: SR factor, EP factor, LF factor… then the WF can be easily modified to accommodate a somewhat finite range of different calculation options.
Hi Martin,
I am moving forward with the same idea. I have created new columns to make it easier to analyze the evolution of the SR, EP, and LF calculations.
Column SR2 EP2 and LF2 are what i would like to have.
As you see column values never change for position 1. What I am trying to do is subtract the values we obtained from those corresponding to position 1. (attached file). Classeur1.xlsx (9.8 KB) horseracing.knwf (129.8 KB)
There is a calculation issue with the LF1 column. The other two are perfect. You can check the difference with this excel file. Classeur1.xlsx (9.8 KB)
Got it. Misclicked when choosing the flow variable in Expressions - used 400F column from first place instead of LF column - changed it to this so should now work: