# Class: Gaussian

Inherits:
Object
• Object
show all
Defined in:
lib/TrueSkill/Mathematics/guassian.rb

## Instance Attribute Summary collapse

• Returns the value of attribute mu.

• Returns the value of attribute pi.

• Returns the value of attribute sigma.

• Returns the value of attribute tau.

## Instance Method Summary collapse

• 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```

## Instance Method Details

### #*(y) ⇒ Object

 ``` 27 28 29 30 31``` ```# File 'lib/TrueSkill/Mathematics/guassian.rb', line 27 def *(y) pi=@pi+y.pi tau=@tau+y.tau return Gaussian.new(nil,nil,pi,tau) end```

### #/(y) ⇒ Object

 ``` 32 33 34 35 36``` ```# File 'lib/TrueSkill/Mathematics/guassian.rb', line 32 def /(y) pi=@pi-y.pi tau=@tau-y.tau return Gaussian.new(nil,nil,pi,tau) end```