stochastic_process 0.0.1a → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +2 -31
- data/lib/stochastic_process/version.rb +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -1,14 +1,8 @@
|
|
1
1
|
# StochasticProcess
|
2
2
|
|
3
|
-
|
4
|
-
stochastic processes. As an example, the class StochasticProcess:BrownianMotion
|
5
|
-
is included that defines a standard Brownian motion process.
|
6
|
-
|
7
|
-
Checkout the [sample app](http://stochasticprocess.herokuapp.com/)
|
3
|
+
TODO: Write a gem description
|
8
4
|
|
9
5
|
## Installation
|
10
|
-
*Note that this gem requires at least Ruby 2.0.0* because I decided to try out [keyword arguments](http://dev.af83.com/2013/02/18/ruby-2-0-keyword-arguments.html).
|
11
|
-
The linked article describes how to re-write the code to make it work for older Ruby versions.
|
12
6
|
|
13
7
|
Add this line to your application's Gemfile:
|
14
8
|
|
@@ -24,30 +18,7 @@ Or install it yourself as:
|
|
24
18
|
|
25
19
|
## Usage
|
26
20
|
|
27
|
-
|
28
|
-
- `initial_position`: default is 0. This is the point where the stochastic process
|
29
|
-
starts
|
30
|
-
- `start_time`: default is 0. This is the time at which the stochastic process starts
|
31
|
-
- `end_time`: default is 100. This is the time up to which the stochastic process is simulated.
|
32
|
-
- `evaluations`: default is 1000. This defines at how many points the stochastic process will be evaluated.
|
33
|
-
- `path_increment`: default is 0. This function returns the increment of the path from one time point to the next.
|
34
|
-
|
35
|
-
The most important part of the base class is the `path_increment` function. Inherting from `StochasticProcess::Base` one can easily define new stochastic processes by implementing the corresponding `path_increment` function.
|
36
|
-
|
37
|
-
So far only Brownian motion is implemented - the following creates a Brownian
|
38
|
-
motion and stores the path as pairs of `x` and `y` values in an array
|
39
|
-
|
40
|
-
b = StochasticProcess::BrownianMotion.new(initial_position, start_time, end_time, evaluations)
|
41
|
-
bm_path1 = b.graph # first sample path of Brownian motion
|
42
|
-
bm_path2 = b.graph # second sample path of Brownian motion
|
43
|
-
|
44
|
-
Creating a new class is easy once the function that constructs the path
|
45
|
-
increments is implemented: simply inherit from `StochasticProcess::Base` and
|
46
|
-
pass the new path increment function as the last parameter to the constructor, see `lib/brownian_motion.rb`
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
21
|
+
TODO: Write usage instructions here
|
51
22
|
|
52
23
|
## Contributing
|
53
24
|
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stochastic_process
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Alexander Potrykus
|
@@ -114,9 +114,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
114
114
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
115
|
none: false
|
116
116
|
requirements:
|
117
|
-
- - '
|
117
|
+
- - '>='
|
118
118
|
- !ruby/object:Gem::Version
|
119
|
-
version:
|
119
|
+
version: '0'
|
120
120
|
requirements: []
|
121
121
|
rubyforge_project:
|
122
122
|
rubygems_version: 1.8.25
|