Author Archives: Thijs van den Berg

Light Intensity Modelling For Electricity Forward Curves

Light at a fixed time of day, during 2010-2011

Light intensity modelling is one the most important but also most often flawed element in electricity demand-, generation- and price-modelling. In this article we present the detailed properties of the our high quality light intensity model.

Posted in Energy, Popular | Leave a comment

Lagged XOR Engine Adaptor in C++ for Generating Parallel Random Number Streams

The lagged XOR engine adaptor implements a simple yet robust technique for generating independent random number streams. It has the following properties: Fast. The overhead has been tested to be approx 10% on top of Mersenne Twister for lag up to 150, and looks constant -doesn’t increase with the lag size-. Portable. It’s compatible with [...]

Posted in Programming | Leave a comment

Generating Random Numbers in C++ with Boost.Random

The boost libraries (boost.org) are high regarded C++ libraries, and a lot of those libraries have ended up being accepted in the C++ standard.

Posted in Programming | Leave a comment

Generating Random Numbers in C++ with the native TR1 implementation

The new upcoming C++11 standard offers great support for random number generation in C++. If you have Visual Studio 2008 with the Visual Studio Feature Pack -or- with SP1 installed, or GCC 4.2 or higher, then the code below should work.

Posted in Programming | Leave a comment

The Distribution of The Sample Correlation

When you generate a set of correlated random number and then calculate the correlation of those samples, you’ll notice that the calculated “sample correlation” can deviate from the correlation value use to generate the samples. This is because of the randomness of the samples, and the limited number of samples you use

Posted in Equations, Popular, Technical | Leave a comment

Generating Correlated Random Numbers

This article describes common methods that are used in generating correlated random numbers.

Posted in Popular, Programming | 3 Comments

Validation of Treasury and Trading Pricing and Risk Management Models and System

validation

This is an interim project I did in the period June 2011- Jan 2012 at a Dutch Bank. The implementation of a new treasury and risk management system at a bank called for a formal validation of the both the system output, as well as the system configuration. Validation / Configuration: Defining swap curves, contributing [...]

Posted in Client Projects | Comments closed

Quantitative Strategic Modeling – Regulatory Impact Assessment

eu_logo_14k

This was a project I did in the period September 2011 – January 2012 European- and State regulations are open to dialogs with industries. In this study, the financial impact on my client of a wide variety of possible future regulatory scenario’s are examined using quantitative modeling and scenario analysis. The results of the study [...]

Posted in Client Projects | Comments closed

Brownian motion transform invariants

Below are some usefull transform invariants for Brownian motion.

Posted in Equations | Comments closed

Some usefull definitions for stochastic processes

Posted in Equations | 2 Comments

An Internally Consistent Interpolation Method for Yield Curves

Here we present a new yield curve interpolation method, one that’s based on conditioning a stochastic model on a set of market yields. The concept is closely related to a Brownian bridge where you generate scenario according to an SDE, but with the extra condition that the start and end of the scenario’s must have [...]

Posted in Client Projects, Equations, Popular, Technical | 2 Comments

Binomial and Trinomial Trees

A list of popular binomial and trinomial tree used in finance for pricing options.

Posted in Equations | Leave a comment

Numerical Differentiation

The equations in this category are used to estimate the derivative of functions. These routines are quite often used in finance to estimate sensitivities like delta,gamma,theta, and the estimation of boundary conditions.

Posted in Equations | Leave a comment

Popular Stochastic Processes in Finance

This list contains the most common stochastic processes used in finance.

Posted in Equations | 4 Comments

Probability Distributions

This page gives an overview of some well known probability distributions.

Posted in Equations | 2 Comments

Spread Option Pricing Model

This equation uses the Gauss-Legendre quadrature to approximate the value of a spread option. The Gauss-Legendre quadrature abscissas (Xi) are rescaled in the range -4 to +4. The equation is unbiased and gives very accurate results, typical 6 digit accuracy with 16 quadrature points. The method was describes by K. Ravindran in his paper “Low-fat [...]

