Monte Carlo Simulation

Discussion in 'Technical Analysis' started by WAWTU31, Nov 30, 2005.

  1. waxwing

    waxwing

    No. According to the above attachment, Z in this case is a "standard normal" variable. It's a random number with a mean of zero and a standard deviation of 1.

    A "Z score" is obtained by "scaling" a particular measurement, assumed to be drawn from a particular normal distribution.
    Thus if you think your data has a mean of 2 and a st dev of 3, and you make a measurement of 5, your Z score would be 1 ((5-2)/3). So you can convert a Z score to a confidence limit.
     
    #31     Dec 5, 2006
  2. Monte Carlo methods are not really a formula or set of instructions - it's really an approach to problem solving.

    Let's say you want to know what's the worse week you can have at the 90th percent level. ie - only 10% of weeks will be worse than this.

    You can come up with some elaborate formula that describes the market, your trading process and make all kinds of assumptions about the parameters and distribution. You then crunch the formulas and solve them. This is one way.

    The other way is just to take all your past history of trades and get a computer to randomly select them to construct synthetic trading histories. If you do thousands of these histories, you have a distribution of weekly returns that you can sort and find out where the 90th percent worse week lies. This is an example of a Monte Carlo approach.
     
    #32     Dec 5, 2006

  3. So to find a Z, I understand the first step is to generate a random number.

    This is what I know about generating random numbers:

    You can generate from a uniform distribution or a normal distribution, depending on the function used.

    I need to understand the first step.

    In the example posted here, the accomodating poster uses

    Rand() in VBA to generate a random number.

    Is this random number/variable either positive or negative? Is it already normally or uniformally deviated away from zero?

    I hope the question makes sense!
     
    #33     Dec 5, 2006
  4. gbos

    gbos

    The VBA gauss function above generates a random number normally distributed with zero mean and standard deviation = 1.

    It uses the Box-Muller transformation, and takes uniformly distributed numbers (Rand function generate uniformly distributed numbers between 0 and 1) and using a transformation it is generating normally distributed numbers.

    http://www.taygeta.com/random/gaussian.html

    You can change the property of the random generated number accordingly. For example if you want it normally distributed with mean = 0 and standard deviation = s then use

    s*gauss()

    etc.

    If you want n correlated and normally distributed random numbers you can create n gauss() numbers and then use a process called Cholesky decomposition to generate the n correlated normally distributed numbers.
     
    #34     Dec 6, 2006
  5. dpt

    dpt

    It's true that many economists did important work on game theory, but I'm not
    sure if it's fair to say that economists invented game theory. For
    `pure' mathematicians, who made many of the important contributions it's a
    fascinating subject in its own right.

    The earliest reasonably modern work in game theory I've heard of was done by
    James Waldegrave in the early eighteenth century. He solved a simple two
    player card game using a minimax approach. I suppose it's pretty possible that
    he had a pecuniary motivation in mind :p

    But even so it's not clear that one could really call that a contribution to
    economics as such, I suppose.

    I don't know who first had the idea of applying such techniques to economics,
    or who actually did it, but it seems a pretty obvious step for a smart economist to
    make, at least in retrospect.

    In the late nineteenth/early twentieth century there's some work by the very
    famous French mathematician Félix Édouard Justin Émile Borel, who had almost
    as many names as a Castilian nobleman. Borel analyzed poker, and Borel
    did envisage applications to economics.

    It's fair to say that the real inventor of modern game theory was John von
    Neumann with his analysis of constant sum games. It's certainly true that von
    Neumann had economic applications in mind and that he definitely pushed that
    aspect of game theory.

    But von Neumann was not really an economist, he was more of a polymath: he had
    a PhD in pure maths, but also held a degree in physics and, I think, chemistry
    too. He was important on the Manhattan project, helped Ulam/Teller on the
    US H-bomb design, and made contributions to many other fields, far too
    numerous to list.

    Game theory is sort of a hybrid subject, I guess, spanning many disciplines.

    Monte-Carlo simulation is basically a method for numerically approximating
    multi-dimensional integrals having complicated boundary conditions as well as
    complicated but non-singular integrands. It works by means of random sampling
    of the integrand over the volume of integration, and it's very commonly used
    in physics.
     
    #35     Dec 6, 2006
  6. MGJ

    MGJ

    One important industrial application of MC simulation is Design For Quality. Tolerances of individual components ("parts") of an end product are expressed as probability distributions, and MC simulations randomly assemble billions of end products from the variable components. The goal is to achieve the highest possible quality of the end product, with the loosest possible tolerance (= lowest cost) components. (book 1) (book 2)

    This is just a multidimensional integral where we are estimating the volume of "the yield body", the polytope which encloses that portion of all end products which meet the quality specification. MC is a wonderful fit.
     
    #36     Dec 6, 2006
  7. ...in my opinion, monte carlo simulation methods can be used for chance evaluation, risk analysis and validation of trading systems.

    I've developed a software product, which supports the trading system development process in two areas:

    1. system simulation is a stress test with huge number of simulation runs using the systemreports or backtesting results of usual trading systems with the objective to get a feeling for the ranges of possible profits and drawdowns of the system.

    2. data simulation has the objective to generate different files based on the original test file, but which is changed using random components and user driven customizing. So it's possible to generate synthetic price data which simulates other market conditions as exist during the period of the historical data and you can test your system also with these new test data files.

    More information here:
    http://www.zentrader.de/html/international____.html

    bye,
    Volker
     
    #37     Dec 14, 2006
  8. Is this anything like the Las Vegas method where I piss all my money up against the wall on blackjack and loose women?
     
    #38     Dec 15, 2006
  9. @Trader28Lite,

    ...perhaps monte carlo simulation methods can help you to leave the casino/markets in time without losing all your money and women... :)

    bye,
    zentrader
     
    #39     Dec 15, 2006