Giter VIP home page Giter VIP logo

curves's Introduction

Commodity Curves

Build Status Azure DevOps coverage NuGet PyPI

Set of tools written in C# for constructing commodity forward/futures/swap curves with a fluent API. Python API also provided which integrates with the pandas library time series types.

Table of Contents

Overview

The curves package contains a set of tools for building commodity forward, swaps, and futures curves.

More specifically, the problem being solved is to take a collection of traded forward prices, and tranform these into a forward curve of homogenous granularity. Additionally the derived curve can constructed to be in a granularity higher than what is traded in the market.

Examples of types of curve which can be constructed using this package:

  • Monthly granularity oil products swap curves from traded monthly, quarterly, and calendar yearly granularity market swap rates.
  • Daily granularity natural gas forward curves from traded daily, weekly, monthly, quarterly, seasonal, and gas year granularity forward and futures prices.
  • Half-hourly granularity power forward curves from traded daily, weekly, monthly, quarterly, and seasonal granularity forward and futures prices.

The resulting curves should be consistent with inputs, in that they average back to the input forward contract prices. This is a necessary to ensure that there are no arbitrage opportunities introduced between input contracts, and the derived forward curve.

Getting Started

Installing

For use from C# install the NuGet package Cmdty.Curves.

PM> Install-Package Cmdty.Curves -Version 0.1.0-beta1

For use from Python install the curves package from PyPI.

> pip install curves

Installing For Python on Linux

Currently only a small amount of testing has been done for the Python package running on Linux (Ubuntu 18.04 LTS running in Windows 10 WSL) via the Mono runtime, using Python version 3.6.8. The following Linux dependencies have to be installed, as listed on the pythonnet wiki:

  • Mono-develop or Mono-complete. Curves was successfully run after installing version 5.20.1.34 of Mono-complete. Note that pythonnet does not work with Mono version 6.x. See this page for instructions on installing older versions of Mono on Linux.
  • clang.
  • libglib2.0-dev.
  • python-dev. Specifically the package python3.6-dev was installed.

It was also found that the PyPI package pycparser had to be installed, in order for the pythonnet PyPI package to install correctly.

Using From C#

For examples of usage see samples/csharp/.

Using From Python

A Python API has been created using pythonnet. See the Jupyter Notebook curves_quick_start_tutorial for an introduction on how to use this.

Technical Documentation

The PDF file max_smoothness_spline.pdf contains details of the mathematics behind the maximum smoothness algorithm.

License

This project is licensed under the MIT License - see the LICENSE file for details

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.