Hi, I try to simulate using NestWhileList. In each iteration a list of three elements is generated. The test is a condition on one of the elements.
NestWhileList[{RandomReal[
ExponentialDistribution[\[Lambda] +
If[#[[2]] > 0, \[Mu], 0]]], #[[2]] +
2 RandomInteger[
BernoulliDistribution[\[Lambda]/(\[Lambda] +
If[#[[2]] > 0, \[Mu], 0])]] -
1, #[[1]] + #[[3]]} &, {RandomReal[
ExponentialDistribution[\[Lambda]]], 0, 0}, #[[3]] & < T]
Yet, it does nothing, in the meaning that the test fails right away and the output is
{{1.8569, 0, 0}}
It has no relation to the random ingredients, because I tried the same idea with fixed functions and the outcome is the same. The test does not read from the array the way I want it?
Thanks, Yoav