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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file varfxi-0.0.4.tar.gz.

File metadata

  • Download URL: varfxi-0.0.4.tar.gz
  • Upload date:
  • Size: 86.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.7

File hashes

Hashes for varfxi-0.0.4.tar.gz
Algorithm Hash digest
SHA256 d2716b001ac3a341cf55add2115f78c7e1e332f416c5b17e8d1d961a7b261af2
MD5 64577b0941d842dfd1013f2789790f4f
BLAKE2b-256 f98c2e09ddd064d11d646972c3b0fef3def78b24c50e14fcf587e290e757c1c5

See more details on using hashes here.

File details

Details for the file varfxi-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: varfxi-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 89.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.7

File hashes

Hashes for varfxi-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7dc90efbf07a31032c180b613c572cf98386e6c6626df9df2f5108f982ada270
MD5 672cc6be4b7fd138230c98d660212a6d
BLAKE2b-256 6d5cdafc88cec28a4ca183ee5ac90f1fc11b5f97cd9062fa7ea705b6b7d3539c

See more details on using hashes here.

Supported by

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