View unanswered posts | View active topics It is currently Thu Mar 28, 2024 11:36 am



Reply to topic  [ 35 posts ]  Go to page 1, 2, 3  Next
 Game Stud Statistics: wrong math, best absent, hard to sort 
Author Message
Handicapper

Joined: Thu Sep 08, 2016 3:57 pm
Posts: 481
Post Game Stud Statistics: wrong math, best absent, hard to sort
Going to edit this to clean it up, and bump it, as I think it should be addressed for people new to breeding near release. The hardcore group here each has their own method, so the base stats you present in the table are less likely to be used by them. But for everyone else, and new players, the current stats in the stud summary are going to make breeding harder for no real game play reason.

The main issue is you are using ($stat / cumulative starts of progeny) not ($stat / # of progeny) or per offspring, not per runs of offspring. I'll list the stats that would be best for the game, and the order of importance. I'll leave out stats that are common but make little sense in the game (like percentage of foals to race, as I think we can assume all get sent to the training for the game). If you fix nothing else, at least calculate by (runner) not (runs / aka starts). So if a horse has 10 foals, and each one has run 10 times: three of the ten can't win a race in a walkover, but the other seven foals have won 20 races between them in their 10 starts each.

%winners from runners = 70% not 20%!

Seven out of ten of his foals can win a race. I really don't care if some silly trainer started the duds every week for 5 years times trying to get a win! I want to know my chances of getting a non-dud from the breeding. Or maybe the sire throws nearly all duds, and nine of ten race once and stop. But this one foal (G1 mare maybe?) just burns up the track and starts 91 times winning fifty of those starts. I want to see 10%, not 100 (50%).

And the current "100 (20%)" sorts poorly. How many cumulative starts all the foals have is fairly meaningless, I need to sort on how they did. And the bad stud would look like "100 (50%)" and the better one would look like "100 (20%)", which is not useful and misleading. But "70%" vs "10%" much better. Same for stakes wins.

The ideal stats are:

Ideal sorts would be, in order:
    1 - #AEI*,
    2 - # of offspring,
    3 - % of offspring that won a race,
    4 - % of offspring that won a stakes race,
    5 - % of offspring that won or placed in a stakes race,**
    6- $/£ average earnings per Offspring (sum of offspring earnings / # of offspring) ***

# are numbers, AEI is a number ( format #.## usually will be zero to maybe 10? so ##.## max), and the percentages should all be sortable on the number or percentage. So "276 (14%)" is a horrible sort. But "14%" is a fantastic sort.

*AEI = ((this horses earnings / runner) / (average earnings / runner of all studs this year)) So if this horse had $60K average earnings per runner, and the average earnings per runner of all studs that year was $50K per runner, then his AEI is 1.20. So basically this is calculated off column 6 (average earning / runner). Average column 6 at the end of each year and divide the horses individual number for column 6 into it.

** really helps sort quality of runners, so you can tell if the non-stakes winners were quality or claimers but I can see if you leave this off for size

*** The current "Money Won" lifetime sum of the foals but divide by how many of them there are. I had to go to the stud's info screen, count, then come back and divide.


So an example stud would look like: 1.12, 52, 60%, 8%, 15%, $60480
With the fertility, distance, going, fee: 1.12, 52, 60%, 8%, 15%, $60480, (F) 1m4f, soft, $5000

Every column sortable, and informative. And the first column should be default sort. If you don't do AEI, on the one with offspring, sort by avg earning per offspring, and on the one that has just the stud, sort by his lifetime earning as the default sorts.

The AEI should stop being updated when the stud's last foal leaves the game. So if offspring running that year is down to zero, you're done calculating it for that stud. The last number is the keeper. This was originally done to compare studs of different eras/locations due to the purses varying a lot over time/ in some areas. But since purses don't vary over time in the game, it may not matter if it gets updated for historical studs. Then again, it would help performance to skip it. However, if I had to condense "is this stud worth breeding to" to one number, this one is it. And if I can't have that, the non-indexed base average earnings per foal to race is next best.


Last edited by Hechicera on Sun Mar 31, 2019 4:12 am, edited 3 times in total.



Mon Feb 04, 2019 7:10 pm
Profile
Handicapper

Joined: Thu Sep 08, 2016 3:57 pm
Posts: 481
Post Re: Game Stud Statistics: wrong math, best absent, hard to s
Going to bump this, like I said I would in the General Discussion area. I think it is important since you are calculating the stats improperly. Here is a clip of a pedigree nick chart from equibase:

Image

They list starts for Mr. Prospector & Danzig as prep info ...

1195 is how many foals Mr.P had registered. 986 was how many of those foals started in a race. This is the stat I think we can eliminate. The game doesn't care if the sire is a half-time sport horse sire. ;)

The third column is winners % "755 (63)"
That is 63% of his foals can win a race. 755 / 1195 = .6318
Nothing to do with how many starts to win those races.

BW% "182 (15)" = 192 / 1195 = .1523 that is his percentage stakes winners (Black Type).

His AEI is the last column 3.91, not bad. That means his foals earned nearly four times more than other foals of other sires in his era, on average.

If listed in game I'd expect to see him as:

Mr.P 3.91 1195 63% 15% (30%?) $82,017 6f good $400,000

AEI 3.91
% of Offspring 1195
% of Offspring to win race 63%
% of Offspring to win stakes 15%
% of Offspring to be stakes placed 30%? (guess)
Average earning of Offspring $82,017 ($98,010,963 / 1195)
Distance: 6f
Going: good
Fee: $400K

So to make it easy, This random new AI stud from my game:

Image

You list as 1/8 (12%) but that is 8 starts, not 3 Offspring to race. Shouldn't count the 1 &2 yr olds at start of year, so:

ThisStud (0.12) 3 33% 0% 0% £2162 6f good £4500

Guessing his AEI, it would be pretty low. One of three offspring to start so far, one has won (33%), no stakes wins or places for that foal (0% 0%). Ironically also a 6f sprinter. £2162 is sum earnings / 3 Offspring that have records.


Sat Mar 30, 2019 9:23 am
Profile
Site Admin
User avatar

Joined: Fri Feb 02, 2007 5:15 pm
Posts: 2233
Post Re: Game Stud Statistics: wrong math, best absent, hard to s
Thanks for posting all this. Some improvements have been made 0.106. The breeding stats side of things is not really my thing so please continue to give feedback. Sometimes it takes a while for me to get around to things.

The totals wins/runs and stakes wins/runs have been replaced with 'winners' the number of actually winners rather than wins. And also the percentage (that is used for sorting). Same for stakes wins.

An AEI field has been added. It uses the average earnings of every (active) horse with form against the average earnings of all live first gen offspring (with form).

The AEI should be accurate if I have got the maths right. It does not use running totals but makes the calculations when the user clicks to view (unless no racing has taken place since the last view). The numbers look a little low so there could be a problem with the calcs or someplace unrelated.


Mon Apr 01, 2019 4:56 pm
Profile
Handicapper

Joined: Thu Sep 08, 2016 3:57 pm
Posts: 481
Post Re: Game Stud Statistics: wrong math, best absent, hard to s
Yay! More AEI calc info below, the numbers could be off with that method. The "offspring with form" is the perfect filter for calculating. But you can't calculate it vs all horses with form. You have to divide by the average of the other studs for it to have any statistical relevance, since it is a stud to stud comparison. ((One reason stud owners like to use max earnings of offspring, is because people without agents may get sucked in by a big number, that isn't relevant. It is fine for all time leader charts, but ... ))

For every stud, you already have total earnings of offspring. But what is the ideal sort is:
[Avg Earnings/Offspring] = Total Earnings / # of Offspring with Form
I think you can keep that updated on the fly in the table, as the fields needed are already there (just in different places in the UI). That should be what is in the stud table as a sort, not the Total Earnings. Leaving that for your all-time brag stat page though is just fine.

Then, if there is a point in the game year: Calculate the average of that field Avg ( Sum ([Avg Earnings/Offspring] )/ # Studs providing non-zero result). I wouldn't try calculating that Average of the Average Earnings / Offspring on the fly. Save it once per year is good, use most recent to calculate AEI It should not change much year to year as the in-game purses won't vary through history. That is the number to use as divisor for AEI, until next end of year and then update it. If it doesn't vary much from what you are doing, then fine, but I'd check.

So then calculate a Studs individual AEI, either on demand, or at the same time as you get the most recent year's average as:
This Stud's [Avg Earnings/Offspring] / saved ( Avg ( Sum ([Avg Earnings/Offspring] / # Studs providing non-zero result))).

So for simplicity, four studs have offspring with form, snapshot at end of year:

Their [Avg Earnings/Offspring]
Stud 1 : 50K £/foal
Stud 2: 70k £/foal
Stud 3: 40k £/foal
Stud 4: 40k £/foal

Snapshot divisor AVG of those so, Sum ( 50+70+40+40) / 4 = 50K.

So AEI's:
Stud 1 : 1.00 (50/50)
Stud 2: 1.40 (70/50)
Stud 3: 0.90 (40/50)
Stud 4: 0.90 (40/50)

New stud the next year has first crop to race, avg earnings is 60 £/foal (great 2yo sprint sire!), you can calc his AEI as 1.20 on the fly that next year safely. But at least every year, once, you need to find your divisor per stud, as it may change some based on races scheduled.

The resulting numbers should be evenly weighted around 1.00, with numbers greater than 3.00 as amazing, and numbers under 0.50 as best used only if have thing you need / best can afford. Ideally, player should always try to find one above 1.0 to get a "better horse than average" by earnings. Of course, then the other fields come into play, like what is my percentage chance off that stud to get one of the good ones (of his). Horses that have only had 2 and 2 or 3 yr old crops to race, that are slow maturing will have a lower number than expected until the first crop to race is the peak maturity year (which is normal).

So with potentially AEI touched up, and "Money Won" replaced with "Avg Earnings" then the "Current International top sires" tab would be perfect. And if you replace the "Money Won" with the average (that / #Offspring with form), even without AEI it would be very good, since it is just a weighting of that field. Though, with AEI people can do real fantasy comparisons and see how their stud's AEI's fares compared to history's greats. Which is nice for a sports fantasy game. :)

Adding: just looked, AEI's are in the right ranges, but may be less accurate - would have to see vs proper to know how much. The % sorts are perfect! I immediately spot a couple promising newer studs I missed, a couple with bargain fees! And the stud in my game with the second highest AEI I had already figured (he just sired my derby winner). :) The one with the highest may be an artifact, it is oddly high. I'll know if it changes with touched up AEI calc. I've not gotten many nice foals off him, but his %winners is lower. ;) Useful sorts, yes!

Related Feedback: Also, for better challenge, perhaps on normal/hard. As a stud's AEI or Avg Earnings / Offspring rises, so should their fee! Initial setting as a factor of the stud's earnings (as you already do) is good. A correct game %winners from foals stat should help you with tuning I would think. I gives the players pretty good feedback on the AI stud they chose as well. I will add that the breeding looks nice overall. Mare family "black type" analysis works as expected. Looking at dam of potential sire or broodmare and see if she produced stakes winners of the type you want, it works. That was fun to see.


Tue Apr 02, 2019 12:57 am
Profile
Handicapper

Joined: Mon Dec 03, 2018 2:17 pm
Posts: 150
Post Re: Game Stud Statistics: wrong math, best absent, hard to s
Liking this a lot. Great spot and great inclusion. Well done both 8)


Tue Apr 02, 2019 11:28 am
Profile
Handicapper

Joined: Thu Sep 08, 2016 3:57 pm
Posts: 481
Post Re: Game Stud Statistics: wrong math, best absent, hard to s
Thanks, was driving me nuts, esp. as I can see from the abbreviations used in most stud glossies and website tables how you might have thought the math was the way he did it at first.

In the interest of clarity, now I'm posting after more sleep (family emergencies) here is the column that still needs to be adjusted to be sorted, as Money Won is less than helpful, but that number divided by [# of foals with form] is a very useful sort. As that sorts how good are his foals, rather than has this stud been popular, but maybe not as good. So I need to see the adjusted number to understand expected foal quality.

Image

That is the change I'm going on about in blue/green text above. And that is the thing you average once a year to get divisor for AEI. That table should use "Avg Earned" gotten as shown, and be sortable as such instead of total "Money Won" there. But ...

Now in this table below, since it is an all time brag number, is just fine.

Image

Historical bragging rights has a nod to popularity as well as quality. Good as is.

(and my long post above on AEI calc stands. Calculating the one global variable divisor per year is probably needed, and recalcing that divisor per year. Use on fly of that divisor without recalcing in the next year should be accurate.)


Tue Apr 02, 2019 6:27 pm
Profile
Site Admin
User avatar

Joined: Fri Feb 02, 2007 5:15 pm
Posts: 2233
Post Re: Game Stud Statistics: wrong math, best absent, hard to s
Patch 0.107 contains further improvements.


Wed Apr 03, 2019 11:47 am
Profile
Handicapper

Joined: Thu Sep 08, 2016 3:57 pm
Posts: 481
Post Re: Game Stud Statistics: wrong math, best absent, hard to s
Hard to check the math with the new toggle:

Quote:
Option to include expired horses in offspring list.


The number listed in the table is the one that *does not* include expired horses, which may be just because it is last year's and I only ran the game two weeks. Calculating any of %winners, %stakes winners, avg earned per foal, and AEI off that number mean little if it does not include all foals with form. Imagine if a sire's best crop was the first and you leave it off as they are mostly retired, or conversely the first four crops were just horrible, but he has two good two year olds this year.

So I can't check AEI math without seeing the calculated avg earnings/ foal with expired horses. That isn't available on the sires page (and as I said the table view uses outdated).

BUT!

From looking at specific AI sires in my game and watching what numbers changed and seeing the recalculated AEI, the one I thought was an artifact went from 8.90 (impossibly high really) down to 0.12, which may be too low as some of his better horses are expired. His percentage winners also really got low, about what I thought it would be with expired in there. The one AI stud that gets consistently good horses went from 3.37 (already nice) to 6.29. So it looks better!

I see no reason for the "Option to include expired horses in offspring list." checkbox? Maybe for display only but never for the math.

If I can get the (includes expired) numbers to the table, I am still not bad with the number keypad and can probably verify the numbers look sane, but I can't calculate avg earnings for every stud in the game based off just their detail sheet!

Still need:
Math with expired horses, and propagate that math to the table as the Avg Earning sort, and % winners, % stakes winners stats (AEI will follow naturally). The numbers at weekend looked better.

(Aside #1)
The stud that was listed as the artifact w/o AEI & avg earnings or %winners was always being listed as the #2 AI stud prior to these changes. But really he had two good foals .. they were just really good! So now he can be sorted as a long shot producer that will most likely give you a dud that he is. This should help a lot with breeding complaints.

(Aside #2 below)
Also, I'll know when I see the numbers with expired foals, but ... a very good sire should be more than 70% foals to race can win. A good regional one should still get around 60% on that stat. Once you go down to 50% it becomes a poor gamble of a mare's year. If the horses with good records are producing under 50% then the spread may need to be made more of a bell curve. So some foals are still duds, some are better than parents, but this is more rare than now, and most will be between. I'll need a game with 20+ seasons and the real stats to know for sure, but preliminary looking at "includes expired" the %winner is lower than expected across the board for quality studs. And remember the bar for that stat is "win a race", sure maybe it's a seller at 3, but it's a win. ;) It can be hard to correlate exactly to real breeding as game studs take any mare if the player has money, whereas real studs may turn down your crappy mare if its offspring may lower their stud's stats (and later fees!). ;) So there may be merit to breeding complaints of too many duds.


Fri Apr 05, 2019 1:39 am
Profile
Site Admin
User avatar

Joined: Fri Feb 02, 2007 5:15 pm
Posts: 2233
Post Re: Game Stud Statistics: wrong math, best absent, hard to s
I intentionaly did not include expired horses in the AEI calcs because as the game goes on it would cause increasing processing delays. The include expired horses options probably confuses things. It was intended as an option so the player can view the expired horses only.


Fri Apr 05, 2019 12:49 pm
Profile
Handicapper

Joined: Thu Sep 08, 2016 3:57 pm
Posts: 481
Post Re: Game Stud Statistics: wrong math, best absent, hard to s
Then I would leave AEI off, as it would be misleading quickly. I was worried about overhead. That is why I suggested calcing it at year end only.

If you store with the stud however the sum of earnings, and keep a count of his foals to have form, save those two fields with a stud always, then you should always be able to produce a AvgEarned (with expired).

I ask since it looks like you could before trying AEI always keep an accurate "Money Won" total. So with that and an accurate, offspring with form even if expired count, you have one cheap division to do. That AvgEarned field is still gold, if accurate, and AEI is just an all time stud to stud weighting of that number. So AEI is just a short and dirty AvgEarned ranking, really. Getting AvgEarned accurate is, in just my opinion, needed as a sort somehow.

Then the percentage winners and percentage stakes winners still need to be kept up to date with expired, as they also may be misleading if they leave out whole crops, only include partial crops. I think knowing %winners and %stakeswinners is also important, and can lower player frustration to have those avaialable. It also adds to interesting decisions. Go with the solid producer with fewer stakes winners? Go with the one that produces more stakes winners but more duds? Interesting choices, good gameplay. It would also be helpful in breeding tuning, as you can see what the numbers should look like in real life. (like say FIFA avg goals per match ... you know them, and if the numbers are way less than 1 even for great teams there is a problem, or of the numbers are all 20+ even for bad teams, well ok problem!)

But if you keep four fields on the stud:
- stud.M - running total of money earned (increment any race by progeny)
- stud.X - number of off spring with form (check if need to +1 on race by progeny)
- stud.W - number of offspring to break maiden (check if need to +1 on race by progeny)
- stud.S - number of offspring to win a stakes (check if first feature win to +1 on any race by progeny)

Then
M/X is always good AvgEarn
W/X is always good %winners
S/X is always good %stakes winners

And post race you need to, for each horse
- if raced,
is first race? +1 runner->sire.X,
is in money? add winnings to runner->sire.M
- if winner,
is first win? +1 runner->sire.W
is first black type race win? +1 runner->sire.S

The accurate AvgEarn then becomes the best sort daily/weekly.

Adding AEI (year end calc only) then becomes simpler, as it becomes, at year end.

/* get yearly divisor
AEI_Divisor = 0
loop studs (1->N)
AEI_Sum=0
AEI_Count=0
if stud.X > 0
AEI_Count+1
AEI_Sum = AEI_Sum + (stud.M / stud.X)
End Loop
AEI_Divisor = AEI_Sum / AEI_Count
/* end yearly divisor calc

/* now for AEI, if save as field
loop studs (1->N)
stud.AEI = (stud.M / stud.X) / AEI_Divisor

Of course add if zero divisor check for first year or so of form building if needed.

And if the above is feasible, processing and data stucture-wise, then you can see if adding back an on the fly AEI may work by:

Game global variable AEI_Divisor =0

Update using loop at end of year, then for on-demand it is there, don't calc it more than 1x/year using "/* get yearly divisor".

So on demand becomes the one line from stud loop, with (if zero skip check for first form years)
stud.AEI = (stud.M / stud.X) / AEI_Divisor

I don't think you can keep them accurate without adding the data into the stud's data structure, and certainly can't without the post-race processing, as that is cheaper than database sort. You would need to access the sire of every runner. But I would expect you keep a pointer to each horse's sire and dam in it's data structure.

That is the lowest overhead way I can think of off the top of my head. Long retired from database and stat's programming though.

However you do it, an accurate number is best, and an inaccurate one is worse than no number at all. So limit the release table/stud detail choices to the ones you can process accurately (which includes expired), since an inaccurate number will make for frustrated game play choices. I understand there are trade offs.


Fri Apr 05, 2019 4:57 pm
Profile
Handicapper

Joined: Thu Sep 08, 2016 3:57 pm
Posts: 481
Post Re: Game Stud Statistics: wrong math, best absent, hard to s
AEI_Divisor calculation including only studs with at least one active runner the past year is fine (correct even), but the AvgEarned must be of all of their foals, including expired offspring.

And the point of shoving the stats into the stud data structure means you no longer need to touch their offspring records to calculate those numbers. You could even save AEI in the stud data structure. Then if it only gets recaculated after a week's racing, you would no longer need to touch it or recalc it after their last foal retired (which is also statistically correct for that stat). So that would save further DB searches, and be more statistically correct to boot.

Trying to be clear.


Fri Apr 05, 2019 5:32 pm
Profile
Handicapper

Joined: Thu Sep 08, 2016 3:57 pm
Posts: 481
Post Re: Game Stud Statistics: wrong math, best absent, hard to s
Something must still be off. I started a combo game (bug where you can hire a jumps apprentice as jockey and flat apprentice with jumps selected is still there btw).

Ran it 10 years auto then looked at the table. Sorted by black type winners and ...

Image

This is not mathematically possible. if only 16 percent of his horses can win a race then 100% of his foals can't be black type winners.

Code:
- stud.M - running total of money earned (increment any race by progeny)
- stud.X - number of off spring with form (check if need to +1 on race by progeny)
- stud.W - number of offspring to break maiden (check if need to +1 on race by progeny)
- stud.S - number of offspring to win a stakes (check if first feature win to +1 on any race by progeny)

Then
M/X is always good AvgEarn
W/X is always good %winners
S/X is always good %stakes winners


So if X is 12, W = 2 then 2/12 16% is right, if one of those two was a black type winner S=1 then 1/12 8%.
But if winners% and stakes winners% are both a percentage of foals to race the best they can be is equal in the unlikely event a horse as only a few foals to race and they all win stakes. Not sure what was up, since with 10 years form couldn't see all the foals to verify. Also in my divisor calc, all zeroing of sums need to be outside the loop. Very tired, sorry.

Again, while the AEI and %winners look good, again, if AEI is to costly, since it is just a short hand ranking of AvgEarned, getting AvgEarned and a correct %winners and %blacktype would allow for proper grading of studs.


Sun Apr 14, 2019 6:16 pm
Profile
Site Admin
User avatar

Joined: Fri Feb 02, 2007 5:15 pm
Posts: 2233
Post Re: Game Stud Statistics: wrong math, best absent, hard to s
Please try 0.112. The calculations were wrong relating to the Stakes winners/runners.


Mon Apr 15, 2019 3:16 pm
Profile
Handicapper

Joined: Thu Sep 08, 2016 3:57 pm
Posts: 481
Post Re: Game Stud Statistics: wrong math, best absent, hard to s
Just did, same test a combo 10 years run.

Numbers looks sane, great. And the apprentice/jockey hire mix up looks fixed too. Thanks.

Yay!

Now to check out my preferred mode! Several flat sires have really good AEI's and three of the better ones have %winners over 50%. And I spot on each jumps and flat at least one horse with a solid AEI, nice %winners and good %blacktype, and those are cheaper. Promising! So now to see if that all works out as expected, with a new game I don't know what they throw unlike my flat game where I had 15+ breedings to several AI studs. But this game did have two starting mares that look ... ok. Not bad for a "normal" start, with no fishing. See how exciting this is? :)


Mon Apr 15, 2019 7:16 pm
Profile
Handicapper

Joined: Thu Sep 08, 2016 3:57 pm
Posts: 481
Post Re: Game Stud Statistics: wrong math, best absent, hard to s
After fiddling some more last night, not far enough to do breedings, two more comments. These are both UI related to the new stats.

On the individual horse Offspring detail screen:

AEI on a mare (esp using the same divisor as average sire earning) makes just no sense. Could maybe not calc it for better performance? But at least not display it.

The stakes winner % still seems the off calculation displayed in this tab (but is good in table).


Tue Apr 16, 2019 3:47 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 35 posts ]  Go to page 1, 2, 3  Next

Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.