A vast area which includes generating results from computer models.

learn more… | top users | synonyms

1
vote
2answers
162 views

Calculate maximal island of ones in a matrix

I have came up with a problem involving matlab and matrices with entries 1 or zero. The matrix represents people in a footballstadium, doing a wave. If a person does the wave, he has a one in the ...
1
vote
0answers
95 views

Kalman Filter application to non-linear system.

I want to use the Kalman filter to have a better estimate of the state of a system which I know its equations of motion: ...
6
votes
1answer
96 views

Distribution of time spent above $0$ by a Brownian Bridge.

Let's say I have a Brownian motion, such that I know its value at time 0 (0) and time T (also 0). I am trying to evaluate the time spent above 0 between time 0 and T. Obviously I know that the ...
1
vote
0answers
54 views

simulate hitting time of Brownian motion

let's say I have a brownian motion $W_t$, and I know the value of $W_1$. Is there a way to simulate the hitting time of $W_t$ and a given function $f(t)$ ? For instance I know that if $f(t)$ is a ...
1
vote
0answers
45 views

Random graphs simulation

Reading the article "Emergence of scaling in random network, by Barabasi and Albert" I faced a lot of results obtained by simulations of the A-B random graph model. I always wanted to do such ...
0
votes
1answer
26 views

Determining simulation threshold

Let's suppose we have some sort of game (for instance tic-tac-toe) with a limited amount of moves. I want to simulate that game, and with that I will use a random number generator (RNG) to calculate ...
0
votes
1answer
551 views

R - generate sample that follows a geometric distribution

I'm having trouble coming up with an algorithm that generates a sample (X1,...,Xn) of size n, considering several values for n, where the random variable Xi – “number of trials until the first success ...
2
votes
4answers
2k views

How do I simulate a simple pendulum?

I have the equation of motion of a simple pendulum as $$\frac{d^2\theta}{dt^2} + \frac{g}{l}\sin \theta = 0$$ It's a second order equation. I am trying to simulate it using a SDL library in C++. I ...
2
votes
2answers
55 views

Analytic methods vs Monte Carlo (terminology)

What's the correct terminology to say "We can calculate the probability exactly using pure math, as opposed to Monte Carlo simulation"? Analytically sounds like we need Calculus, which we may not ...
1
vote
1answer
39 views

Question about the Monte Carlo Algortihm

I was reading the Monte Carlo algorithm for finding the area under a curve, say $y=f(x)$. The algorithm considers, $0\le f(x)\le M$ over the closed interval $a\le x\le b$. My question is,that why is ...
1
vote
1answer
91 views

Calculating cumulative Markov Chain outcomes

I have a Markov process, with 2 possible states (1 or 0) and a transition matrix P. State at time t=n is determined by x0*Pn. As n goes to infinity, xn goes to the steady state vector, q = [q1 q2]. ...
0
votes
1answer
34 views

Finding variance .

Suppose that $f : [0, 1] → [0, 1]$ and we wish to estimate $$I = \int_{0}^{1} f(x) dx$$ Using the hit-and-miss method, we obtain the estimate $$\hat I_{HM}=\frac{1}{n}\sum_{i=1}^{n}X_i$$ where ...
0
votes
1answer
84 views

Finding Area and probability[ hard nut to crack].

Suppose that $X$ and $Y$ are iid uniform distribution with $U(0, 1)$ random variables. (a) What is $\mathbb P((X, Y ) ∈ [a, b]×[c, d])$ for $0 ≤ a ≤ b ≤ 1$ and $0 ≤ c ≤ d ≤ 1$ ? What is $\mathbb ...
0
votes
1answer
286 views

Plot the cdf and simulate a random variable (rv) with this cdf using the inversion method.

Consider the continuous random variable with pdf given by: $$f(x) = 2(x − 1)^2;\quad 1 < x ≤ 2$$ $$f(x) = 0;\quad \text{otherwise}$$ Plot the cdf for this random variable. Show how to simulate ...
0
votes
1answer
33 views

Congruential Generators.

Find all of the cycles of the following congruential generators. For each cycle identify which seeds $X_0$ lead to that cycle. $$(a). X_{n+1} = 9X_n + 3\mod 11$$ $$(b). X_{n+1} = 8X_n + 3\mod 11$$ ...
1
vote
1answer
58 views

Simulating Poisson distribution

