Skip to content

Instantly share code, notes, and snippets.

@yhilpisch
Last active November 10, 2024 20:26
Show Gist options
  • Save yhilpisch/648565d3d5d70663b7dc418db1b81676 to your computer and use it in GitHub Desktop.
Save yhilpisch/648565d3d5d70663b7dc418db1b81676 to your computer and use it in GitHub Desktop.
Machine Learning for Finance | Dr. Yves J. Hilpisch | CQF Elective | London, 23. May 2017

Machine Learning for Finance

A CQF elective with Dr. Yves J. Hilpisch, The Python Quants GmbH

General resources:

Wifi

You can use the following wifi in this venue:

SSID Fitch Guest
PW   Ft1ch#2016#!

Abstract

This CQF elective is about machine learning and deep learning with Python applied to finance. It starts with techniques to retrieve financial data from open data sources and covers Python packages like NumPy, pandas, scikit-learn and TensorFlow. It provides the basis to further explore these recent developments in data science to improve traditional financial tasks such as the pricing of American options or the prediction of future stock market movements.

Among other, the elective covers:

  • Getting and working with financial time series data in Python
  • Using linear OLS regression to predict financial prices & returns
  • Using scikit-learn for machine learning with Python
  • Application to the pricing of American options by Monte Carlo simulation
  • Applying logistic regression to classification problems
  • Predicting stock market returns as a classification problem
  • Using TensorFlow for deep learning with Python
  • Using deep learning for predicting stock market returns

Overview slides under http://hilpisch.com/cqf_ml_elective.pdf

Python

Download and install Miniconda 3.6 from https://conda.io/miniconda.html

If you have either Miniconda or Anaconda installed there is not need to install anything new.

conda create -n elective python=3.6
(source) activate elective
conda install numpy pandas=0.19 scikit-learn matplotlib
conda install pandas-datareader pytables
conda install ipython jupyter
jupyter notebook

Installing TensorFlow: https://www.tensorflow.org/install/

Finance

Download the paper by Longstaff and Schwartz (2001) about the Least-Squares Monte Carlo algorithm to price American options from Paper about LSM algorithm

Basic Definitions

"You can think of deep learning, machine learning and artificial intelligence [AI] as a set of Russian dolls nested within each other, beginning with the smallest and working out. Deep learning is a subset of machine learning, which is a subset of AI. ... That is, all machine learning counts as AI, but not all AI counts as machine learning. For example, symbolic logic (rules engines, expert systems and knowledge graphs) as well as evolutionary algorithms and Baysian statistics could all be described as AI, and none of them are machine learning."

"Neural networks are a set of algorithms, modeled loosely after the human brain, that are designed to recognize patterns. They interpret sensory data through a kind of machine perception, labeling or clustering raw input. The patterns they recognize are numerical, contained in vectors, into which all real-world data, be it images, sound, text or time series, must be translated."

"Deep learning maps inputs to outputs. It finds correlations. It is known as a 'universal approximator', because it can learn to approximate the function f(x) = y between any input x and any output y, assuming they are related through correlation or causation at all. In the process of learning, a neural network finds the right f, or the correct manner of transforming x into y, whether that be f(x) = 3x + 12 or f(x) = 9x - 0.1."

"All classification tasks depend upon labeled datasets; that is, humans must transfer their knowledge to the dataset in order for a neural to learn the correlation between labels and data. This is known as supervised learning. ... Any labels that humans can generate, any outcomes you care about and which correlate to data, can be used to train a neural network."

Source: https://deeplearning4j.org

Machine Learning

Here some resources to get a first overview of basic machine learning concepts and logistic regression for classification:

Neural Networks

Here some resources to get a first overview of neural networks:

TensorFlow

Some resources to get started with Google's TensorFlow package for deep learning:

Data

