-
Notifications
You must be signed in to change notification settings - Fork 1
/
constants.go
51 lines (42 loc) · 1.15 KB
/
constants.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package openskill
func z(options *Options) float64 {
if options != nil && options.StandardizedPlayerSkill != nil {
return *options.StandardizedPlayerSkill
}
return 3
}
func mu(options *Options) float64 {
if options != nil && options.AveragePlayerSkill != nil {
return *options.AveragePlayerSkill
}
return 25
}
// this tau function is kept here for the sake of keeping a similar structure to the original code, even though is unused
func tau(options *Options) float64 {
if options != nil && options.Tau != nil {
return *options.Tau
}
return mu(options) / 300
}
func sigma(options *Options) float64 {
if options != nil && options.SkillUncertaintyDegree != nil {
return *options.SkillUncertaintyDegree
}
return mu(options) / z(options)
}
func epsilon(options *Options) float64 {
if options != nil && options.SmallPositive != nil {
return *options.SmallPositive
}
return 0.0001
}
func beta(options *Options) float64 {
return sigma(options) / 2
}
func betaSq(options *Options) float64 {
if options != nil && options.VarianceForTeamPerformance != nil {
return *options.VarianceForTeamPerformance
}
beta := beta(options)
return beta * beta
}