From martin.becker at mx.uni-saarland.de  Wed Aug 30 13:31:21 2006
From: martin.becker at mx.uni-saarland.de (Martin Becker)
Date: Wed, 30 Aug 2006 13:31:21 +0200
Subject: [Rd] Speed of runif() on different Operating Systems
In-Reply-To: <Pine.LNX.4.64.0608301110390.27066@gannet.stats.ox.ac.uk>
References: <44F2FC78.3040106@mx.uni-saarland.de>
	<Pine.LNX.4.64.0608281535580.652@gannet.stats.ox.ac.uk>
	<44F5634B.8090801@mx.uni-saarland.de>
	<Pine.LNX.4.64.0608301110390.27066@gannet.stats.ox.ac.uk>
Message-ID: <44F57709.10406@mx.uni-saarland.de>

Prof Brian Ripley schrieb:
>> The standard method for simulating final, minimal and maximal values of
>> Brownian Motion relies on a (discrete) n-step random walk approximation, where
>> n has to be chosen very large (typically n=100 000) to keep the bias induced
>> by the approximation "small enough" for certain applications. So if you want
>> to do MC option pricing of e.g. double barrier options, 5e8 random uniforms
>> are needed for 5 000 draws of final, minimal and maximal value, which is still
>> a quite small number of draws in MC applications. I am working on a faster
>> simulation method and of course I want to compare the speed of the new and
>> (old) standard method, that's why I needed large numbers of random uniforms. I
>> thought that the particular application is not of interest for this list, so I
>> left it out in my initial submission. I apologise, if my submission was
>> off-topic in this mailing list.
>>     
>
> Isn't that usually done by adding rnorm()s and not runif()s?
>
> There are much better algorithms for simulating Brownian motion
> barrier-crossing statistics to high accuracy.  It's not my field, but one 
> idea is to use scaled Brownian bridge to infill time when the process is 
> near a boundary.
>
> Sometimes the R helpers spend a long time answering the wrong question, 
> which is why it always helps to give the real one.
>   
As I wrote, I am working on (an implementation of) a faster method, 
which indeed uses Brownian bridge and related concepts, and I generated 
the huge number of random uniforms (random normals are better but still 
slower) just for speed comparison. So for me, the real question was 
about the speed difference of runif().

Thanks again, regards,

  Martin




[Rd] Speed of runif() on different Operating Systems
Martin Becker