Module: RandomVariable

Included in:
Tests::Poisson
Defined in:
lib/distros.rb,
lib/random_variable.rb

Overview

# File: distros.rb #

#

#

Author: Jorge F.M. Rinaldi # Contact: [email protected] #

#

#

Date: 2012/11/28 #

#

Defined Under Namespace

Modules: Sampleable, Samples, Tests Classes: Bernoulli, Beta, Binomial, ChiSquared, ContinuousUniform, DiscreteUniform, Exponential, F, Generic, Normal, Pareto, Poisson, Rademacher, Rayleigh, Rectangular

Class Method Summary collapse

Class Method Details

.listArray

obtain a list of the different available random variable class objects

Returns:

  • (Array)

    list of random variable class objects



63
64
65
66
67
68
69
70
71
72
# File 'lib/random_variable.rb', line 63

def self.list
	distros = []
	self.constants.each do |c|
		c = self.const_get(c)
		if c.is_a? Class and c != self::Generic then
			distros << c
		end
	end
	distros
end

.new_seedNumeric

obtain and set an arbitrary new seed

Returns:

  • (Numeric)

    the new seed



41
42
43
# File 'lib/random_variable.rb', line 41

def self.new_seed
	Generator::new_seed
end

.seedNumeric

obtain the current seed in use

Returns:

  • (Numeric)

    the current seed



48
49
50
# File 'lib/random_variable.rb', line 48

def self.seed
	Generator::seed
end

.seed=(new_seed) ⇒ Numeric

set and reset the seed to a new seed

Parameters:

  • new_seed (Numeric)

    new seed

Returns:

  • (Numeric)

    the new just set seed



56
57
58
# File 'lib/random_variable.rb', line 56

def self.seed=(new_seed)
	Generator::seed = new_seed
end