Page 2 of 18

The ultimate Monte Carlo framework

Posted: October 6th, 2011, 12:56 am
by renorm
CPU dispatching not used. Users can add CPU specific flags to their make file, but in my experience it doesn't make much difference.First, a big chunk of heavy duty number crunching is delegated to optimized libs. I think both MKL and ACML do CPU dispatching internally.Second, I observed that straightforward SIMD implementation doesn't benefit much from CPU specific optimizations beyond "-O2 -mss2".

The ultimate Monte Carlo framework

Posted: October 6th, 2011, 1:15 am
by Polter
renorm: a question regarding "the ability to gracefully fall back to SIMD=1" -- what's the mechanism that determines the decision whether to use "a scalar version (that is simpler implementation with SIMD=1)"?

The ultimate Monte Carlo framework

Posted: October 6th, 2011, 7:05 am
by madmax
QuoteOriginally posted by: AlanQuoteOriginally posted by: madmaxQuoteOriginally posted by: AlanI think there are some nice commercial possibilities with the Monte Carlo that should be considered.For example, say the library painlessly supports a remote connection to a GPU server, and some company provides the serverat some reasonable hourly rate. Something like this, but I compile the C/C++I would use it. Anyway, treat it as a feature request.Amazon's EC2 has GPU instances. Also, there is Penguin On Demand without virtualization, higher specs.Thanks. Is there a tutorial somewhere for dummies on Windows, say with Visual Studio, showing how to create such AWS GPU instances and link a CUDA C/C++ program to them?I think at the moment AWS GPU instances are Linux only.

The ultimate Monte Carlo framework

Posted: October 6th, 2011, 7:15 am
by madmax
I stand corrected, it seems they introduced Windows instances with GPU in middle of last month.I will check it out over the week-end and report back.

The ultimate Monte Carlo framework

Posted: October 7th, 2011, 4:54 am
by FinancialAlex
One other possibility for great speed improvement is to compute Monte Carlo Greeks using adjoint methodology combined with automatic differentiation. As soon as there is a tested framework for Monte Carlo Greeks, I can contribute by trying to obtain an adjoint automatic differentiation implementation of original code.

The ultimate Monte Carlo framework

Posted: October 19th, 2011, 6:35 am
by FinancialAlex
It would be also useful to have multilevel approach implemented in Monte Carlo library. It is very powerful (convergence speedup by one or more orders of magnitude) and generic enough to be considered.For more on this topic one can study the papers written by Mike Giles and collaborators and described here

The ultimate Monte Carlo framework

Posted: October 19th, 2011, 6:42 am
by Cuchulainn
QuoteOriginally posted by: FinancialAlexIt would be also useful to have multilevel approach implemented in Monte Carlo library. It is very powerful (convergence speedup by one or more orders of magnitude) and generic enough to be considered.For more on this topic one can study the papers written by Mike Giles and collaborators and described hereI have a software architecture based on domain architectures, patterns and Boost that I am writing up and can try to use it to accommodate bespoke MC functionality. The basic design is described in chap 0 of the book by Kienitz and myself but we wish to extend it to n-factor cases. In order to satisfy all domain and s/w requiremnents, I think you will need to address the problem at 2 levels:A. Technology-independentDecompose system into cohesive, loosely coupled subsystems; determine inter-system services.B. Technology-dependentMap subsystems and services to a particular s/w paradigm (OOP, GP) and technology (C++, boost, C#, Matlab). Regarding authors of MC s/w, a requirement is that you can give a black box I/O description of your modules, ideally at both A and B levels.

The ultimate Monte Carlo framework

Posted: October 19th, 2011, 12:48 pm
by Cuchulainn
The basic architecture is shown here for the 1-factor case (DUKIChapter0.pdf, figures 0.1, 0.2, 0.3).

The ultimate Monte Carlo framework

Posted: October 23rd, 2011, 10:58 am
by Cuchulainn
Can someone draw up a list of features that MC system should support? Ideally, a requirements document.

The ultimate Monte Carlo framework

Posted: November 15th, 2011, 7:21 pm
by Alan
A current discussion in the Student Forum suggests one:1. If the Monte Carlo problem being solved has one or more continuously observed barriers, the MC method should allow for an optional (local) Brownian Bridge barrier-crossing test,if that is compatible with the process evolution. Compatible processes includeall diffusions: BM, GBM, local volatility, and any stochastic volatility process. (If there are underlying price jumps, this needs more thought). There are various test problems for this (models with both a barrier and exact solns): 1-factor: (i) GBM with one or two barriers; (ii) CEV model with one barrier.2-factor: (i) Heston double barrier with rho=0 and no cost-of-carry; (ii) SABR hitting of S=0 (beta=0)

The ultimate Monte Carlo framework

Posted: November 17th, 2011, 6:38 am
by Cuchulainn
QuoteOriginally posted by: DevonFangsHey all.This thread is aimed at collecting ideas about the Monte Carlo framework we are going to adopt. Guru renorm recently offered to share his code, so we could also start a discussion on that when it comes.I suggest also we have a look at the framework currently implemented in Quantlib -- even if to make it parallel we're probably going towards something quite different.This thread till now has focused mostly on the tools to implement an MC Engine. But the scope of the engine and the requirements have yet to be agreed upon. renorm, quartz,any input? If we wish to have a customisable and effiicent (multi-threaded?) engine then a component-based design using patterns and the higher-order functions in Boost (especially signals(2)) should be used instead of Observer. As renom has noted, this is 10 times slower than his own serial code. Parallel and current OO approach will be messy and probably unworkable, so a more task or data-driven driven design is needed imo.I see two roles here; the algo builder and the software designer/architect who integrates the algo into the engine.I have a reference design in C++ that we could use as initial benchmark. We could use C++ 11 Random (boost) in this version?

The ultimate Monte Carlo framework

Posted: November 17th, 2011, 12:58 pm
by Cuchulainn
QuoteIs there a need for using signals over a simple template with an agreed interface?Absolutely!With signals you can configure the engine to suit any user needs. I have written an article November Wilmott 2011 on this very topic by creating a BS pricer that gets it data from a slot.In general, I now know how to design these loosely coupled systems using signals and integrate them with s/w architectures. Robert and myself have even mapped GOF and POSA patterns to signals, e.g. Observer. And they can be run as is.