Skip to content

Commit

Permalink
v0.6.1 (#41)
Browse files Browse the repository at this point in the history
* Minor logical readability improvement

* Docs update

* Example 5 update with link to article

* poetry update
  • Loading branch information
antonvorobets authored Sep 14, 2022
1 parent e744b3e commit cbe176e
Show file tree
Hide file tree
Showing 30 changed files with 85 additions and 144 deletions.
Binary file modified docs/build/doctrees/documentation.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/doctrees/examples.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/references.doctree
Binary file not shown.
6 changes: 4 additions & 2 deletions docs/build/html/_sources/documentation.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ with :math:`\mathcal{R}\left(e\right)` being the CVaR or variance for exposures

.. math:: \mu'e&\geq\mu_{target},\\v'e&=1,\\Ge&\leq h,\\Ae&=b.

Here, :math:`v\in\mathbb{R}^{I}` is a vector of relative market values. See example
5 for how to use this parameter.
Here, :math:`v\in\mathbb{R}^{I}` is the vector of relative market values introduced
by :cite:t:`Vorobets2022a`. See `this example <https://github.com/fortitudo-tech/
fortitudo.tech/blob/main/examples/5_DerivativesFramework.ipynb>`_ for how to use this
parameter.

A method for solving the CVaR problem was first introduced by :cite:t:`optCVaR`,
while the implemented algorithm is based on :cite:t:`compCVaR`. The notation
Expand Down
3 changes: 2 additions & 1 deletion docs/build/html/_sources/examples.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ The repository contains the following examples:
CVaR as default
4) An illustration of how to work with the time series simulation that follows
with this package
5) An example of how the :math:`v` parameter can be used in portfolio optimization.
5) The accompanied code for :cite:t:`Vorobets2022a` with an example of how to use
the :math:`v` parameter for portfolio optimization

