Skip to main content

Volatility based estimation for FX interventions

Project description

VaR-Rule for FX Interventions

Link to the Python notebook: https://github.com/romainlafarguette/VaR-FX-Interventions/blob/master/notebooks/VaR-FX%20Interventions.ipynb

The Python notebook replicates the tables and the charts of the IMF WP on "Foreign Exchange Interventions Rules for Central Banks: A Risk-Based Framework"

IMPORTANT: BECAUSE OF AN UPDATE OF THE ARCH PACKAGE AFTER 4.19, and in particular the random number generator, the way the random seed is managed has changed. Some results are therefore slightly different (e.g. the pdf plot) by a few pips as in the IMF WP, but are qualitatively similar. The journal version will reflect the new version

The paper uses a Python package that I have written, DistGARCH, also available in this Github folder, with the public FX intervention data from the Banco Mexico. DistGARCH is based on the ARCH package of Kevin Sheppard.

You can use the code for non-commercial applications, providing that you cite the IMF Working Paper Lafarguette, R. and Veyrune, R. (2020) "Foreign Exchange Interventions Rules for Central Banks: A Risk-Based Framework", IMF Working Paper

The folder is organized as follows:

  • mxn_estimation.py is the pure Python file with the core estimation and robustness analysis
  • VaR-FX Interventions.ipynb is a Jupyter notebook, which illustrates the approach
  • modules/ contains the modules for this project, in particular distGARCH which infers a conditional distribution from a GARCH model
  • data/ contains public data files, with FX rate and FX interventions from Banco Mexico website
  • img/ contains some images to illustrate the Jupyter Notebook

Reuse of this tool and IMF data does not imply any endorsement of the research and/or product. Any research presented should not be reported as representing the views of the IMF, its Executive Board, or member governments.

Note that the Github repo contains only publicly available data.

Author: Romain Lafarguette, August 2020

If you have any question, please contact me via Github or rlafarguette "at" imf "dot" org

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

varfxi-0.0.4.tar.gz (86.9 kB view hashes)

Uploaded Source

Built Distribution

varfxi-0.0.4-py3-none-any.whl (89.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page