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...
Scenarios IV: Planning for Disasters and then Deal... As I write this it is the fourth anniversary of September 11, 2001. Aside from the anniversary specials airing today, there is little in the news ...
A Conditional Valuation Approach for Path-Dependen... In an effort to improve credit risk management, financial institutions have developed various measures to manage their exposure to counterparty risk. ...
Finformatics: How to Measure Really Small Things Traders in financial assets implicitly compare the trading price to the stream of dividends the assets stand to generate. Clearly, a key determina...
A VaR-based Model for the Yield Curve An intuitive model for the yield curve, based on the notion of value-at-risk, is presented. It leads to interest rates that hedge against potentia...
Pricing Rainbow Options A previous paper (West 2005) tackled the issue of calculating accurate uni-, bi- and trivariate normal probabilities. This has important applicati...
Valuation of American Call Options The purpose of this paper is to provide an analytical solution for American call options assuming proportional dividends. Proportional dividends are m...
110830_kumar