15
MCSL Monte Carlo simulation language Diego Garcia Eita Shuto Yunling Wang Chong Zhai

MCSL Monte Carlo simulation language Diego Garcia Eita Shuto Yunling Wang Chong Zhai

Embed Size (px)

Citation preview

Page 1: MCSL Monte Carlo simulation language Diego Garcia Eita Shuto Yunling Wang Chong Zhai

MCSLMonte Carlo simulation

language

Diego GarciaEita Shuto

Yunling WangChong Zhai

Page 2: MCSL Monte Carlo simulation language Diego Garcia Eita Shuto Yunling Wang Chong Zhai

Outline of Presentation

• Introduction of language

• Language tutorial and examples

• Architectural design and implementation

• Summary and lessons learned

Page 3: MCSL Monte Carlo simulation language Diego Garcia Eita Shuto Yunling Wang Chong Zhai

Monte Carlo methods

a class of computational algorithms that rely on repeated random sampling to compute their results.

Why interested with it?• widely used• good performance• possibly the only • efficient approach

Page 4: MCSL Monte Carlo simulation language Diego Garcia Eita Shuto Yunling Wang Chong Zhai

Applications• Physics

– high energy particle physics, quantum many-body problem, transportation theory

• Mathematics – Integration, Optimization, Inverse problems, Computational

mathematics

• Computer science – Las Vegas algorithm, LURCH, Computer Go, General Game

Playing

• Finance– Option, instrument, portfolio or investment

Page 5: MCSL Monte Carlo simulation language Diego Garcia Eita Shuto Yunling Wang Chong Zhai

Algorithm of MCSL

• Generation particular distributed psedu-random numbers (or low discrepancy sequence)

• Evaluate the function by sampling with these numbers

• Aggregate results! (weight might be counted, variational method or conditional acceptance might be considered)

Page 6: MCSL Monte Carlo simulation language Diego Garcia Eita Shuto Yunling Wang Chong Zhai

Advantages

• Fast Random number algorithm (with good performance also)

• Other than iteration, consider all samples as a single vector

• Built-in Function to simplify aggregate process with different conditioning.

Page 7: MCSL Monte Carlo simulation language Diego Garcia Eita Shuto Yunling Wang Chong Zhai

Example One Calculation of “π” = 3.14159265358979323846…

Page 8: MCSL Monte Carlo simulation language Diego Garcia Eita Shuto Yunling Wang Chong Zhai

Sample code for Calculate Pi

Page 9: MCSL Monte Carlo simulation language Diego Garcia Eita Shuto Yunling Wang Chong Zhai

Example 2-Pollard's rho algorithm

Page 10: MCSL Monte Carlo simulation language Diego Garcia Eita Shuto Yunling Wang Chong Zhai

Sample code for Factorization

Page 11: MCSL Monte Carlo simulation language Diego Garcia Eita Shuto Yunling Wang Chong Zhai

Language Implementation

Page 12: MCSL Monte Carlo simulation language Diego Garcia Eita Shuto Yunling Wang Chong Zhai

Architectural Design andImplementation

Page 13: MCSL Monte Carlo simulation language Diego Garcia Eita Shuto Yunling Wang Chong Zhai

Testing Cases

Page 14: MCSL Monte Carlo simulation language Diego Garcia Eita Shuto Yunling Wang Chong Zhai

Summary and lessons learned• We have a language specification and a compiler

of Monte Carlo Simulation! It has…• Random type and type conversion• Useful builtin libraries, such as an iteration function…

• Teamwork and effective project management• SVN (Subversion) on Googlecode• Incremental Development Approach• Functional Language, Ocaml• Tiring work, supporting many data types

Page 15: MCSL Monte Carlo simulation language Diego Garcia Eita Shuto Yunling Wang Chong Zhai

Thank You!

• MCSL Team• Columbia University• Dec 19th, 2008