No BSD License  

Highlights from
Practical Monte Carlo Simulation Tool

3.0

3.0 | 1 rating Rate this file 32 Downloads (last 30 days) File Size: 3.85 KB File ID: #14436
image thumbnail

Practical Monte Carlo Simulation Tool

by Gianluca Dorini

 

27 Mar 2007 (Updated 01 Apr 2007)

Monte Carlo Simulation for generic Matlab commands

| Watch this File

File Information
Description

This practical function provides a tool for quickly including a random process within a Monte Carlo Simulation framework.

The main input argument, is a string containing commands in Matlab syntax. Each execution of such string is an instance of a random process. The function expressionMCS
samples an opened number of user-specified variables and expressions, by running the input string for N iterations.

The function help is documented with four meaningful examples of various uses.

The purpose of this function is to perform simple Monte Carlo testings for any kind of stochastic processes, without having to create a single .m file. Hence it is not ment to be practicle, rather than fast. I would like to acknowledge Dimitri Shvorob for his comments.

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
27 Mar 2007 Dimitri Shvorob

You basically wrote a restrictive, inefficient wrapper for a simple for..end loop. Restrictive, because it only calculates mean/variance. Inefficient, because it is SLOW: a loop calculation of [y,y2] = expressionMCS({'mu' mu ; 'sigma' sigma},'y = normrnd(mu,sigma)',10000,'y','y^2')
did the job 50 times faster.

27 Mar 2007 Dimitri Shvorob

Correction: 250 times faster: that fancy progress-report stuff takes time. But, credit where it's due: if only all FEX authors (incldig myself) provided such an extensive 'help'!

12 May 2008 mohammad surrati  
29 Nov 2010 Ahmed Farag

I got this message when i ran the file

Input argument "parameters" is undefined.

Error in ==> expressionMCS at 93
for i=1:size(parameters,1)

Please login to add a comment or rating.
Updates
01 Apr 2007

further description following Dimitri Shvorob comments

Tag Activity for this File
Tag Applied By Date/Time
statistics Gianluca Dorini 22 Oct 2008 09:06:07
probability Gianluca Dorini 22 Oct 2008 09:06:07
random process Gianluca Dorini 22 Oct 2008 09:06:07
monte carlo simulation Gianluca Dorini 22 Oct 2008 09:06:07
monte carlo simulation Eric 03 May 2010 12:50:16
probability Kelwin 25 Apr 2011 16:34:27
monte carlo simulation tom 05 Sep 2011 08:01:12
monte carlo simulation anthony 28 Oct 2011 15:49:37
probability anthony 28 Oct 2011 15:49:42
random process anthony 28 Oct 2011 15:49:44
statistics anthony 28 Oct 2011 15:49:46

Contact us at files@mathworks.com