The examples are good places to start exploring the functionality of this package.
We have very limited resources for support in relation to these, but please let
Expand Down
41 changes: 4 additions & 37 deletions docs/build/html/_static/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ div.body p, div.body dd, div.body li, div.body blockquote {
a.headerlink {
visibility: hidden;
}

a.brackets:before,
span.brackets > a:before{
content: "[";
Expand All @@ -247,6 +246,7 @@ span.brackets > a:after {
content: "]";
}


h1:hover > a.headerlink,
h2:hover > a.headerlink,
h3:hover > a.headerlink,
Expand Down Expand Up @@ -334,14 +334,12 @@ aside.sidebar {
p.sidebar-title {
font-weight: bold;
}

div.admonition, div.topic, aside.topic, blockquote {
div.admonition, div.topic, blockquote {
clear: left;
}

/* -- topics ---------------------------------------------------------------- */

div.topic, aside.topic {
div.topic {
border: 1px solid #ccc;
padding: 7px;
margin: 10px 0 10px 0;
Expand Down Expand Up @@ -380,15 +378,13 @@ div.body p.centered {
div.sidebar > :last-child,
aside.sidebar > :last-child,
div.topic > :last-child,
aside.topic > :last-child,
div.admonition > :last-child {
margin-bottom: 0;
}

div.sidebar::after,
aside.sidebar::after,
div.topic::after,
aside.topic::after,
div.admonition::after,
blockquote::after {
display: block;
Expand Down Expand Up @@ -612,8 +608,6 @@ ol.simple p,
ul.simple p {
margin-bottom: 0;
}

/* Docutils 0.17 and older (footnotes & citations) */
dl.footnote > dt,
dl.citation > dt {
float: left;
Expand All @@ -631,33 +625,6 @@ dl.citation > dd:after {
clear: both;
}

/* Docutils 0.18+ (footnotes & citations) */
aside.footnote > span,
div.citation > span {
float: left;
}
aside.footnote > span:last-of-type,
div.citation > span:last-of-type {
padding-right: 0.5em;
}
aside.footnote > p {
margin-left: 2em;
}
div.citation > p {
margin-left: 4em;
}
aside.footnote > p:last-of-type,
div.citation > p:last-of-type {
margin-bottom: 0em;
}
aside.footnote > p:last-of-type:after,
div.citation > p:last-of-type:after {
content: "";
clear: both;
}

/* Footnotes & citations ends */

dl.field-list {
display: grid;
grid-template-columns: fit-content(30%) auto;
Expand All @@ -669,11 +636,11 @@ dl.field-list > dt {
padding-left: 0.5em;
padding-right: 5px;
}

dl.field-list > dt:after {
content: ":";
}


dl.field-list > dd {
padding-left: 0.5em;
margin-top: 0em;
Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/_static/documentation_options.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ var DOCUMENTATION_OPTIONS = {
SOURCELINK_SUFFIX: '.txt',
NAVIGATION_WITH_KEYS: false,
SHOW_SEARCH_SUMMARY: true,
ENABLE_SEARCH_SHORTCUTS: false,
ENABLE_SEARCH_SHORTCUTS: true,
};
17 changes: 8 additions & 9 deletions docs/build/html/_static/searchtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const _displayItem = (item, highlightTerms, searchTerms) => {
linkEl.href = linkUrl + "?" + params.toString() + anchor;
linkEl.innerHTML = title;
if (descr)
listItem.appendChild(document.createElement("span")).innerText =
listItem.appendChild(document.createElement("span")).innerHTML =
" (" + descr + ")";
else if (showSearchSummary)
fetch(requestUrl)
Expand Down Expand Up @@ -155,10 +155,8 @@ const Search = {
_pulse_status: -1,

htmlToText: (htmlString) => {
const htmlElement = document
.createRange()
.createContextualFragment(htmlString);
_removeChildren(htmlElement.querySelectorAll(".headerlink"));
const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html');
htmlElement.querySelectorAll(".headerlink").forEach((el) => { el.remove() });
const docContent = htmlElement.querySelector('[role="main"]');
if (docContent !== undefined) return docContent.textContent;
console.warn(
Expand Down Expand Up @@ -504,21 +502,22 @@ const Search = {
* latter for highlighting it.
*/
makeSearchSummary: (htmlText, keywords, highlightWords) => {
const text = Search.htmlToText(htmlText).toLowerCase();
const text = Search.htmlToText(htmlText);
if (text === "") return null;

const textLower = text.toLowerCase();
const actualStartPosition = [...keywords]
.map((k) => text.indexOf(k.toLowerCase()))
.map((k) => textLower.indexOf(k.toLowerCase()))
.filter((i) => i > -1)
.slice(-1)[0];
const startWithContext = Math.max(actualStartPosition - 120, 0);

const top = startWithContext === 0 ? "" : "...";
const tail = startWithContext + 240 < text.length ? "..." : "";

let summary = document.createElement("div");
let summary = document.createElement("p");
summary.classList.add("context");
summary.innerText = top + text.substr(startWithContext, 240).trim() + tail;
summary.textContent = top + text.substr(startWithContext, 240).trim() + tail;

highlightWords.forEach((highlightWord) =>
_highlightText(summary, highlightWord, "highlighted")
Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/contributing.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<a href="index.html" class="icon icon-home"> fortitudo.tech
</a>
<div class="version">
v0.6
v0.6.1
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
Expand Down
18 changes: 10 additions & 8 deletions docs/build/html/documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<a href="index.html" class="icon icon-home"> fortitudo.tech
</a>
<div class="version">
v0.6
v0.6.1
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
Expand Down Expand Up @@ -100,7 +100,7 @@ <h2>Data<a class="headerlink" href="#data" title="Permalink to this heading">
<span class="target" id="module-fortitudo.tech.data"></span><dl class="py function">
<dt class="sig sig-object py" id="fortitudo.tech.data.load_parameters">
<span class="sig-name descname"><span class="pre">load_parameters</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#fortitudo.tech.data.load_parameters" title="Permalink to this definition"></a></dt>
<dd><p>Function for loading the P&amp;L parameters from Vorobets (2022).</p>
<dd><p>Function for loading the P&amp;L parameters from <a class="reference external" href="https://ssrn.com/abstract=4034316">https://ssrn.com/abstract=4034316</a>.</p>
<dl class="field-list simple">
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Tuple</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">list</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">ndarray</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">ndarray</span></code>]</p>
Expand All @@ -114,7 +114,8 @@ <h2>Data<a class="headerlink" href="#data" title="Permalink to this heading">
<dl class="py function">
<dt class="sig sig-object py" id="fortitudo.tech.data.load_pnl">
<span class="sig-name descname"><span class="pre">load_pnl</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#fortitudo.tech.data.load_pnl" title="Permalink to this definition"></a></dt>
<dd><p>Function for loading the P&amp;L simulation from Vorobets (2021).</p>
<dd><p>Function for loading the P&amp;L simulation from <a class="reference external" href="https://ssrn.com/abstract=3936392">https://ssrn.com/abstract=3936392</a>
and <a class="reference external" href="https://ssrn.com/abstract=4217884">https://ssrn.com/abstract=4217884</a>.</p>
<dl class="field-list simple">
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">DataFrame</span></code></p>
Expand Down Expand Up @@ -301,11 +302,12 @@ <h2>Portfolio Optimization<a class="headerlink" href="#portfolio-optimization" t
<span class="math notranslate nohighlight">\(e\in\mathbb{R}^{I}\)</span>, subject to the constraints</p>
<div class="math notranslate nohighlight">
\[\begin{split}\mu'e&amp;\geq\mu_{target},\\v'e&amp;=1,\\Ge&amp;\leq h,\\Ae&amp;=b.\end{split}\]</div>
<p>Here, <span class="math notranslate nohighlight">\(v\in\mathbb{R}^{I}\)</span> is a vector of relative market values. See example
5 for how to use this parameter.</p>
<p>A method for solving the CVaR problem was first introduced by <span id="id5">Rockafellar and Uryasev [<a class="reference internal" href="references.html#id4" title="R. Tyrrell Rockafellar and S. Uryasev. Optimization of conditional value-at-risk. Journal of Risk, 2(3):21-41, 2000. URL: https://doi.org/10.21314/JOR.2000.038.">2000</a>]</span>,
while the implemented algorithm is based on <span id="id6">Künzi-Bay and Mayer [<a class="reference internal" href="references.html#id5" title="A. Künzi-Bay and J. Mayer. Computational aspects of minimizing conditional value-at-risk. CMS, 3:3–27, 2006. URL: https://doi.org/10.1007/s10287-005-0042-0.">2006</a>]</span>. The notation
in relation to the P&amp;L simulations <span class="math notranslate nohighlight">\(R\)</span> follows <span id="id7">Vorobets [<a class="reference internal" href="references.html#id3" title="A. Vorobets. Sequential entropy pooling heuristics. SSRN, 2021. URL: https://ssrn.com/abstract=3936392.">2021</a>]</span>.
<p>Here, <span class="math notranslate nohighlight">\(v\in\mathbb{R}^{I}\)</span> is the vector of relative market values introduced
by <span id="id5">Vorobets [<a class="reference internal" href="references.html#id7" title="A. Vorobets. Portfolio management framework for derivative instruments. SSRN, 2022. URL: https://ssrn.com/abstract=4217884.">2022</a>]</span>. See <a class="reference external" href="https://github.com/fortitudo-tech/fortitudo.tech/blob/main/examples/5_DerivativesFramework.ipynb">this example</a> for how to use this
parameter.</p>
<p>A method for solving the CVaR problem was first introduced by <span id="id6">Rockafellar and Uryasev [<a class="reference internal" href="references.html#id4" title="R. Tyrrell Rockafellar and S. Uryasev. Optimization of conditional value-at-risk. Journal of Risk, 2(3):21-41, 2000. URL: https://doi.org/10.21314/JOR.2000.038.">2000</a>]</span>,
while the implemented algorithm is based on <span id="id7">Künzi-Bay and Mayer [<a class="reference internal" href="references.html#id5" title="A. Künzi-Bay and J. Mayer. Computational aspects of minimizing conditional value-at-risk. CMS, 3:3–27, 2006. URL: https://doi.org/10.1007/s10287-005-0042-0.">2006</a>]</span>. The notation
in relation to the P&amp;L simulations <span class="math notranslate nohighlight">\(R\)</span> follows <span id="id8">Vorobets [<a class="reference internal" href="references.html#id3" title="A. Vorobets. Sequential entropy pooling heuristics. SSRN, 2021. URL: https://ssrn.com/abstract=3936392.">2021</a>]</span>.
For the variance risk measure, a standard quadratic programming solver is used.</p>
<span class="target" id="module-fortitudo.tech.optimization"></span><dl class="py class">
<dt class="sig sig-object py" id="fortitudo.tech.optimization.MeanCVaR">
Expand Down
5 changes: 3 additions & 2 deletions docs/build/html/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<a href="index.html" class="icon icon-home"> fortitudo.tech
</a>
<div class="version">
v0.6
v0.6.1
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
Expand Down Expand Up @@ -87,7 +87,8 @@ <h1>Examples<a class="headerlink" href="#examples" title="Permalink to this head
CVaR as default</p></li>
<li><p>An illustration of how to work with the time series simulation that follows
with this package</p></li>
<li><p>An example of how the <span class="math notranslate nohighlight">\(v\)</span> parameter can be used in portfolio optimization.</p></li>
<li><p>The accompanied code for <span id="id3">Vorobets [<a class="reference internal" href="references.html#id7" title="A. Vorobets. Portfolio management framework for derivative instruments. SSRN, 2022. URL: https://ssrn.com/abstract=4217884.">2022</a>]</span> with an example of how to use
the <span class="math notranslate nohighlight">\(v\)</span> parameter for portfolio optimization</p></li>
</ol>
<p>The examples are good places to start exploring the functionality of this package.
We have very limited resources for support in relation to these, but please let
Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<a href="index.html" class="icon icon-home"> fortitudo.tech
</a>
<div class="version">
v0.6
v0.6.1
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<a href="#" class="icon icon-home"> fortitudo.tech
</a>
<div class="version">
v0.6
v0.6.1
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/installation.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<a href="index.html" class="icon icon-home"> fortitudo.tech
</a>
<div class="version">
v0.6
v0.6.1
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/objects.inv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Sphinx inventory version 2
# Project: fortitudo.tech
# Version: v0.6
# Version: v0.6.1
# The remainder of this file is compressed using zlib.
xڵ��N�0��y
K�m��-[~��@ @l������5�Q��c�Mqh�i���s>��GnG�-��n����˞ڠQ�-�У���z�{�'�-.Ģ�ݵ&h =zd�h]02����{��'��q�
Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/py-modindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<a href="index.html" class="icon icon-home"> fortitudo.tech
</a>
<div class="version">
v0.6
v0.6.1
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
Expand Down
7 changes: 5 additions & 2 deletions docs/build/html/references.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<a href="index.html" class="icon icon-home"> fortitudo.tech
</a>
<div class="version">
v0.6
v0.6.1
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
Expand Down Expand Up @@ -88,7 +88,10 @@ <h1>References<a class="headerlink" href="#references" title="Permalink to this
<dt class="label" id="id3"><span class="brackets">4</span></dt>
<dd><p>A. Vorobets. Sequential entropy pooling heuristics. <em>SSRN</em>, 2021. URL: <a class="reference external" href="https://ssrn.com/abstract=3936392">https://ssrn.com/abstract=3936392</a>.</p>
</dd>
<dt class="label" id="id6"><span class="brackets">5</span></dt>
<dt class="label" id="id7"><span class="brackets">5</span></dt>
<dd><p>A. Vorobets. Portfolio management framework for derivative instruments. <em>SSRN</em>, 2022. URL: <a class="reference external" href="https://ssrn.com/abstract=4217884">https://ssrn.com/abstract=4217884</a>.</p>
</dd>
<dt class="label" id="id6"><span class="brackets">6</span></dt>
<dd><p>A. Vorobets. Variance for intuition, cvar for optimization. <em>SSRN</em>, 2022. URL: <a class="reference external" href="https://ssrn.com/abstract=4034316">https://ssrn.com/abstract=4034316</a>.</p>
</dd>
</dl>
Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<a href="index.html" class="icon icon-home"> fortitudo.tech
</a>
<div class="version">
v0.6
v0.6.1
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="#" method="get">
Expand Down
Loading

0 comments on commit cbe176e

Please sign in to comment.