Class: Gaussian
- Inherits:
-
Object
- Object
- Gaussian
- Defined in:
- lib/TrueSkill/Mathematics/guassian.rb
Instance Attribute Summary collapse
-
#mu ⇒ Object
Returns the value of attribute mu.
-
#pi ⇒ Object
Returns the value of attribute pi.
-
#sigma ⇒ Object
Returns the value of attribute sigma.
-
#tau ⇒ Object
Returns the value of attribute tau.
Instance Method Summary collapse
- #*(y) ⇒ Object
- #/(y) ⇒ Object
-
#initialize(mu = nil, sigma = nil, pi = 0, tau = 0) ⇒ Gaussian
constructor
A new instance of Gaussian.
Constructor Details
#initialize(mu = nil, sigma = nil, pi = 0, tau = 0) ⇒ Gaussian
Returns a new instance of Gaussian.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/TrueSkill/Mathematics/guassian.rb', line 5 def initialize(mu=nil,sigma=nil,pi=0,tau=0) if not mu.nil? if sigma.nil? or sigma==0.0 raise "a variance(sigma^2) should be greater than 0" end pi=sigma**-2 tau=pi*mu end @pi=pi @tau=tau end |
Instance Attribute Details
#mu ⇒ Object
Returns the value of attribute mu.
2 3 4 |
# File 'lib/TrueSkill/Mathematics/guassian.rb', line 2 def mu @mu end |
#pi ⇒ Object
Returns the value of attribute pi.
2 3 4 |
# File 'lib/TrueSkill/Mathematics/guassian.rb', line 2 def pi @pi end |
#sigma ⇒ Object
Returns the value of attribute sigma.
2 3 4 |
# File 'lib/TrueSkill/Mathematics/guassian.rb', line 2 def sigma @sigma end |
#tau ⇒ Object
Returns the value of attribute tau.
2 3 4 |
# File 'lib/TrueSkill/Mathematics/guassian.rb', line 2 def tau @tau end |