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
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta name="robots" content="none">
<title>QuantLib: Math tools</title>
<link rel="stylesheet" href="quantlib.css" type="text/css">
<link rel="stylesheet" href="print.css" type="text/css" media="print">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">
</head>
<body>
<div id="container">
<div id="header">
<img class="titleimage"
src="QL-title.jpg" width="212" height="47" border="0"
alt="QuantLib">
<br>
<h3 class="subtitle">A free/open-source library for quantitative finance</h3>
</div>
<div id="menu">
<h3 class="navbartitle">Version 0.9.0</h3>
<hr>
<h3 class="navbartitle">Getting started</h3>
<ul class="navbarlist">
<li class="navlink"><a href="index.html">Introduction</a></li>
<li class="navlink"><a href="overview.html">Project overview</a></li>
<li class="navlink"><a href="where.html">Where to get QuantLib</a></li>
<li class="navlink"><a href="install.html">Installation</a></li>
<li class="navlink"><a href="config.html">Configuration</a></li>
<li class="navlink"><a href="usage.html">Usage</a></li>
<li class="navlink"><a href="history.html">Version history</a></li>
<li class="navlink"><a href="resources.html">Additional resources</a></li>
<li class="navlink"><a href="group.html">The QuantLib group</a></li>
<li class="navlink"><a href="license.html">Copyright and license</a></li>
</ul>
<hr>
<h3 class="navbartitle">Reference manual</h3>
<ul class="navbarlist">
<li class="navlink"><a href="modules.html">Modules</a></li>
<li class="navlink"><a href="hierarchy.html">Class Hierarchy</a></li>
<li class="navlink"><a href="annotated.html">Compound List</a></li>
<li class="navlink"><a href="files.html">File List</a></li>
<li class="navlink"><a href="functions.html">Compound Members</a></li>
<li class="navlink"><a href="globals.html">File Members</a></li>
<li class="navlink"><a href="bug.html">Known Bugs</a></li>
<li class="navlink"><a href="caveats.html">Caveats</a></li>
<li class="navlink"><a href="test.html">Test Suite</a></li>
<li class="navlink"><a href="examples.html">Examples</a></li>
</ul>
</div>
<div id="content">
<!--Doxygen-generated content-->
<!-- Generated by Doxygen 1.5.4 -->
<h1>Math tools</h1>Math facilities of the library include:<h2><a class="anchor" name="randomnumbers">
Pseudo-random number and low-discrepancy sequence generators</a></h2>
Implementations of pseudo-random number and low-discrepancy sequence generators. They share the ql/RandomNumbers directory.<h2><a class="anchor" name="solvers1d">
One-dimensional solvers</a></h2>
The abstract class <a class="el" href="class_quant_lib_1_1_solver1_d.html" title="Base class for 1-D solvers.">QuantLib::Solver1D</a> provides the interface for one-dimensional solvers which can find the zeroes of a given function.<p>
A number of such solvers is contained in the ql/Solvers1D directory.<p>
The implementation of the algorithms was inspired by "Numerical Recipes in C", 2nd edition, Press, Teukolsky, Vetterling, Flannery - Chapter 9<p>
Some work is needed to resolve the ambiguity of the root finding accuracy defition: for some algorithms it is the x-accuracy, for others it is f(x)-accuracy.<h2><a class="anchor" name="optimizers">
Optimizers</a></h2>
The optimization framework (corresponding to the ql/Optimization directory) implements some multi-dimensional minimizing methods. The function to be minimized is to be derived from the <a class="el" href="class_quant_lib_1_1_cost_function.html" title="Cost function abstract class for optimization problem.">QuantLib::CostFunction</a> base class (if the gradient is not analytically implemented, it will be computed numerically).<p>
<dl class="user" compact><dt><b>The simplex method</b></dt><dd></dd></dl>
This method, implemented in <a class="el" href="class_quant_lib_1_1_simplex.html" title="Multi-dimensional simplex class.">QuantLib::Simplex</a>, is rather raw and requires quite a lot of computing resources, but it has the advantage that it does not need any evaluation of the cost function's gradient, and that it is quite easily implemented. First, we must choose N+1 starting points, given here by a starting point <img class="formulaInl" alt="$ \mathbf{P}_{0} $" src="form_27.png"> and N points such that <p class="formulaDsp">
<img class="formulaDsp" alt="\[ \mathbf{P}_{\mathbf{i}}=\mathbf{P}_{0}+\lambda \mathbf{e}_{\mathbf{i}}, \]" src="form_28.png">
<p>
where <img class="formulaInl" alt="$ \lambda $" src="form_29.png"> is the problem's characteristic length scale). These points will form a geometrical form called simplex. The principle of the downhill simplex method is, at each iteration, to move the worst point (highest cost function value) through the opposite face to a better point. When the simplex seems to be constrained in a valley, it will be contracted downhill, keeping the best point unchanged.<p>
<dl class="user" compact><dt><b>The conjugate gradient method</b></dt><dd>We'll now continue with a bit more sophisticated method, implemented in <a class="el" href="class_quant_lib_1_1_conjugate_gradient.html" title="Multi-dimensional Conjugate Gradient class.">QuantLib::ConjugateGradient</a> . At each step, we minimize (using Armijo's line search algorithm, implemented in <a class="el" href="class_quant_lib_1_1_armijo_line_search.html" title="Armijo line search.">QuantLib::ArmijoLineSearch</a>) the function along a line defined by <p class="formulaDsp">
<img class="formulaDsp" alt="\[ \mathbf{d_i} = -\nabla f(\mathbf{x_i})+\frac{\left\Vert \nabla f(\mathbf{x_i})\right\Vert ^{2}}{\left\Vert \nabla f(\mathbf{x_{i-1}})\right\Vert ^{2}}\mathbf{d_{i-1}}, \]" src="form_30.png">
<p>
<p class="formulaDsp">
<img class="formulaDsp" alt="\[ \mathbf{d}_{0} = -\nabla f(\mathbf{x}_{0}). \]" src="form_31.png">
<p>
</dd></dl>
As we can see, this optimization method requires the knowledge of the gradient of the cost function. See <a class="el" href="class_quant_lib_1_1_conjugate_gradient.html" title="Multi-dimensional Conjugate Gradient class.">QuantLib::ConjugateGradient</a> .
<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
</table>
</div>
<div class="footer">
<div class="endmatter">
Documentation generated by
<a href="http://www.doxygen.org">Doxygen</a> 1.5.4
</div>
</div>
</div>
</body>
</html>
|