/
reference.html
138 lines (99 loc) · 6.6 KB
/
reference.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<!DOCTYPE html>
<html lang="en" data-content_root="./">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Reference — Quantlib cython wrapper 0.1.1 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/alabaster.css?v=f37d8280" />
<script src="_static/documentation_options.js?v=a58bc63e"></script>
<script src="_static/doctools.js?v=9a2dae69"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
</head><body>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="reference">
<h1>Reference<a class="headerlink" href="#reference" title="Link to this heading">¶</a></h1>
<p>The mlab module provides high-level functions suitable for easily performing common quantitative finance calculations. These functions use as input standardized data structures that are provided to limit the amount of data transformation needed to string functions together.</p>
<p>The mlab functions often use pandas data frames as inputs. In order to encourage inter-operability between functions, we have defined a number of standard data structures. The column names of these data frames are defined in the ‘’names’’ module. The standardized data structures should be created with the functions provided in the ‘’data_structures’’ module.</p>
<section id="names">
<h2>Names<a class="headerlink" href="#names" title="Link to this heading">¶</a></h2>
<p>The column names of all datasets are defined in names.py. A column name should always be referenced by the corresponding variable name,
and not by a character string. For example, refer to the ‘Strike’ column of an option_quotes data
set by:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">quantlib.reference.names</span> <span class="k">as</span> <span class="nn">nm</span>
<span class="n">strike</span> <span class="o">=</span> <span class="n">option_quotes</span><span class="p">[</span><span class="n">nm</span><span class="o">.</span><span class="n">STRIKE</span><span class="p">]</span>
</pre></div>
</div>
<p>rather than:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">strike</span> <span class="o">=</span> <span class="n">option_quotes</span><span class="p">[</span><span class="s1">'Strike'</span><span class="p">]</span>
</pre></div>
</div>
</section>
<section id="data-structures-templates">
<h2>Data Structures Templates<a class="headerlink" href="#data-structures-templates" title="Link to this heading">¶</a></h2>
<p>These data structures are defined to facilitate the inter-operability of the high level functions found in the ‘mlab’ module.</p>
<p><strong>Option Quotes</strong></p>
<p>This data structure contains the necessary data for calibrating a stochastic model for the underlying asset, also known as volatility model.</p>
<p>An option quotes data structure with 10 rows is created with the statements:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">quantlib.reference.data_structures</span> <span class="k">as</span> <span class="nn">ds</span>
<span class="n">option_quotes</span> <span class="o">=</span> <span class="n">ds</span><span class="o">.</span><span class="n">option_quotes_template</span><span class="p">()</span><span class="o">.</span><span class="n">reindex</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="nb">range</span><span class="p">(</span><span class="mi">10</span><span class="p">))</span>
</pre></div>
</div>
<p><strong>Risk-free Rate and Dividends</strong></p>
<p>When calibrating a volatility model, the default algorithm is to compute the implied term structure of risk-free rate and dividend yield from the option data, using the call-put parity relationship. The result of this calculation is the ‘riskfree_dividend’ data structure.</p>
</section>
</section>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="index.html">Quantlib cython wrapper</a></h1>
<h3>Navigation</h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="getting_started.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html">Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="users_guide.html">User’s guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference_guide.html">Reference guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="roadmap.html">Roadmap</a></li>
<li class="toctree-l1"><a class="reference internal" href="roadmap.html#documentation">Documentation</a></li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
</ul></li>
</ul>
</div>
<search id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
©2011, Didrik Pinte, Patrick Henaff.
|
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.3.7</a>
& <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>
|
<a href="_sources/reference.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>