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

Martin Becker martin.becker at mx.uni-saarland.de
Wed Aug 30 13:31:21 CEST 2006


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




More information about the R-devel mailing list