option_lab 0.1.0
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.
- checksums.yaml +7 -0
- data/.rspec +3 -0
- data/.rubocop.yml +139 -0
- data/.yard/hooks/before_generate.rb +7 -0
- data/.yardopts +11 -0
- data/Gemfile +26 -0
- data/LICENSE.txt +21 -0
- data/README.md +180 -0
- data/Rakefile +44 -0
- data/docs/OptionLab/BinomialTree.html +1271 -0
- data/docs/OptionLab/BjerksundStensland.html +2022 -0
- data/docs/OptionLab/BlackScholes.html +2388 -0
- data/docs/OptionLab/Engine.html +1716 -0
- data/docs/OptionLab/Models/AmericanModelInputs.html +937 -0
- data/docs/OptionLab/Models/ArrayInputs.html +463 -0
- data/docs/OptionLab/Models/BaseModel.html +223 -0
- data/docs/OptionLab/Models/BinomialModelInputs.html +1161 -0
- data/docs/OptionLab/Models/BlackScholesInfo.html +967 -0
- data/docs/OptionLab/Models/BlackScholesModelInputs.html +851 -0
- data/docs/OptionLab/Models/ClosedPosition.html +445 -0
- data/docs/OptionLab/Models/EngineData.html +2523 -0
- data/docs/OptionLab/Models/EngineDataResults.html +435 -0
- data/docs/OptionLab/Models/Inputs.html +2241 -0
- data/docs/OptionLab/Models/LaplaceInputs.html +777 -0
- data/docs/OptionLab/Models/Option.html +736 -0
- data/docs/OptionLab/Models/Outputs.html +1753 -0
- data/docs/OptionLab/Models/PoPOutputs.html +645 -0
- data/docs/OptionLab/Models/PricingResult.html +848 -0
- data/docs/OptionLab/Models/Stock.html +583 -0
- data/docs/OptionLab/Models/TreeVisualization.html +688 -0
- data/docs/OptionLab/Models.html +251 -0
- data/docs/OptionLab/Plotting.html +548 -0
- data/docs/OptionLab/Support.html +2884 -0
- data/docs/OptionLab/Utils.html +619 -0
- data/docs/OptionLab.html +133 -0
- data/docs/_index.html +376 -0
- data/docs/class_list.html +54 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +503 -0
- data/docs/file.LICENSE.html +70 -0
- data/docs/file.README.html +263 -0
- data/docs/file_list.html +64 -0
- data/docs/frames.html +22 -0
- data/docs/index.html +263 -0
- data/docs/js/app.js +344 -0
- data/docs/js/full_list.js +242 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +1974 -0
- data/docs/top-level-namespace.html +110 -0
- data/examples/american_options.rb +163 -0
- data/examples/covered_call.rb +76 -0
- data/lib/option_lab/binomial_tree.rb +238 -0
- data/lib/option_lab/bjerksund_stensland.rb +276 -0
- data/lib/option_lab/black_scholes.rb +323 -0
- data/lib/option_lab/engine.rb +492 -0
- data/lib/option_lab/models.rb +768 -0
- data/lib/option_lab/plotting.rb +182 -0
- data/lib/option_lab/support.rb +471 -0
- data/lib/option_lab/utils.rb +107 -0
- data/lib/option_lab/version.rb +5 -0
- data/lib/option_lab.rb +134 -0
- data/option_lab.gemspec +43 -0
- metadata +207 -0
@@ -0,0 +1,251 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Module: OptionLab::Models
|
8
|
+
|
9
|
+
— OptionLab Documentation
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "OptionLab::Models";
|
19
|
+
relpath = '../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../_index.html">Index (M)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../OptionLab.html" title="OptionLab (module)">OptionLab</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">Models</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Module: OptionLab::Models
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<dl>
|
80
|
+
<dt>Defined in:</dt>
|
81
|
+
<dd>lib/option_lab/models.rb</dd>
|
82
|
+
</dl>
|
83
|
+
|
84
|
+
</div>
|
85
|
+
|
86
|
+
<h2>Defined Under Namespace</h2>
|
87
|
+
<p class="children">
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Models/AmericanModelInputs.html" title="OptionLab::Models::AmericanModelInputs (class)">AmericanModelInputs</a></span>, <span class='object_link'><a href="Models/ArrayInputs.html" title="OptionLab::Models::ArrayInputs (class)">ArrayInputs</a></span>, <span class='object_link'><a href="Models/BaseModel.html" title="OptionLab::Models::BaseModel (class)">BaseModel</a></span>, <span class='object_link'><a href="Models/BinomialModelInputs.html" title="OptionLab::Models::BinomialModelInputs (class)">BinomialModelInputs</a></span>, <span class='object_link'><a href="Models/BlackScholesInfo.html" title="OptionLab::Models::BlackScholesInfo (class)">BlackScholesInfo</a></span>, <span class='object_link'><a href="Models/BlackScholesModelInputs.html" title="OptionLab::Models::BlackScholesModelInputs (class)">BlackScholesModelInputs</a></span>, <span class='object_link'><a href="Models/ClosedPosition.html" title="OptionLab::Models::ClosedPosition (class)">ClosedPosition</a></span>, <span class='object_link'><a href="Models/EngineData.html" title="OptionLab::Models::EngineData (class)">EngineData</a></span>, <span class='object_link'><a href="Models/EngineDataResults.html" title="OptionLab::Models::EngineDataResults (class)">EngineDataResults</a></span>, <span class='object_link'><a href="Models/Inputs.html" title="OptionLab::Models::Inputs (class)">Inputs</a></span>, <span class='object_link'><a href="Models/LaplaceInputs.html" title="OptionLab::Models::LaplaceInputs (class)">LaplaceInputs</a></span>, <span class='object_link'><a href="Models/Option.html" title="OptionLab::Models::Option (class)">Option</a></span>, <span class='object_link'><a href="Models/Outputs.html" title="OptionLab::Models::Outputs (class)">Outputs</a></span>, <span class='object_link'><a href="Models/PoPOutputs.html" title="OptionLab::Models::PoPOutputs (class)">PoPOutputs</a></span>, <span class='object_link'><a href="Models/PricingResult.html" title="OptionLab::Models::PricingResult (class)">PricingResult</a></span>, <span class='object_link'><a href="Models/Stock.html" title="OptionLab::Models::Stock (class)">Stock</a></span>, <span class='object_link'><a href="Models/TreeVisualization.html" title="OptionLab::Models::TreeVisualization (class)">TreeVisualization</a></span>
|
93
|
+
|
94
|
+
|
95
|
+
</p>
|
96
|
+
|
97
|
+
|
98
|
+
<h2>
|
99
|
+
Constant Summary
|
100
|
+
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
101
|
+
</h2>
|
102
|
+
|
103
|
+
<dl class="constants">
|
104
|
+
|
105
|
+
<dt id="PRICING_MODELS-constant" class="">PRICING_MODELS =
|
106
|
+
<div class="docstring">
|
107
|
+
<div class="discussion">
|
108
|
+
<p>Add pricing model constant to the existing models</p>
|
109
|
+
|
110
|
+
|
111
|
+
</div>
|
112
|
+
</div>
|
113
|
+
<div class="tags">
|
114
|
+
|
115
|
+
|
116
|
+
</div>
|
117
|
+
</dt>
|
118
|
+
<dd><pre class="code"><span class='qwords_beg'>%w[</span><span class='tstring_content'>black-scholes</span><span class='words_sep'> </span><span class='tstring_content'>binomial</span><span class='words_sep'> </span><span class='tstring_content'>bjerksund-stensland</span><span class='tstring_end'>]</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
119
|
+
|
120
|
+
<dt id="OPTION_TYPES-constant" class="">OPTION_TYPES =
|
121
|
+
<div class="docstring">
|
122
|
+
<div class="discussion">
|
123
|
+
<p>Option types allowed in the system</p>
|
124
|
+
|
125
|
+
|
126
|
+
</div>
|
127
|
+
</div>
|
128
|
+
<div class="tags">
|
129
|
+
|
130
|
+
|
131
|
+
</div>
|
132
|
+
</dt>
|
133
|
+
<dd><pre class="code"><span class='qwords_beg'>%w[</span><span class='tstring_content'>call</span><span class='words_sep'> </span><span class='tstring_content'>put</span><span class='tstring_end'>]</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
134
|
+
|
135
|
+
<dt id="ACTION_TYPES-constant" class="">ACTION_TYPES =
|
136
|
+
<div class="docstring">
|
137
|
+
<div class="discussion">
|
138
|
+
<p>Action types allowed in the system</p>
|
139
|
+
|
140
|
+
|
141
|
+
</div>
|
142
|
+
</div>
|
143
|
+
<div class="tags">
|
144
|
+
|
145
|
+
|
146
|
+
</div>
|
147
|
+
</dt>
|
148
|
+
<dd><pre class="code"><span class='qwords_beg'>%w[</span><span class='tstring_content'>buy</span><span class='words_sep'> </span><span class='tstring_content'>sell</span><span class='tstring_end'>]</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
149
|
+
|
150
|
+
</dl>
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
<h2>
|
161
|
+
Class Method Summary
|
162
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
163
|
+
</h2>
|
164
|
+
|
165
|
+
<ul class="summary">
|
166
|
+
|
167
|
+
<li class="public ">
|
168
|
+
<span class="summary_signature">
|
169
|
+
|
170
|
+
<a href="#init_empty_array-class_method" title="init_empty_array (class method)">.<strong>init_empty_array</strong> ⇒ Object </a>
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
</span>
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
<span class="summary_desc"><div class='inline'><p>Initialize empty Numo array.</p>
|
185
|
+
</div></span>
|
186
|
+
|
187
|
+
</li>
|
188
|
+
|
189
|
+
|
190
|
+
</ul>
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
<div id="class_method_details" class="method_details_list">
|
196
|
+
<h2>Class Method Details</h2>
|
197
|
+
|
198
|
+
|
199
|
+
<div class="method_details first">
|
200
|
+
<h3 class="signature first" id="init_empty_array-class_method">
|
201
|
+
|
202
|
+
.<strong>init_empty_array</strong> ⇒ <tt>Object</tt>
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
</h3><div class="docstring">
|
209
|
+
<div class="discussion">
|
210
|
+
<p>Initialize empty Numo array</p>
|
211
|
+
|
212
|
+
|
213
|
+
</div>
|
214
|
+
</div>
|
215
|
+
<div class="tags">
|
216
|
+
|
217
|
+
|
218
|
+
</div><table class="source_code">
|
219
|
+
<tr>
|
220
|
+
<td>
|
221
|
+
<pre class="lines">
|
222
|
+
|
223
|
+
|
224
|
+
137
|
225
|
+
138
|
226
|
+
139</pre>
|
227
|
+
</td>
|
228
|
+
<td>
|
229
|
+
<pre class="code"><span class="info file"># File 'lib/option_lab/models.rb', line 137</span>
|
230
|
+
|
231
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_init_empty_array'>init_empty_array</span>
|
232
|
+
<span class='const'>Numo</span><span class='op'>::</span><span class='const'>DFloat</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='int'>0</span><span class='rparen'>)</span>
|
233
|
+
<span class='kw'>end</span></pre>
|
234
|
+
</td>
|
235
|
+
</tr>
|
236
|
+
</table>
|
237
|
+
</div>
|
238
|
+
|
239
|
+
</div>
|
240
|
+
|
241
|
+
</div>
|
242
|
+
|
243
|
+
<div id="footer">
|
244
|
+
Generated on Sun Apr 27 16:09:34 2025 by
|
245
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
246
|
+
0.9.37 (ruby-3.3.3).
|
247
|
+
</div>
|
248
|
+
|
249
|
+
</div>
|
250
|
+
</body>
|
251
|
+
</html>
|