Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [simulation]

A vast area which includes generating results from computer models.

3
votes
2answers
950 views

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

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, ...
37
votes
1answer
53k views

Generate Correlated Normal Random Variables

I know that for the $2$-dimensional case: given a correlation $\rho$ you can generate the first and second values, $ X_1 $ and $X_2$, from the standard normal distribution. Then from there make $X_3$ ...
46
votes
4answers
5k views

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 ...
50
votes
7answers
3k views

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). ...
8
votes
3answers
6k views

Probability that a quadratic equation with random coefficients has real roots

Consider quadratic equations $Ax^2 + Bx + C = 0,$ in which $A, B,$ and $C$ are independently distributed $Unif(0,1).$ What is the probability that roots of such an equation are real? This problem is ...
15
votes
3answers
3k views

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 ...
17
votes
2answers
16k views

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 ...
10
votes
3answers
2k views

Why is a simulation of a probability experiment off by a factor of 10?

From a university homework assignment: There are $8$ numbered cells and $12$ indistinct balls. All $12$ balls are randomly divided between all of the $8$ cells. What is the probability that there is ...
4
votes
1answer
551 views

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 ...
2
votes
1answer
122 views

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 ...
0
votes
1answer
195 views

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 ...
0
votes
1answer
1k views

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 ...
8
votes
2answers
662 views

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 ...
4
votes
1answer
171 views

How to numerically test a limsup? (Example : numerical simulation of the law of iterated logarithm)

I have a random walk $S_n$ (the increments are Bernoulli $\pm 1$ with probability $1/2$ each). I'd like to test numerically the Law of iterated logarithm: $$\limsup_{n \rightarrow \infty} \underbrace{...
4
votes
1answer
228 views

Numerical evidence of law of iterated logarithm (random walk)

The law of iterated logarithm states that for a random walk $$S_n = X_1 + X_2 + ... X_n$$ with $X_i$ independent random variables such that $P(X_i = 1) = P(X_i = -1) = 1/2$, we have $$\limsup_{n \...
8
votes
2answers
7k views

Numerical approximation of Levy Flight

I'm trying to produce a computer simulation of a Levy Flight in 2-dimensions; an approximation would be ok. Please excuse the simplistic level of this question: my maths is very rusty. My proposed ...
1
vote
1answer
170 views

How to simulate visits to a transient state of a Markov chain.

Consider a discrete-parameter Markov chain $\{X_n, n ≥ 0\}$ with state space $E$, transition probability matrix $P$ and initial-state probabilities $p(0)$ given by $E = \{0, 1, 2, 3\}$, P = $\begin{...
0
votes
1answer
599 views

Reciprocal of a normal variable with non-zero mean and small variance

$X$ is a normal random variable: $$X \sim \mathcal{N}(\mu,\sigma^2)$$ Then $Y = 1/X$ has the following probability density function (see wiki): $$f(y) = \frac{1}{y^2\sqrt{2\sigma^2\pi}}\, \exp\left(...
2
votes
1answer
130 views

Probability of equal no. of red/black cards from selection - simulation vs. answers discrepancy

Following reading this thread: "Probability of drawing exactly 13 black & 13 red cards from deck of 52", I created a simple simulation using Excel/VBA to help my son grasp the concept - he's only ...
2
votes
1answer
88 views

Find a>1 s.t. $a^x = x$ has a unique solution

What $a$ makes $\{x\mid a^x = x\}$ a singleton? $$(1.4444)^x - x \le 0 \tag 1$$ has real solutions. $$(1.4447)^x - x \le 0 \tag 2$$ has no real solutions. I guess $1.4444 < a < 1.4447$ I ...
2
votes
1answer
141 views

Random sample generated for i.i.d variables [closed]

My attempt: Since $f(y;a) = \frac{1}{2a}exp(\frac{-y}{2a})$ for $y>0$, and $f(y;a) = \frac{1}{2a}exp(\frac{y}{2a})$ for $y<0$, it is easy to see $A_n$ is a sufficient statistics for a family $T$ ...
1
vote
1answer
168 views

Two Questions Regarding Gaussian Quadrature

I'm learning about the Gauss-Hermite Quadrature method on my own so I apologize if these questions seem trivial, but since I haven't found any online resources which specifically answer my questions I ...
1
vote
1answer
2k views

Bootstrap estimation of the 95% confidence intervals for the 95% quantile for gamma distribution

I cant find any where information or algorithm how to apply in steps the bootstrap procedure to estimate the 95% confidence intervals for the 95% quantile from a random sample. Does anyone knows how ...
1
vote
1answer
521 views

How can one use a probability distribution to sample from a population

Let us assume that we have a population and we interested in specific property of each element of this population. Let us assume further that this property follows a normal distribution X ~ P(M,Sigma)...
1
vote
1answer
720 views

how to simulate from joint distribution by conditioning

I have a simple question about simulation from joint distribution. Suppose $(X,Y)$ has a joint distribution $p(x,y)$, and we know the marginal of $Y$, $p(y)$, and the conditional distribution of $X$ ...
0
votes
3answers
2k views

Transfer function technique VS State space technique

What do you prefer best? Transfer functions or state space? I know there is a lot of question who get the anser "None of them are best. They complementing each other". But in control theory, I ...
0
votes
0answers
65 views

least square fitting to a non-linear curve

The model is already proved to be correct for a previous simulation. Trying to apply the same for a new set of data. There are few constants, couple parameters with X. Both X and Y are derived from ...