Articles of simulation

Drunkards walk on a sphere.

I simulated the following situation on my pc. Two persons A and B are initially at opposite ends of a sphere of radius r. Both being drunk, can take exactly a step of 1 unit(you can define the unit, i kept it at 1m) either along a latitude at their current location, or a longitude. […]

Monte-Carlo simulation with sampling from uniform distribution

I used to work with Monte-Carlo simulations for a while. In my case, I generated random data for a variety of input parameters according to uniform distributions (with non-negative support), say for example two variables $a$ and $b$ where data is generated: $a_1, \dots, a_n \leftarrow U(1,2)$ and $b_1, \dots, b_n \leftarrow U(4,5)$. Eventually, I […]

Simulate simple non-homogeneous Poisson proces

Consider a Poisson process whose conditional intensity is $$\lambda(t) = \alpha e^{-t}$$ starting at time $t=0$ for some parameter $\alpha>0$. I would like to simulate arrival/event/failure times as efficiently as possible. (I am not sure what the standard term is for the times you get from a Poisson process.) Is there a fast way to […]

Managing a bond fund: Simulating the maximum of correlated normal variates

Two rating agencies score the safety of bonds in a particular population on separate standard normal scales. Because the two agencies take some of the same factors into account in their ratings, the correlation between the scores of the two agencies is $\rho = 0.8.$ A bond fund manager will consider a particular bond from […]

Computational methods for the limiting distribution of a finite ergodic Markov chain

We wish to show what can be discovered about the limit of a finite, homogeneous, ergodic Markov Chain $X_1, X_2, \dots,$ using simple methods of computation and simulation. Specifically, consider the chain with state space $S = \{0, 1, 2\}$ and transition matrix $P = \begin{bmatrix}p & q & 0 \\0 & p & q […]

What is the optimal path between $2$ fixed points around an invisible obstructing wall?

Every day you walk from point A to point B, which are $3$ miles apart. There is a $50$% chance each walk that there is an invisible wall somewhere strictly between the two points (never at A or B). The wall extends $1$ mile in each direction perpendicular to the line segment (direct path) between […]

Simulating uniformly on $S^1=\{x \in \mathbb{R}^n \mid \|x\|_1=1\}$

A scheme to generate random variates distributed uniformly in $S^2=\{x\in \mathbb{R}^n \mid \|x\|_2=1\}$ is well known: generate a standard normal variate in $\mathbb{R}^n$ and normalize it to unit norm. Is there a similarly simple and clever procedure to simulate uniformly distributed variates on the $1$-ball $S^1=\{x \in \mathbb{R}^n \mid \|x\|_1=1\}$?

Implementing Ornstein–Uhlenbeck in Matlab

I am reading this article on Wikipedia, where three sample paths of different OU-processes are plotted. I would like to do the same to learn how this works, but I face troubles implementing it in Matlab. I think I have to discretize this equation somehow: $ x_t = x_0 e^{-\theta t} + \mu(1-e^{-\theta t}) + […]

What are numerical methods of evaluating $P(1 < Z \leq 2)$ for standard normal Z?

Let $Z \sim Norm(0, 1)$ and denote its PDF and CDF by $\phi$ and $\Phi$ respectively. Then, theoretically, $P(1 < Z \leq 2) = \Phi(2) – \Phi(1).$ However $\Phi$ cannot be expressed in closed form, so some sort of computational method is required to obtain a numerical answer. The traditional method has been to consult […]

Why is this coin-flipping probability problem unsolved?

You play a game flipping a fair coin. You may stop after any trial, at which point you are paid in dollars the percentage of heads flipped. So if on the first trial you flip a head, you should stop and earn \$100 because you have 100% heads. If you flip a tail then a […]