Monte Carlo in Esperanto

KRISHNA KUMAR PRESENTS A SIMPLE PARSER ADDITION IN EXCEL/VBA TO YOUR MONTE CARLO ARMORY

This article shows how a simple parser environment in Excel/VBA could be used to perform single and multi-dimensional Monte Carlo. The clsMathParser is a class for math expression evaluation in Excel/VBA. We show that a host of vanilla and exotic derivatives can be priced easily in this framework. The parser allows separation of concernand natural language expression of structured product payoffs.We provide test results for 1-dimensional and multi-dimensional options and sample spreadsheets.

“Let me try to explain to you, what to my taste is characteristic for all intelligent thinking. It is, that one is willing to study in depth an aspect of one’s subject matter in isolation for the sake of
its own consistency, all the time knowing that one is occupying oneself only with one of the aspects.

We know that a program must be correct and we can study it from that viewpoint only; we also know that is should be efficient and we can study its efficiency on another day [. . .] But nothing
is gained—on the contrary—by tackling these various aspects simultaneously. It is what I sometimes have called “the separation of concerns’’

Edsger W. Dijkstra

1 Introduction

Every few months there is a new thread on the Wilmott forum with a new spin on the age-old computer language debate. Although the thread title is different each time, C++ vs Fortran, Ada vs Java, the discussions are typical of the debate: heated and inconclusive.

Language preferences and superiority of one environment over the other are hard to decide. There has been an attempt in the past at benchmarking languages using standardized test suites [1], and more recently Bagley’s shootout.

Today, there are about a dozen active programming languages in use, of which C, C++ and Java seem to dominate the Street. But in terms of reuse and rapid development tools there is much work still to be done.

2 Domain Specific Languages

Computer Scientists spend a significant amount of their time creating languages that are specific to a problem domain (Domain Specific Languages, or DSL’s). A DSL is a specific formal language that is formed using a limited set of symbols with a set of predefined rules. DSL’s are similar to high-level languages, they often allow us to express in the operating lexicon of the problem domain, “mathematics”. Although DSL remains an active area of research and it has been repeatedly shown to improve productivity and speed, DSL use remains rare. Although many banks appear to have made custom ports of high-level languages there is a disconnect between the model abstraction, conceptual basis and actual implementation.

In terms of high-level tools there are commercial products that provide a high-level language environment and “automagically” generate and compile code for a target language environment based on a domain-specific notation. Although very promising, the average Quant developer/Financial Engineer is not likely to use these tools.

Logged-in members can download the article by clicking the link under all the Related Posts below. To log in or register visit here.

Related Posts

Monte Carlo Methods in Quantitative Finance Generi... We describe how we have designed and implemented a software architecture in C++ to model one-factor and multifactor option pricing problems. We pa...
Automatic Differentiation for the Greeks The sensitivities of the value of an option to the model parameters, a.k.a. “the Greeks,” are crucial to understanding the risk of an option posit...
Software Frameworks in Quantitative Finance, Part ... We discuss a number of ongoing efforts when developing customizable software systems and frameworks for problems in Quantitative Finance. In particula...
Introduction to Variance Swaps The purpose of this article is to introduce the properties of variance swaps, and give insights into the hedging and valuation of these instrument...
Numerical Methods for the Markov Functional Model The Libor Market Model of Brace Gatarek and Musiela (BGM) (1997) is the market standard model for pricing and hedging exotic interest rate derivat...
A Generalised Procedure for Locating the Optimal C... The fundamental concepts that shape modern capital structuring theory were first put together by Modigliani and Miller (1958) in a series of proposit...
The Great Investors, Their Methods and How We Eval... Winning has two parts: getting an edge and then betting well. The former simply means that investments have an advantage so $1 invested returns on...
Not-so-complex Logarithms in the Heston Model In Heston's stochastic volatility framework , semi-analytical formulæ for plain vanilla option prices can be derived. Unfortunately, these formulæ...
110830_kumar