# Re: converting a R code to fortran

• From: "e p chandler" <epc8@xxxxxxxx>
• Date: 3 Mar 2007 12:22:15 -0800

On Mar 1, 2:20 pm, "fortee" <hongch...@xxxxxxxxx> wrote:
On 3월1일, 오후12시42분, Michel Olagnon <molag...@xxxxxxxxxxxxxxxxx> wrote:

fortee wrote:

I tried this code, but somehow I can't get what I want. I am
doublechecking on the R code, If my code is correclty structured by
the R code, then I should get the same table with n=40 and r=2000.. But
I can't get that result. I don't know why. It there anyone who can
look at two code and find something different or something wrong in my
code?

How different are your results ? Monte-Carlo simulations with different
languages use different random number generators and may give different
though right results.

I started from your program (except that I did not have the poisson
number generation), and kept checking that the results were the same
as with a previous version when I made changes. But of course, at some
stages I had to change N and r, so at some point I may have made a mistake.

I don't mean your code is wrong. I mean the difference between the
result of my code and the table from the webpage are huge. I think I
did exactly the same structure as in the algorithm of the webpage.
Given a critical value, say 0.96, I have 0.5 but 0.05 in the table.
There must be something wrong in my code. I am now checking upon the R
code with replicating the code in R. Thank you.

I assume you mean the table found at http://www.mcs.vuw.ac.nz/~ray/Brownian/.

This does not look like what I would expect from a table of KS
statistics. IIRC, the critical value (for "two sided") KS/sqrt(n) at
the 5% level is 1.36 for large n. Yet in this table the corresponding
value for which p=.95 is approximately 2.48.

.

## Relevant Pages

• Re: converting a R code to fortran
... doublechecking on the R code, If my code is correclty structured by ... languages use different random number generators and may give different ... did exactly the same structure as in the algorithm of the webpage. ...
(comp.lang.fortran)
• Re: converting a R code to fortran
... doublechecking on the R code, If my code is correclty structured by ... languages use different random number generators and may give different ... did exactly the same structure as in the algorithm of the webpage. ... There is an asymptotic formula for calculating the CDF of K (D * ...
(comp.lang.fortran)
• Re: converting a R code to fortran
... fortee wrote: ... but somehow I can't get what I want. ... doublechecking on the R code, If my code is correclty structured by ... languages use different random number generators and may give different ...
(comp.lang.fortran)
• quantum random number generators?
... quantum random number generators with fortran, ... According to the webpage it's easy enough, ... and there are drivers for a range of OS. ...
(comp.lang.fortran)