I am having trouble understanding the Poisson process generated as the following (in MATLAB):
- Choose the number of points, i.e., $N$ and a parameter $\mu$;
- Compute $y = rand(N,1)$, i.e., $N$ random points generated from the $rand$ function in MATLAB which follow a standard uniform distribution, i.e., $y \sim U(0,1)$;
- For each element in the vector $y$, set $dX = \begin{cases} 1 \ &\text{if} \ y < N^{-\mu}, \\ 0 \ &\text{otherwise}; \end{cases}$
- Desired process $X(t) = \int_{0}^{t} dX$.
I don't understand this way of obtaining the process, in particular, the role of parameter $\mu$. Is $\mu$ related to the intensity of a Poisson process, if so, how? Also in this way, there is a restriction on the values that the parameter can take, for instance, can not be very small.
Any comments would be much appreciated.
Edited: The above is implemented in MATLAB as the following function:
poisson=@(mu) (cumsum(double(rand(N,1) < N^(-mu)))) ;
Your description of the code is not extremely clear, but it seems like it generates $N$ points with a rate of $\mu$.
The code uses inverse transform sampling. If $X$ follows a uniform distribution on $[0,1]$, $F^{-1}(X)$ follows the distribution of $F$. The interarrival times of a Poisson process follow an exponential distribution, so $F(x) = 1-\exp(-\lambda x)$, so the interarrival time $Y$ satisfies $X \sim 1-\exp(-\lambda Y)$. Since $X$ and $1-X$ both follow a uniform distribution $X \sim \exp(-\lambda Y)$.