I'm wondering if it is possible to simulate the Poisson distribution using the Alias Method, because we suppose to use this method for discrete random variables with finite support. So I think finite ...
1
vote
1answer
91 views

How to Prove by definition, the given process is a Markov Process?

Define the process Xt by X0 = 1, and for t = 1, 2, . . . Xt = { uXt-1, with probability p, { vXt-1, with probability 1-p where 0 < v < 1 ...
1
vote
1answer
50 views

Simulation of typical cell in Poisson Voronoi tessellation

I would like to simulate a typical cell in Poisson-Voronoi tessellation model. I want to save the Cartesian coordinates of all vertices of the typical cell for each realization. How to do it? Thank ...
1
vote
0answers
60 views

Samples from the Dirichlet measure

In Ferguson, 1973, Definition 2, he defines a sample of size $n$ from a random probability measure $G$ on $(\mathcal{X}, \mathcal{B})$ as: $$ P(X_1 \in C_1, \cdots, X_n \in C_n | G(A_1), \cdots, ...
5
votes
1answer
9k 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$ ...
0
votes
0answers
52 views

STINT Approximate stochastic integrals

This is a matlab code to simulate stochastic integrals: ...
0
votes
2answers
3k views

command randn(1,N) in matlab

This program is in Matlab to simulate Brownian motion Generating GBM: ...
0
votes
1answer
108 views

Why calculating variance this way is wrong?

I'm conducting a set of computer simulations (of membrane). I sample a property (area, $a$) in the following manner: $ A = \sum _1^N a \\ S = \sum _1^N a^2 $ During my data analysis, I calculate ...
1
vote
1answer
51 views

Is it allowed to use the quadratic solution formula for a differential equation

I have some trouble with a challenging fluid mechanics problem. The problem leads me to a non-linear ode 1st order. $0={\dot p_C}^2+\frac{k_1}{k_2 C}\dot p_C+\frac{p_C-p_0}{k_2C^2}$ My Idea was now ...
0
votes
1answer
227 views

How to simulate IMU data using position and orientation?

I want to make a simulator to verify that my imu algorithm is working. I am given: $p_0$ - starting position $p_1$ - final position $q_0$ - starting orientation $q_1$ - final orientation I want ...
1
vote
1answer
47 views

Simulation Model

How do I find the Inter-arrival time when the Inter-arrival time is described on as exponentially distributed with mean of 12 minutes? This is a single server model with a generalized service time. I ...
1
vote
0answers
31 views

Single evaluation for using exponential sampling until past a point

I am trying to improve an algorithm that looks like the following (and am getting stumped): I am provided with a starting time, rate, and a target time. I then use an exponential distribution to ...
0
votes
1answer
632 views

Poisson Process, Exponential inter-arrival times simulation conundrum

I am trying to simulate a poisson process by using the fact that the inter-arrival times are distributed as an exponential distribution. I want to generate patient arrival times in (say) 1 hour. So, ...
0
votes
1answer
347 views

Runge-Kutta 4 explanation

I'm a game developer and I need to write a solar system simulation. Unfortunately I'm not very good at math and most importantly I haven't got to differential equations in my maths classes at school ...
2
votes
1answer
457 views

Numerical/artifical damping in forward Euler?

I'm testing a code to find periodic solutions of nonlinear structural vibrating systems by solving a global time-discretized periodic system of equations. I am using a forward Euler (first order ...
3
votes
0answers
70 views

Classify knots in a closed bead-spring like polymer simulation

my problem is to detect the crossing number (or another knot invariant) of a simulated polymer. A polymer is a closed bead spring, which mean that it is represented by a set of points connected by ...
1
vote
0answers
47 views

Simulating of GBM

I have a question regarding the simulation of a GBM. I have found similar questions here but nothing which takes reference to my specific problem: Given a GBM of the form $dS(t) = \mu S(t) dt + ...
1
vote
1answer
316 views

Rejection method for beta distribution?

I have the follow function, $$\frac{8}{\pi}(x(1-x))^{1/2} 0<x<1$$ I am asked to use $U(0,1)$ as an envelope to construct a rejection algorithm for simulation samples from $Beta(3/2,3/2)$ with ...
1
vote
0answers
116 views

Approximation of SDE

I have been struggling with the following problem: If you want to find a numerical result by simulating the paths of a stochastic differential equation, in particular a geometric brownian motion I ...
1
vote
1answer
446 views

Simulation of a Gaussian process on $R^2$ with a stationary kernel using the Karhunen-Loève expansion

Assume $X(\omega, t) \sim \mathcal{N}(0, K(\cdot, \cdot))$ is a real-valued, centered Gaussian process on $R^2$, i.e., $X: \Omega \times R^2 \to R$. Let the covariance function of the process be ...
2
votes
0answers
117 views

Positive eigenvalues in differential-algebraic equations not appearing in time-domain simulation

I am solving a system of equations derived from power system applications. It consists of index-1 differential and algebraic equations in the form: $$\dot{x}=f(x,y) \\ 0=g(x,y)$$ To get the ...
1
vote
2answers
169 views

simple (tan like shape) function needed

I need a function which initially falls slowly, then quickly and then slowly again. Shape should be like tan but I want to be able to control the gradient Properties needed: $x = 0, y=0$ As $x$ ...
1
vote
1answer
308 views

What are the differences between the random walk and the gaussian random walk?

I know the random walk mobility model, but I can not understand what are the differences with respect to gaussian random walk. In other words, I know how to implement the two-dimensional random walk: ...
0
votes
1answer
103 views

Moss scheduling Simulator and Standard Deviation in plain english?

source : http://www.ontko.com/moss/sched/user_guide.html Configuration File Options standdev n * The number of standard deviations from the average length of time a process should execute ...
4
votes
2answers
80 views

Letter in the table with 8 trays

Here is a problem: we have a table with 8 trays. With probability $0.5$, there is a letter somewhere in the table. What is the probability that there is a letter in a last tray, given that there is no ...
1
vote
0answers
109 views

Maximizing noisy unknown function

I'm interested in maximizing a function $f(\mathbf \theta)$, where $\theta \in \mathbb R^p$. The problem is that I don't know the analytic form of the function, or of its derivatives. The only thing ...
1
vote
2answers
3k views

Please help me solve this exponential distribution problem

Question 1 : The time to service a customer at a bank teller's counter is exponentially distributed with mean of 60 seconds. What is the probability that the three customers in the front of an ...
0
votes
1answer
53 views

How to resolve this?

I've the following problem to model and program it: suppose that we have a central server that provides 3 different services($S_1,S_2,S_3$), there are $N$ machines connected to this server: each ...
4
votes
2answers
95 views

What do I need to know to simulate many particles, waves, or fluids?

I've never had a numerical analysis course so I don't know what I need to know. I'm just wondering what kind of books I should get to make me able to simulate these things. I'm wanting to simulate ...
0
votes
1answer
70 views

$4$ way heat distribution multiplier problem

I'm making a simple heat distribution program. It's a $2D$ matrix with cells holding heat value. Every iteration looks for cells near current which have lower heat value and gives them some of its ...
1
vote
1answer
58 views

Comparing speed in stochastic processes generated from simulation?

I have an agent-based simulation that generates a time series in its output for my different treatments. I am measuring performance through time, and at each time tick the performance is the mean of ...
4
votes
1answer
400 views

Integral over the $\mathcal{S}^{n-1}$ sphere

I have been running into the following integral again and again: Let $S^{n-1}= \{x \in \mathbb{R}^{n} \: | \: ||x||=1 \}$ and let $\lambda_{S^{n-1}}$ denote the surface measure over $S^{n-1}$ as ...
1
vote
0answers
185 views

Expected value involving a conditional multinomial distribution

$X|z$ has a multinomial distribution $MN(m, \mathbf{q}(z))$ where $z$ is either 0 or 1 with probability $1/2$. I need to find: $E_X[\max\{\Pr(z=1|X), \Pr(z=0|X\}]$. Is there an analytical form to ...
2
votes
0answers
135 views

Simulating first passage times

I have a Brownian motion $X_t = \mu t+\sigma W_t$, where $W_t$ standard Brownian motion. I know that the first passage time $\tau = \min\{t|X_t\leq\alpha\}$, is Inverse Gaussian distributed i.e., ...
1
vote
1answer
444 views

Fourier Transform of a Covariance Function for Spectral Simulation

I am learning about generating Gaussian random fields by spectral simulation... If I have a covariance function $C(h)$, then the spectral density is the Fourier transform of $C(h)$: ...