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...
Calibration problems – An inverse problems v... When pricing structured or derivative financial instruments, the typical steps a quant has to do are the following: 1. Choose a model for the m...
Practical Valuation of Power Derivatives In this paper I look at the practical valuation of power derivatives from a trader’s perspective. Most people that have written about valuation of pow...
What is Implied by Implied Volatility? Word and concept Implied volatility is not just a word or a concept. As a word, what is implied by implied volatility – what “implied volatili...
Big Time Series Analysis with JuliaDB The next generation of data analysis requires the next generation of tools. The most popular opensource packages for data analysis (Python’s pandas an...
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...
110830_kumar