Class: StochasticProcess::BrownianMotion

Inherits:
Base
  • Object
show all
Defined in:
lib/stochastic_process/brownian_motion.rb

Constant Summary

Constants inherited from Base

StochasticProcess::Base::DEFAULT_END_TIME, StochasticProcess::Base::DEFAULT_EVALUATIONS, StochasticProcess::Base::DEFAULT_START_TIME

Instance Attribute Summary

Attributes inherited from Base

#evaluations

Instance Method Summary collapse

Methods inherited from Base

#default_path_increment, #graph, #interval_length, #mesh, #mesh=

Constructor Details

#initialize(initial_position: 0.0, start_time: DEFAULT_START_TIME, end_time: DEFAULT_END_TIME, evaluations: DEFAULT_EVALUATIONS) ⇒ BrownianMotion

Returns a new instance of BrownianMotion.



9
10
11
12
13
14
15
16
# File 'lib/stochastic_process/brownian_motion.rb', line 9

def initialize(initial_position: 0.0,
  start_time: DEFAULT_START_TIME,
  end_time: DEFAULT_END_TIME,
  evaluations: DEFAULT_EVALUATIONS)
  super(initial_position: initial_position, start_time: start_time,
    end_time: end_time, evaluations: evaluations,
    path_increment: method(:brownian_path_increment))
end

Instance Method Details

#brownian_path_incrementObject



5
6
7
# File 'lib/stochastic_process/brownian_motion.rb', line 5

def brownian_path_increment
  return gaussian(0, 0.1)
end