<commit_before>{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "[Table of Contents](00.ipynb) | Next: [Mathematical Development of the Tree](02.ipynb)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# The Willow Tree Lattice Handbook\n",
    "\n",
    "## Overview\n",
    "\n",
    "The willow tree is a highly efficient, recombining lattice designed for speedy and accurate computation of derivative prices. It models the standard Brownian motion directly, by means of a discrete Markov chain, and the resulting estimate can serve as the basis for more complex processes, such as the geometric Brownian motion.\n",
    "\n",
    "The lattice has two distinctive features.\n",
    "\n",
    "- First, __it expands as the square root of time__, in accordance with the Brownian motion and unlike the binomial model, which grows linearly with time. As a consequence, it opens quite fast at the beginning, covering a high-probability region neglected by standard trees, and slowly later on, being constrained within a set confidence region of the normal marginal distribution [Figure 1-L]. This aspect prevents the waste of time and computational resources on the tails of the distribution, areas with little impact on the definition of the current price of the security, and avoids the arbitrary practice of pruning the tree, namely, disregarding branches, along with their offsprings, located in low probability regions.\n",
    "\n",
    "\n",
    "- Second, __it has a constant number of nodes per time step__. Hence, with time, this number grows linearly, and not quadratically, as it does in the binomial model.\n",
    "\n",
    "\n",
    "These features increase the efficiency of the lattice, because they force the paths to travel across a smaller structure squeezed in the body of the desired density  [Figure 1-R], and allow for a fast convergence to the true, unknown price distribution.\n",
    "\n",
    "Additionally, they inspired the choice of the name. If one rotates the graph of the lattice 90 degrees clockwise, one gets the characteristic shape of a branch of a willow tree: narrow on top, it expands gradually, bent under the weight of its own leaves (with a behaviour similar to that of the function square root), and reaches maximum span at the extremities, towards the ground.\n",
    "\n",
    "#### Figure 1: Features of the Willow Tree*\n",
    "\n",
    "![features-of-the-willow-tree](../img/figure-1.png)\n",
    "_* Figure 1-L adapted from Curran [4] and Acott [1]._\n",
    "\n",
    "- __Figure 1-L__: High- (blue) and low- (ochre) probability regions respectively considered and neglected in the willow tree framework.\n",
    "\n",
    "- __Figure 1-R__: Paths travel across a lattice structure squeezed in the body of the desired density."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Related Literature: A Selection\n",
    "\n",
    "The willow tree is a relatively recent lattice framework. The model originated at RiskCare Ltd. at the end of the Nineties, when Curran and Hu published an article entitled \"The Willow Tree\" [3]. The article provides important hints in order to setup the algorithm, but no formulae. Curran thoroughly expanded it in 1998 (at first as a technical report, to be used within the corporation), and the resulting seminal paper was published on IBM’s _Algo Research Quarterly_ in 2001 [4]. Since then, the willow tree algorithm has become a core component of _Algo One_, an IBM proprietary suite which focuses on modelling risk via a full valuation approach.\n",
    "\n",
    "A very good early reference on the model is Ho [8]. Ho digs into the algorithm from a rigorous mathematical standpoint, applies it to price European and American options, and shows possible extensions to the basic framework, in order to account for dividend payments, exotic features, multidimensionality, and stochastic volatility.\n",
    "\n",
    "Haussmann and Yan [7] point out an instability issue related to Curran's methodology (see [Issues Related to Curran's Methodology](05.ipynb)) and propose a modified version of the tree which, however, leaves out an important condition underlying the original formulation of the lattice.\n",
    "\n",
    "Xu, Hong, and Qin [14] introduce a new sampling strategy which both increments the accuracy of the tree and solves the previously mentioned instability issue, and apply such strategy to price path-dependent options via the forward shooting grid approach. So far, this paper represents the best resource on the topic, and the material is very easy to code.\n",
    "\n",
    "Among the most recent contributions, Xu and Yin [14] adapt the lattice to Merton's jump-diffusion model, Lu _et al._ use it to price Asian options [11] and moving average barrier options [12], while Xu _et al._ apply it to short rate models [16] and convertible bonds [17]."
   ]
  },<commit_msg>docs: Resize 'figure-1.png' in 01.ipynb<commit_after>{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "[Table of Contents](00.ipynb) | Next: [Mathematical Development of the Tree](02.ipynb)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# The Willow Tree Lattice Handbook\n",
    "\n",
    "## Overview\n",
    "\n",
    "The willow tree is a highly efficient, recombining lattice designed for speedy and accurate computation of derivative prices. It models the standard Brownian motion directly, by means of a discrete Markov chain, and the resulting estimate can serve as the basis for more complex processes, such as the geometric Brownian motion.\n",
    "\n",
    "The lattice has two distinctive features.\n",
    "\n",
    "- First, __it expands as the square root of time__, in accordance with the Brownian motion and unlike the binomial model, which grows linearly with time. As a consequence, it opens quite fast at the beginning, covering a high-probability region neglected by standard trees, and slowly later on, being constrained within a set confidence region of the normal marginal distribution [Figure 1-L]. This aspect prevents the waste of time and computational resources on the tails of the distribution, areas with little impact on the definition of the current price of the security, and avoids the arbitrary practice of pruning the tree, namely, disregarding branches, along with their offsprings, located in low probability regions.\n",
    "\n",
    "\n",
    "- Second, __it has a constant number of nodes per time step__. Hence, with time, this number grows linearly, and not quadratically, as it does in the binomial model.\n",
    "\n",
    "\n",
    "These features increase the efficiency of the lattice, because they force the paths to travel across a smaller structure squeezed in the body of the desired density  [Figure 1-R], and allow for a fast convergence to the true, unknown price distribution.\n",
    "\n",
    "Additionally, they inspired the choice of the name. If one rotates the graph of the lattice 90 degrees clockwise, one gets the characteristic shape of a branch of a willow tree: narrow on top, it expands gradually, bent under the weight of its own leaves (with a behaviour similar to that of the function square root), and reaches maximum span at the extremities, towards the ground.\n",
    "\n",
    "#### Figure 1: Features of the Willow Tree*\n",
    "\n",
    "<img src=\"../img/figure-1.png\" alt=\"Features of the Willow Tree\" style=\"width: 800px;\"/>\n",
    "\n",
    "_* Figure 1-L adapted from Curran [4] and Acott [1]._\n",
    "\n",
    "- __Figure 1-L__: High- (blue) and low- (peach) probability regions respectively considered and neglected in the willow tree framework.\n",
    "\n",
    "- __Figure 1-R__: Paths travel across a lattice structure squeezed in the body of the desired density."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Related Literature: A Selection\n",
    "\n",
    "The willow tree is a relatively recent lattice framework. The model originated at RiskCare Ltd. at the end of the Nineties, when Curran and Hu published an article entitled \"The Willow Tree\" [3]. The article provides important hints in order to setup the algorithm, but no formulae. Curran thoroughly expanded it in 1998 (at first as a technical report, to be used within the corporation), and the resulting seminal paper was published on IBM’s _Algo Research Quarterly_ in 2001 [4]. Since then, the willow tree algorithm has become a core component of _Algo One_, an IBM proprietary suite which focuses on modelling risk via a full valuation approach.\n",
    "\n",
    "A very good early reference on the model is Ho [8]. Ho digs into the algorithm from a rigorous mathematical standpoint, applies it to price European and American options, and shows possible extensions to the basic framework, in order to account for dividend payments, exotic features, multidimensionality, and stochastic volatility.\n",
    "\n",
    "Haussmann and Yan [7] point out an instability issue related to Curran's methodology (see [Issues Related to Curran's Methodology](05.ipynb)) and propose a modified version of the tree which, however, leaves out an important condition underlying the original formulation of the lattice.\n",
    "\n",
    "Xu, Hong, and Qin [14] introduce a new sampling strategy which both increments the accuracy of the tree and solves the previously mentioned instability issue, and apply such strategy to price path-dependent options via the forward shooting grid approach. So far, this paper represents the best resource on the topic, and the material is very easy to code.\n",
    "\n",
    "Among the most recent contributions, Xu and Yin [14] adapt the lattice to Merton's jump-diffusion model, Lu _et al._ use it to price Asian options [11] and moving average barrier options [12], while Xu _et al._ apply it to short rate models [16] and convertible bonds [17]."
   ]
  },
{'fraction_non_alphanumeric': 0.08231312829700409, 'fraction_numerical': 0.008758833482631631, 'mean_word_length': 3.823811809889582, 'pattern_counts': {'":': 20, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '302831', 'n_tokens_mistral': 2652, 'n_tokens_neox': 2473, 'n_words': 1433}