Posted in Equations, Popular | 45 Comments

Joint high-low probability of geometric Brownian motion

This equation gives the probability that the high and the low of an underlying are within the range [L,H]. The underlying behavior is geometric Brownian motion with a yield (drift) , volatility , and has an initial value of

Posted in Equations | 3 Comments

Calculating Correlation and Means with Missing Data

A great deal has been written about fixing ‘invalid correlation matrices’ for risk management purposes. Correlation matrices are invalid when it’s mathematically impossible to generate random numbers with those mutual correlations. The most common cause of this problem -as seen in finance- is that the correlation matrices numbers are made up, or are based on [...]

Posted in Popular, Technical | Leave a comment

Probability of the High of Geometric Brownian Motion

This article describes the probability distribution of the high of a geometric Brownian motion. An equation is given that calculates the probability that the high is above a certain level H within a given timeframe 0<t<T.

Posted in Equations | 10 Comments

A Simple and Extremely Fast C++ Template for Matrices and Tensors

This article describes a very simple and efficient solution for handling matrices and tensors in C++. The idea is to store the matrix (or tensor) in a standard vector by translating the multidimensional index to a one dimensional index.

Posted in Popular, Programming | Leave a comment

Model Validation: Production Optimization

validation

A Dutch energy firm has asked us to run a model validation. The model is designed to optimize the electricity cost of a large industrial plant, and uses hourly electricity prices curves for the cost part, and a mixed integer linear programming model for the plant constrained optimization with the production flexibility limits.

Posted in Client Projects | Comments closed

Weighted Single-pass Mean and Covariance

One of the algorithms used in the Probability Engine is a weighted covariance calculation. Instead of using a simple two pass algorithm, we chose for a single pass algorithm that improves both speed and accuracy.

Posted in Programming | Leave a comment

Digital Spread Option Pricing Model

Digital spread options have a payoff that depends on the difference -spread- between two underlying S1,S2. The payoff is 1 unit (Dollar, Euro) if the spread S1-S2 is greater that a strike K, and zero otherwise. This article gives the pricing formula of the option considering a Black & Scholes world.

Posted in Equations, Popular | 6 Comments

Asset Optimization for a water utility

This project involved cost optimization the water transport- and purification process. We looked at the production flexibility, and examined how we can reschedule production to lower electricity cost. Electricity prices are not constant, and the cost reduction strategy involves rescheduling electricity use to cheaper hours. We showed that production costs van be reduced by 20% [...]

Posted in Client Projects, Energy | Leave a comment

Calibrating the Ornstein-Uhlenbeck (Vasicek) model

Two methods for calibrating the Ornstein Uhlenbeck process on historical data are given. The least square fit, and the maximum likelihood estimates. Matlab source code for methods in Matlab is given.

Posted in Popular, Technical | 44 Comments

Outgrowing Excel: Moving to the Cloud

A client has been building some very useful Excel based tools for corporates. For their next release, we have been helping then move the data that is currently stored in Excel to a proper database.

Posted in Client Projects | Leave a comment

Energy trading in Farming: Risk Management and Optimization

Together with Maarten van der Kloot Meijburg, we have looked into the risk and trading behavior of farmers who own a CHP (combined heat power cogeneration). A lot of farmers own CHP’s, and that makes sense -they can use most of their outputs -power, heat, CO2- to grow their crops.

Posted in Client Projects, Energy | Comments closed

Analysis of Renewable Regulatory Exposure

I have completed a consultancy project that I did together with SQ consult for a large West-European energy utility. An interesting project, with interesting results! The goal of the project was to model the financial and strategic effects of 5 different (national and European) renewable energy regulatory scenariose on its portfolio. This model looked into [...]

Posted in Client Projects, Energy | Leave a comment