Code Monkey home page Code Monkey logo

ml_finance_codes's Introduction

ML_Finance_Codes

This repository is the official repository for the latest version of the Python source code accompanying the textbook: Machine Learning in Finance: From Theory to Practice Book by Matthew Dixon, Igor Halperin and Paul Bilokon.

Please refer to SETUP.md for instructions for installing a virtual environment for the notebooks. The virtual environment ensures that the python package dependencies are consistent with those used by the authors. See README.md in each chapter folder for individual details about the notebooks in each chapter.

Version 1.0

The current version has been tested on Mac OS, Windows 10 and Linux. See SETUP.md for further details. Note that this repository is is constantly undergoing revisions and the reader should refer to the official Github repo to ensure that they have the latest version of the source code. Please create a GIST to raise any queries regarding the source code.

MIT license

Copyright 2020, Dixon, Halperin and Bilokon.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

ml_finance_codes's People

Contributors

dezog avatar ighalp avatar mfrdixon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ml_finance_codes's Issues

keras.legacy error

when importing the alphatRNN.py file, i get the following error.

No module named 'keras.legacy'

Issue in Google_Colab_Setup.ipynb

Dear professors,

I believe there is a small issue in the Google_Colab_Setup.ipynb script.

The code defines a variable path, and later calls a variable dir_path, which is not defined and raises an error. I assume they are the same so it might just be a need to rename them.

Thanks,

ERROR: Package 'xarray' requires a different Python: 3.6.15 not in '>=3.7'

When running: conda env create python=3.6 -f C:\prosjekt\ML_Finance_Codes\environment.yml
or conda env create -f C:\prosjekt\ML_Finance_Codes\environment.yml

with anaconda 3, python 3.9.7 -64 bits, I get error installing xarray:

Requirement already satisfied, skipping upgrade: cached-property; python_version < "3.8" in c:\users\endre\anaconda3\envs\mlfenv\lib\site-packages (from h5py>=2.7.0->pymc3==3.8->-r C:\prosjekt\ML_Finance_Codes\condaenv.s7kg5d46.requirements.txt (line 2)) (1.5.2)
Requirement already satisfied, skipping upgrade: matplotlib>=3.0 in c:\users\endre\anaconda3\envs\mlfenv\lib\site-packages (from arviz>=0.4.1->pymc3==3.8->-r C:\prosjekt\ML_Finance_Codes\condaenv.s7kg5d46.requirements.txt (line 2)) (3.1.3)
Requirement already satisfied, skipping upgrade: xarray>=0.11 in c:\users\endre\anaconda3\envs\mlfenv\lib\site-packages (from arviz>=0.4.1->pymc3==3.8->-r C:\prosjekt\ML_Finance_Codes\condaenv.s7kg5d46.requirements.txt (line 2)) (0.18.2)

Pip subprocess error:
ERROR: Package 'xarray' requires a different Python: 3.6.15 not in '>=3.7'

failed

CondaEnvException: Pip failed

Issue with notation in book

I'd like to start by saying that this isn't an issue with any of the code, rather an issue with the notation in the book. I didn't know where best to raise the issue directly so I thought this would be the most appropriate place.

I recently purchased this book and have been thoroughly enjoying it so far, I am currently on Chapter 6: Sequence Modelling. On page 194, section 2.2 Autoregressive Processes where it discusses the backshift operator and I came across notation for which I thought was confusing as it is written differently to my studies.

Just above equation 6.3, it describes the concept of the backshift operator as https://render.githubusercontent.com/render/math?math=y_{t-j}=L^{j}[y_{j}]
But surely this is wrong? As surely applying a backshift operation j and timestamp j, would just yield y0? And not y_t?

Wouldn't the correct notation be
https://render.githubusercontent.com/render/math?math=y_{t-j}=L^{j}[y_{t}]
Because yielding y_{t - j} would require the backshift operator of order j to be applied at y_t?

I apologise if I am wrong for this, but it just seems like something is off here.

pm.sample_posterior_predictive()

Dear Mr. Matthew Dixon, and dear Mr. Paul Thalesians,

I really do enjoy the notebooks and want to make a suggestion if the writers plan a second part.
As there is several things about RL and IRL - maybe to consider a chapter about the Player of Games from Deepmind. An algorithm that excels in task with perfect and imperfect information. In my opinion this could be something for finance.

Now about my question. How is it possible to make a forecast for several steps with pm.Data and pm.set_data - so the shared variable - to make the Implementation of the stochastic volatility model with leverage in PyMC3? I am trying to arrange it myself but keep on hitting a wall.

Thank you very much in advance and best regards

Matthias

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.