Yes, there is a formula.
Number of races on the previous season = N
In Elite:
With a 5* CD you will get:
Strength: N*3
Neutral: N*2
Weakness: N*1
With a 4.5* CD you will get:
Strength: (N*3)-2
Neutral: (N*2)-1
Weakness: (N*1)-1
In Pro:
With a 5* CD you will get:
Strength: N*1.5
Neutral: N*1
Weakness: N*0.5
With a 4.5* CD you will get:
Strength: (N*1.5)-1
Neutral: (N*1)-1
Weakness: (N*0.5)-1
I don't know the values for Rookie, but it might follow the same pattern.
You also need to use the same CD all season to get those values!
For other star ratings you will need to check Kevin's table (
here) on it and work out the proportions and values, but it will damage your research power.
Hope it helped.