Download a HDF5 database file, containing a single pandas DataFrame object with hitorical equites data, from http://hilpisch.com/equities.h5

Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<img src=\"http://hilpisch.com/tpq_logo.png\" width=350px align=right>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# CQF Elective\n",
"\n",
"**Machine Learning for Finance**"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Python Import"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import numpy as np\n",
"import pandas as pd\n",
"from pylab import plt\n",
"plt.style.use('seaborn')\n",
"%matplotlib inline"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Random Data"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"rn = np.random.standard_normal(50)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"-0.0017529802244671689"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"rn.mean()"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"1.2711753314188865"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"rn.std()"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x119b89780>]"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAW8AAAD6CAYAAABu4MZQAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAE7dJREFUeJzt3W2MXFd5wPH/eic4pNqglTK8VEKgtvJxVyFUKhJEvCRq\ni0qpEBi5rdNCwYFCqn6Ik1SAI2i/QKJKDS8tRY2CzWupJQJGqFVopFJDi0tFaWuZbHIsUKtKjVSt\nYWENDq53M/2wu2Ftz87s3Lkz95xz/z9pJc/xzM45vp5nzn3O20yv10OSlJddTVdAkjQ6g7ckZcjg\nLUkZMnhLUoYM3pKUIYO3JGWoU/WFIYRZ4AEgAD3gthjjt+qqmCRpe+P0vF8DEGN8KfBu4H211EiS\nNFTlnneM8QshhL/ZePg84PuDnr+0dK7yaqD5+WtYXj5f9eXZst3tYrvbZaft7nbnZvqVz4y7wjKE\n8AlgH7A/xvjwds9bXV3rdTqzY72XJLXQZII3QAjh2cC/AAsxxh/1e844Pe9ud46lpXNVX54t290u\ntrtddtru7XrelXPeIYQ3hhAObzw8Dzy58SNJmrDKOW/g88DHQghfBa4CDsUYn6inWpKkQcYZsPwR\n8Js11kWStEMu0pGkDBm8JWVj9/EHmb/pRq57zjzzN93I7uMPNl2lxoyT85akqdl9/EGuffutTz3u\nPP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/sBt4LLFJ+u2eBB4DAejtvA35M\n4e3eFEJ4JvBN1s+/XaUF7Q4h/BuwsvHwP4H3MUa7U+55vw64OsZ4I/AuoP9hkAUJIbwD+Chw9UbR\n+4F3xxhfzvoJ0q9tqm4T9AbguxttfBXwYdrR7tcAxBhfCryb9Q9yG9q9+YV9P/DERlHx7Q4hXA3M\nxBhv3vg5yJjtTjl4vwz4EkCM8evAi5qtzlR8B3j9lse/CHxl488PAb8y9RpN3meB92z8eYb1Xljx\n7Y4xfgF428bD5wHfpwXt3vCnwF8Cj288bkO7XwhcE0J4OITw5RDCSxiz3SkH72uBH2x5vBZCSDbN\nU4cY4+eAi1uKZmKMm/sXnAOeMf1aTVaM8YcxxnMhhDngQdZ7ocW3GyDGuBpC+ATw58Bf0YJ2hxDe\nDCzFGP9uS3Hx7QbOs/6l9ausp8jGvt4pB+8VYG7L410xxtWmKtOQrfmvOdZ7Z8UJITwX+AfgUzHG\nz9CSdgPEGN8E7GE9//30LX9VartvBV65cXj5LwCfBJ655e9LbfcZ4NMxxl6M8QzwXeBZW/5+5Han\nHLy/BrwaYOMW43Sz1WnEv4cQbt74868B/9hgXSYihPAs4GHgnTHGoxvFbWj3G0MIhzcenmf9C+tf\nS293jPEVMcabYow3A/8B/C7wUOntZv1L6z6AEMJPs55ZeHicdqechjjO+jf0SdZzoQcbrk8T7gIe\nCCE8DXiU9bRCae4G5oH3hBA2c9+3A39WeLs/D3wshPBV4CrgEOttLf1699OG/+dHgI+HEP6J9dkl\ntwJnGaPdbgkrSRlKOW0iSdqGwVuSMmTwlqQMGbwlKUMGb0nKkMFbkjJk8JakDP0/5GVdjS3F7rEA\nAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x1157ad940>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.plot(rn, 'ro')"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x119d09400>]"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXUAAAD3CAYAAADi8sSvAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xd4m9d58P8vAIIgQYIkSIJDJLWlo72Xp2RHHkrSOI5T\nO8PNTpPWWU3eJm3j5H3zprtp3jbJr0kz3TjO8p7ylmxZkiVr78Ml7r03QYzfHyBoWuIAQYBY9+e6\nfBnEeHAfkrr54H7OuY/B6/UihBAiPhgjHYAQQojQkaQuhBBxRJK6EELEEUnqQggRRySpCyFEHEmK\n5Ju3tvYGPfXGbrfS2TkQynBiQqKOGxJ37DLuxBLIuB0Om2Gyx2L2TD0pyRTpECIiUccNiTt2GXdi\nme24YzapCyGEuJokdSGEiCOS1IUQIo5IUhdCiDgiSV0IIeKIJHUhhIgjktSFECKOSFIXQiScgSEX\nf9xXTkscLm6SpC6ESDh/3FfG80dq+MWzF4m3PSUkqQshEoqu6eT1040AlNV1c+RCc4QjCi1J6kKI\nhDHicvPA3ksYgM/fsRpzkpE/7itnyOmKdGghI0ldCJEwnjpYRXPnILu3lLBtZT57ts+nq8/JM4eq\nIx1ayEhSF0IkhNqWPp4/UkNORgp33rgIgD07FpCTYeGFozU0d8THRdOAkrpSartSav/o7aVKqTeU\nUgeUUj9WShnHPc+olNqrlPp8mOIVQogZ83i8PLD3Em6Plz+7TZGS7Os6bjGbuOfmZbg9Xn73SlmE\nowyNaZO6UurrwM+BlNG7vg/cr7W+ATAAd4x7+t8D9lAHKYQQs/HK8TouN/awY1U+65bkvOOxzcrB\nygV2zlS0c6q8LUIRhk4gm2RUAB8AHhz9ejPw2ujtvcCtwONKqQ8CHuD5QN/cbrfOqneww2EL+rWx\nLFHHDYk7dhl38Fo6Bnj8QCU2q5n77t5Ils1y1XPuu3sDX/r3/Ty8r4JdW+djjnAv99mMe9qkrrV+\nVCm1cNx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KkLIUQckaQu\nhBBxRJK6EELEkf8fYxIovFX5acUAAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x119c6e8d0>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.plot(rn.cumsum() + 100)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## OLS Regression"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"x = np.linspace(-5, 5, 25)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"y = 1.5 * x ** 2 - 2 * x + 4 + np.random.standard_normal(len(x))"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x119d699b0>]"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAW8AAAD3CAYAAADSftWOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAADudJREFUeJzt3W+MXNdZx/Hv1hM3WLux5sU4/GtIpdpPTIVayaQJIqlX\nyh/XSMWAEEioQBoQqhSklhZREjnvWiGkNAhUqpSUYP4IRa1LUF9gHCngNBRaQigVaTfPOkCpSoW6\nRJvWg9OixcuLGdNtYu/MjufOvWfu9yNZujPj3X1unPnN2eeec+7C5uYmkqSyvKruAiRJO2d4S1KB\nDG9JKpDhLUkFMrwlqUCdWfyQtbVzRU5p6Xb3sL5+vu4yZspzbgfPuQy93tLC5V5z5L2NTmdX3SXM\nnOfcDp5z+QxvSSqQ4S1JBTK8JalAhrckFcjwlqQCGd6SVKDmh3e/T+eZp6Hfr7sSSWqMZod3v0/3\nyDLdo7fRPbJsgEvSUKPDu5MrdM6uDo7PrtLJlZorkqRmaHR4b8RBNvYfGBzvP8BGHKy5Iklqhpns\nbTKxxUXWT5+hkyuD4F5crLs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DP5Hh8FvZvP6m8YtwF8CZOangR+st5yZ+Bhw//B4AWjL2owHgIeAr9RdyDTZNhmKiF8AfuVl\nT/878Ghmfi4iaqiqWpc557dn5tMR8Z0M2ifvmn1lM3HJVcLzvNgsM/sAEbEEnASO11tR9SLiLmAt\nM09HxL111zNNThXcRkQ8D3x5+PBmBvu5vLnGkmYiIn4AeBT41cw8VXc9VRjuz/PpzPzo8PGXM/N7\nay6rchHxGgbrND6UmY/UXU/VIuKTwObwzxuBVeBHM/M/ay1sChx5byMzX3fxOCK+CNxZWzEzEhHf\nz+DX65/OzM/VXU+FPgW8FfhoW1YJR8S1wOPAL2fmE3XXMwtbB1sRcQZ4xzwENxjeeqXfAK4GfnvY\nKvpaZh6rt6RKtHGV8H1AF7g/Ii72vo9m5lxdyGsL2yaSVCBnm0hSgQxvSSqQ4S1JBTK8JalAhrck\nFcjwlqQCGd6SVKD/Az2HT+cD3/Y1AAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x10e71f780>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.plot(x, y, 'r.')"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"reg = np.polyfit(x, y, deg=2)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([ 1.4807214 , -2.04344742, 4.2565095 ])"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"reg"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"17.624133237694434"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"y.mean()"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x119c89a90>]"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result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uwaW\nZTUhPoO00u1aEmQosMS27dOB3sBD7pbTaDJxlvAVwBbbtjsB3YAHXa4nIar+aD0ClLtdS0NSeFfD\nsiwDmA7cDpS5XE6i3E/8Fx3in8zS9ZPGqcCLALZtrwaOd7echHgGuKPqsgFkytyMScDDwNduF9KQ\n1G1SxbKsa4EhP7v5c2C2bdvvWZblQlWNaw/H3Me27TWWZf0f8e6TmxNfWULsdpZwOk82s207CGBZ\nVh4wBxjlbkWNz7Ks3kCJbduLLcsa4XY9DUlDBathWdYnwJdVV08ivp7LaS6WlBCWZR0NzAZutW17\nkdv1NIaq9XlW27b9dNX1L23b/rXLZTU6y7IOIT5P46+2bc9wu57GZlnWa4BT9e8YYD3Qw7btb10t\nrAGo5V0N27aP3HnZsqyNwNmuFZMglmX9hvjH60ts237P7Xoa0RvAecDTmTJL2LKspsBLwI22bS9x\nu55E2LWxZVnWMuCGdAhuUHjLL90DZAN/qeoq+sG27Z7ultQoMnGW8O1APnCHZVk7+76727adVify\nMoW6TUREUpBGm4iIpCCFt4hIClJ4i4ikIIW3iEgKUniLiKQghbeISApSeIuIpKD/B1DCcmXmX4W9\nAAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x119c89860>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"yr = np.polyval(reg, x)\n",
"plt.plot(x, y, 'r.')\n",
"plt.plot(x, yr, 'b')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Simple Classification Problem"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Data"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"i = np.array([1, 2, 2.5, 2.75, 3, 4, 4.5, 6, 7, 7.25])"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"o = np.array([0, 0, 0, 0, 1, 0, 1, 1, 1, 1])"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x119fc9588>]"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAD3CAYAAAAALt/WAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAADy1JREFUeJzt3X+M5PVdx/Hn3g2988oeLmEt+COtScsbkRb/uModIGAi\nVlEULJiIJcIV4VJrQDANNlZjUmNKelBqSjmwJ9qWNHLtmkIN1EgbhYPU1phScvcm1+o/1dYNLnfX\nHhzssf6xc3ay7O782Jmdee89HwnJfL+fmc/3/f7e8NrvfmZmZ2xubg5JUl3rhl2AJGllDHJJKs4g\nl6TiDHJJKs4gl6TiGqt9wOnpwz2/TWZiYhMzM0f6Wc6qs4fRUL2H6vWDPXRrcnJ8bKmxUlfkjcb6\nYZewYvYwGqr3UL1+sId+KhXkkqTXMsglqTiDXJKKM8glqTiDXJKKM8jVsQ1Te5i4eBs0GkxcvI0N\nU3uGXdLIOX6OTjtjwnO0hLXwPOq2h0E/Lzp6H3lEnAd8KDMvWbD/cuBPgFlgd2be39fqNDI2TO1h\n803b/3+7se9ZNt+0nUPA0SuvGl5hI8Rz1N5aOEfd9rAaPbe9Io+I9wF/BWxcsP8k4C7gF4GLgRsj\n4g19qUojZ9NHdi6+/+47V7mS0eU5am8tnKNue1iNnsfa/T3yiHgn8HXgk5m5tWX/24A7MvOXmtt3\nAXsz86Hl5pudPTY3Km+iVxcaDTh2bPH9r7yy+vWMIs9Re2vhHHXbQ/96XvKTnW2XVjLzsxHxpkWG\nNgMHW7YPA6e0m28lH2ednBxnevpwz48fBVV7mDjzLBr7nn3N/tkzz2KmYD+D+HdYzXPk82h4uu2h\nXz1PTo4vObaSFzsPAa0zjwMvrGA+jbAjt9y2+P6bb13lSkaX56i9tXCOuu1hNXpeSZDvA94SEadG\nxOuAi4Cn+lOWRs3R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ATwQEU8w/+6h7ZlZ5vWWzHwkIi4CvsL8isDvZeaxIZfViwC+NewijvPP2EpSca6RS1JxBrkk\nFWeQS1JxBrkkFWeQS1JxBrkkFWeQS1Jx/wdpPvGqmQ1CywAAAABJRU5ErkJggg==\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x119f98eb8>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.plot(i, o, 'ro')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### OLS Regression"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"reg = np.polyfit(i, o, deg=3)"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"oreg = np.polyval(reg, i)"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([-0.02871811, 0.06731748, 0.16709993, 0.22604232, 0.28953689,\n",
" 0.56680847, 0.70386016, 1.00198139, 1.01761939, 0.98845208])"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"oreg"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x11a140dd8>]"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAD3CAYAAAAALt/WAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl8VOW9x/HPbMnMAGHRFHH3Xi4PtF60FhGsqEXA6wKC\n7AgigQJSvSLigte6tPTlBmjxJTsRBZFFBcUFpVqtSNFClWILD0UrWusSFQiQmSSz3D8GamQJk8ly\n5iTf9+vly8w5mZPfM2f45skzz3mOJ5lMIiIi7uV1ugAREakeBbmIiMspyEVEXE5BLiLicgpyERGX\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MAicCRxnrd3lVE2uCXJjzC3AMGCf07VkaCjw\njbV2mDGmBfA+4JogB3oCWGt/aoy5EPgNcIWjFWVg/y/U2UDE6VoyYYwJAh43dmYA9r93zgV+CoSB\niY4WlAHTC34IAAAB8ElEQVRr7QJgAYAx5lFSN513LMTBXUMrHwJXOl1ENSwHfrn/aw8Qc7CWKrPW\nrgRG7394CuDoG7capgCzgH85XUiGzgDCxphXjTGvG2M6OV1QFV0MbAZWkLpp+wvOlpM5Y0wH4EfW\n2jlO1+KaILfWPgO49oad1tq91to9xpgmwNPAHU7XVFXW2pgx5nHgEeBJp+upqv1/EhdZa19xupZq\nKCH1y+hiYCzwpDHGNX9ZA8cCHYD+fFe/x9mSMnY7cI/TRYCLgrw+MMacBPweWGitXex0PZmw1g4H\n2gBzjTGNnK6nigqA7saYN0iNaz5hjDnO2ZKqbBuwyFqbtNZuA74BWjlcU1V8A7xirS2z1logCuQ7\nXFOVGWOaAcZa+3unawEXjZG7nTGmJfAqcJ219jWn66kqY8ww4ERr7b2keoWJ/f+5hrX2/ANf7w/z\nsdbaL5yrKCMFwH8D44wxxwN5wOfOllQla4EbjDHTSP0CakQq3N3mfCBr/h0ryOvO7UBz4JfGmANj\n5ZdYa93yoduzwGPGmD8AAWC8i2qvT+YDC4wxa0nNHiqw1rrm8xZr7QvGmPOBd0mNCPzCWht3uKxM\nGOAjp4s4QMvYioi4nMbIRURcTkEuIuJyCnIREZdTkIuIuJyCXETE5RTkIiIupyAXEXG5/wfGa0Px\nBf2FYwAAAABJRU5ErkJggg==\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x11a140e10>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.plot(i, o, 'ro')\n",
"plt.plot(i, oreg, 'b')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Logistic Regression"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"from sklearn import linear_model"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"lm = linear_model.LogisticRegression()"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"ir = i.reshape((1, -1)).T # due to sklearn reqs"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"LogisticRegression(C=1.0, class_weight=None, dual=False, fit_intercept=True,\n",
" intercept_scaling=1, max_iter=100, multi_class='ovr', n_jobs=1,\n",
" penalty='l2', random_state=None, solver='liblinear', tol=0.0001,\n",
" verbose=0, warm_start=False)"
]
},
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"lm.fit(ir, o)"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [],
"source": [
"pred = lm.predict(ir)"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"prob = lm.predict_proba(ir)"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.legend.Legend at 0x11c479400>"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAD3CAYAAAAALt/WAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xd4VFX6wPHvJDPpvRJCSSDJCZCINOlNpUondJEiKrpF\nV133t+6uuspadm27a3dVrBSDICBNERTpvXNDCx0SQsikk0nm98ckQ1RK+rT38zx5krn3zr3vmUze\nnDn3FJ3ZbEYIIYTjcrN1AEIIIWpHErkQQjg4SeRCCOHgJJELIYSDk0QuhBAOTt/QF8zMzK1xN5ng\nYB+yswvqMpwGJ2WwD45eBkePH6QM1RUe7q+73j6HqpHr9e62DqHWpAz2wdHL4Ojxg5ShLjlUIhdC\nC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S3J3NL0Au/k7lkTecJ4EgoG/KaUq2soH\naZrmKDfdvgI+Ukr9CBiARxwodmfyATBbKfUTlt5D0zVNc5j7LZqmLVVK9QK2YGkR+I2maaU2Dqsm\nFHDM1kFUkGlshRDCwUkbuRBCODhJ5EII4eAkkQshhIOTRC6EEA5OErkQQjg4SeRCCOHgJJELIYSD\n+38kj7gjIbeoLQAAAABJRU5ErkJggg==\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x11c453978>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.plot(i, o, 'ro', label='data')\n",
"plt.plot(i, pred, 'b', label='pred')\n",
"plt.plot(i, prob, 'g--', label='prob')\n",
"plt.legend(loc=0)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Using Deep Neural Networks"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import tensorflow as tf"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"tf.logging.set_verbosity(tf.logging.ERROR)"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"fc = [tf.contrib.layers.real_valued_column('i', dimension=1)]"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"model = tf.contrib.learn.DNNClassifier(hidden_units=[30], feature_columns=fc)"
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"def get_data():\n",
" fc = {'i': tf.constant(i)}\n",
" la = tf.constant(o, shape=[len(o), 1])\n",
" return fc, la"
]
},
{
"cell_type": "code",
"execution_count": 33,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"DNNClassifier(params={'head': <tensorflow.contrib.learn.python.learn.estimators.head._BinaryLogisticHead object at 0x123ce4630>, 'hidden_units': [30], 'feature_columns': (_RealValuedColumn(column_name='i', dimension=1, default_value=None, dtype=tf.float32, normalizer=None),), 'optimizer': None, 'activation_fn': <function relu at 0x1235d01e0>, 'dropout': None, 'gradient_clip_norm': None, 'embedding_lr_multipliers': None, 'input_layer_min_slice_size': None})"
]
},
"execution_count": 33,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"model.fit(input_fn=get_data, steps=50)"
]
},
{
"cell_type": "code",
"execution_count": 34,
"metadata": {},
"outputs": [],
"source": [
"dnnpred = list(model.predict(input_fn=get_data))"
]
},
{
"cell_type": "code",
"execution_count": 35,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.legend.Legend at 0x126799c18>"
]
},
"execution_count": 35,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAD3CAYAAAAALt/WAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl8XGW9+PHPmTWZSdIsTReStE23pwulLEXashT0gsqF\nC4V69aJ4BRGQn1cRURFFEFDcQFwAWxRU5F6xSFGQi3rBjaaVpUXa0j61QksptE3adGYyk0xmOb8/\nZtKmbdJOJjM5c858369XX81sz/k+k5PvPPOcZzFM00QIIYR9uawOQAghxPBIIhdCCJuTRC6EEDYn\niVwIIWxOErkQQticZ6QP2N4eyXuYTF1dgM7OWCHDGXFSh9Jg9zrYPX6QOgxVY2O1MdhjtmqRezxu\nq0MYNqlDabB7HeweP0gdCslWiVwIIcThJJELIYTNSSIXQgibk0QuhBA2J4lcCCFsThK5yJl/xaPU\nLVoAHg91ixbgX/Go1SGVnL73aPT4OnmPBuGE82iodSj2eZHTOHKl1CnAN7TWZx5y//nAl4Ek8IDW\n+v6CRidKhn/Fo9Rcdfn+256NG6i56nLCQHzxEusCKyHyHh2dE96jodZhJOpsHG0ZW6XU54BLgajW\nen6/+73ARuBkIAqsBM7TWu86UnnDmRDU2FhNe3sk35eXhFKuw3e+42PLFhf33NMDwLZ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fV/AtOB+5VSQavjGaLLgbOVUn8i06/5M6XUOGtDGrLNwM+11qbWejOwBxhv\ncUxDsQf4nda6V2utgR6g0eKYhkwpVQsorfUfrY4FbNRHbndKqbHA74FPaK2fsTqeoVJKXQo0a63v\nINMqTGf/2YbW+oy+n7PJ/Gqt9U7rIsrL5cAc4Bql1DFADfC2tSENyXPAp5RSd5H5AAqSSe52cwZQ\nMn/HkshHzo1AHXCTUqqvr/y9Wmu7XHR7DHhQKfUXwAtca6PYneTHwE+UUs+RGT10udbaNtdbtNZP\nKqXOAJ4n0yPw/7TWKYvDyocCXrM6iD6yjK0QQtic9JELIYTNSSIXQgibk0QuhBA2J4lcCCFsThK5\nEELYnCRyIYSwOUnkQghhc/8f4bbE0wncZUAAAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x126225668>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.plot(i, o, 'ro', label='data')\n",
"plt.plot(i, pred, 'b-.', label='log')\n",
"plt.plot(i, dnnpred, 'm--', label='dnn')\n",
"plt.legend(loc=0)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<img src=\"http://hilpisch.com/tpq_logo.png\" width=350px align=right>"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stef296
Copy link

stef296 commented Aug 3, 2017

Hi Yves, thanks for the great session. There is a small bug in the paths() function. I think it should be something like this:

def paths2(S0=S0,r=r,sigma=sigma,dt=dt):
    rn = rng()
    rn[0] = 0.0
    S = np.zeros_like(rn)
    S[0] = S0
    S[1:] = S0 * np.exp(((r - 0.5 * sigma ** 2) * dt +
            sigma * dt ** 0.5 * rn[1:]).cumsum(axis=0))
    return S; 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment