Class: EMAlgorithm::Model

Inherits:
Object
  • Object
show all
Defined in:
lib/em_algorithm/models/model.rb

Direct Known Subclasses

Gaussian, MdGaussian, Mixture

Constant Summary collapse

DIGIT =

round digit for gnuplot

6

Instance Method Summary collapse

Instance Method Details

#pdf(x) ⇒ Object



6
7
8
9
# File 'lib/em_algorithm/models/model.rb', line 6

def pdf(x)
  # method "probability_density_function" must be implemented
  probability_density_function(x)
end

#value_distribution(const, x) ⇒ Object



11
12
13
# File 'lib/em_algorithm/models/model.rb', line 11

def value_distribution(const, x)
  const * pdf(x)
end

#value_distribution_to_gnuplot(const) ⇒ Object



15
16
17
# File 'lib/em_algorithm/models/model.rb', line 15

def value_distribution_to_gnuplot(const)
  "#{const.round(DIGIT)}*(#{to_gnuplot(:mixture_only)})"
end