Skip to content
Prev 267316 / 398502 Next

Is R the right choice for simulating first passage times of random walks?

Am Montag, den 01.08.2011, 12:43 -0400 schrieb R. Michael Weylandt :
I already did that, saved the result and ran it again. I also found [1]
and will look to do these things in parallel, since the simulations do
not depend on each other. I hope I can avoid the matrix then and use
just `replicate()`.
I was looking for such a feature the last days and read to set the
variables to `NULL` to delete them somewhere. Now I found the correct
command. Thank you!
Noted for when I need that again.
That is indeed correct. The generating function of the first hitting
time of zero T? is (g_T?)(s) ? 1/s (1 - \sqrt(1 - s). Therefore

(g_T?)?(s) ? 1/s? (1 - \sqrt(1 - s) + 1/s (2(1 - s))^(-?) ? ? for s ? 1.
Apparently there are several ways to prove that.
I do not know. It scares me. ;-) For the symmetric simple random walk
S_n ? ?_{i=0}^n X_i I want to verify (1).

(1)	n^(-?) ~ p_n ? P(max_{1 ? k ? n} S_n < 0)

a(x) ~ b(x) means that the quotient converges to 1 for x ? ?.

[?]
I am sorry, I meant *integrated* random walk [3][4]. Basically that is
the integral (?area? ? can be negative).

	A_n ? ?_{i=0}^n S_i = ?_{i=0}^n (n - i + 1) X_i

Being 0, S? and X? can always be omitted. So I basically just need to do
one `cumsum()` more over the walks.
No problem at all. I already was confused that it looked differently
(transposed) after the first `apply()`. But it made sense.


Thanks,

Paul


[1] http://www.bioconductor.org/help/course-materials/2010/BioC2010/EfficientRProgramming.pdf
[2] http://www.steinsaltz.me.uk/probA/ProbALN13.pdf
[3] http://www-stat.stanford.edu/~amir/preprints/irw.ps
[4] http://arxiv.org/abs/0911.5456
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110802/9ef937bf/attachment.bin>