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.

1
vote
1answer
1k views

Traveling Salesman with paths instead of points

I have a rectangular area filled with vector paths (an SVG document, to be precise). Starting at the origin, I need to visit every part of every path. For an open path, like a line or an arc, I would ...
1
vote
2answers
60 views

Generating Standard Uniform random variable

The book I am following has a problem that states: Let $U$ be a Standard Uniform random variable. Show all the steps required to generate Then proceeds to list off questions on generating other ...
0
votes
0answers
9 views

Bayesian LASSO: A step within the Gibbs sampler

I'm intending to implement a Bayesian LASSO inside the Gibbs sampler I use to estimate a multivariate time-series model, but I have a doubt about how to draw this step. The prior is a Double-...
0
votes
0answers
6 views

Define and explain estimation methods used in analysis of simulation output. [closed]

I was solving one of my exam paper of "Simulation and Modeling", this question seems some explain. (Let me know if u need anything.) Thank you for ur time and effort. I hope this is the right ...
-2
votes
1answer
27 views

Discrete probability function Vs Probability density function

I wanted to know some difference between these two "System Simulation" technical points. (It would mean a lot. Thanks ahead. I can't find it anywhere, so.) (Let me know if u need more info)
0
votes
0answers
20 views

Estimating sum of distinct numbers in a list

Suppose that each item on a list of $n$ items has a value attached to it, and let $ν(i)$ denote the value attached to the $i$ th item on the list. Suppose that $n$ is very large, and also that each ...
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 ...
2
votes
0answers
27 views

How can I simulate the Stochastic integral $\int X_sdW_s$ when X is a stochastic process and W is a Brownian motion?

How can I simulate the Stochastic integral $\int_0^1 X_sdW_s$ where $X$ is strong solution of of an SDE driven by a Brownian motion independent of $W$(the integrator above). I have already computed $...
0
votes
0answers
13 views

How can I simulate increments of a two dimensional brownian motion?

I am attempting to simulate an sde system of the following form $$ dX_t=\sqrt{\vert aX+bY\vert}dW^1_t \\ dY_t=\sqrt{\vert cX+dY \vert}dW^2_t $$ where $W=(W^1,W^2)$ is a standard two dimensional ...
0
votes
0answers
16 views

Simulating the Lambert W Distribution…

I am trying to simulate the following distribution, with pdf given by: $$f(t) = \frac{2 \mu (1-\rho) e^{-2 \mu t} (1+\mu \rho t) \left(\rho ^{K+1} e^{\mu t}-\rho ^2 \left(e^{\mu t}-1\right)+\mu ...
1
vote
0answers
27 views

show that $\frac{1}{k^{a-1}} - \frac{1}{(k+1)^{a-1}} \geq \frac{1}{\zeta(a).k^a}c $

I want to Apply the acceptance reject method to the zipf distribution. For that i want to use q(k)= $\frac{1}{k^{a-1}} - \frac{1}{(k+1)^{a-1}}$ I have to show there exist c>1, such that $\frac{1}{k^{...
0
votes
0answers
22 views

Interrogating the results of a Markov-chain simulation - Help and feedback highly appreciated

I have built a Markov chain which simulates the daily routine of German residents (activity patterns). Each simulation day is divided into 144-time steps and the person can carry out one of fourteen ...
0
votes
1answer
29 views

Simulating from a piecewise distribution

I have the following density function: $f(t)=\begin{cases} 0.8\exp(-2t)+0.5 \sqrt\frac{2}{\pi}\exp(-\frac{t^2}{2}) \text{, if } t > 2 \\0.8\exp(-2t)+0.5 \sqrt\frac{2}{\pi}\exp(-\frac{t^2}{2})+0....
0
votes
0answers
10 views

How to simulate data set for exponential hazard function with competing risk.

I want to create a simulation study for two competing events (K=2) with exponential hazard function of lambda 1 = 0.5 and lambda 2 = 1.5. How to generate the competing risk data with the simulation ...
0
votes
1answer
24 views

Possible configurations in a 5*5 square matrix

I noticed a building outside my house with randomly lit rooms and dark rooms. If I treat each one of those windows as a square, is it possible to calculate the total number of patterns that can be ...
0
votes
1answer
694 views

Simple Monte Carlo simulation/approximation of 2 pair in a 5 card poker hand

I am very curious about simulation of an event where an estimating/sampling technique is used. In this example, the goal is to simulate a subset of all the roughly $2.6$ million $5$ card poker hands ...
1
vote
1answer
925 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 ...
0
votes
2answers
7k views

command randn(1,N) in matlab

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

Modeling path of a rolling ellipse

I'm trying to solve Project Euler problem 525. My approach is to find a parametric equation that can model the path of the center point as it rolls, then take the arc length of that function for one ...
9
votes
2answers
346 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 ...
6
votes
3answers
650 views

strange duel chances and my analysis

There is two guy, A and B they are shooting each other by turns, A shoot first, A has 30 percent chances to shoot and kill B and 70 percent to miss, B has 50 percent chances to kill A and 50 percent ...
0
votes
0answers
21 views

Modelling Random Variables with Specified PDF and Correlation

I am trying to develop a radar simulation system that is able to generate random processes whose elements are taken from a specified probability density function and have also have a specified ...
0
votes
0answers
30 views

simulation/ probabilty

Suppose a population control plan for the country of Transylvania allows parents to have at most four children each, and they must stop having children when they get two girls. Explain how to ...
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{...
1
vote
0answers
16 views

energy density spectrum vs energy spectral density

I am doing a project on ocean wave simulation and there is a formula I am trying to test. It is called the random coefficient scheme and it is meant to simulate a random time series. One part of the ...
2
votes
1answer
280 views

Can I develop a LQR if the system is NOT controllable but stable?

I have this system. It's a hydrulic piston which pushes a mass $M$ and that mass pushes a bending beam. The beam has a stiffness $k_3$ and a damping $b_2$ due to the rotation velocity and position. ...
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 \...
0
votes
0answers
12 views

If $v_t=cv(u-d)$ is scaled to $v_t=v(u-d)$, then what does “scaling $t$ by $c$” apply to?

If $v_t=cv(u-d)$ is scaled to $v_t=v(u-d)$, then what does "scaling $t$ by $c$" apply to? Particularly, this equation is advanced w.r.t. time $t$. But if one scaled it, then does it mean that e.g. $\...
0
votes
0answers
7 views

How is normalization of coefficients in Lotka-Volterra done?

I'm only able to find very vague references about this, such as: https://zone.biblio.laurentian.ca/bitstream/10219/2795/1/Draper_Paul_MSc_Thesis.pdf But nothing seems to explain, how exactly is the ...
2
votes
1answer
26 views

Lotka-Volterra: is stability analysis done on both equations separately or to their sum?

Lotka-Volterra: is stability analysis done on both equations separately or to their sum? So if the systems are e.g. notated as: $$u_t=u(v-1)$$ $$v_t=v(1-u)$$ then would one do stability analysis ...
2
votes
0answers
18 views

Scaling behavior Levy flight (distance from the origin v number of steps)

In the question Numerical approximation of Levy Flight the implementation of a Levy-flight random walk with Matlab was discussed. For a classical random walk (Brownian motion), we have that the ...
0
votes
0answers
12 views

What should I study in order to understand and develop “deformations”?

What should I study in order to understand and develop "deformations"? In order to describe how e.g. parts may deform? Intuitively deformation is solving DEs on some object meshes. However, I ...
0
votes
0answers
31 views

How to do Monte Carlo Method for exceedingly large numbers?

For a paper I'm writing for my math class, I need to do several Monte Carlo simulations for a game I'm playing. The $p=0.6190411273$, a normal number... but the $n=2.14974(10^{10})$. I've tried to run ...
0
votes
0answers
24 views

Proposal density of Metropolis algorithm

I am new to the Metropolis-Hastings algorithm and am trying to wrap my head around the key points of it. I understand that it uses a Markov Chain Monte Carlo simulation to sample points throughout a ...
0
votes
0answers
32 views

Is there any mathematical formula to calculate the minimum value from the below presumption?

I am trying to balance a board game, where monsters activated based on a given rule, and I am looking for a formula, which takes in account the attacks of the heroes (2-4 heroes [noh], each with a ...
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 ...
0
votes
1answer
32 views

is there a formula to “invert” the binomial distribution - for simulation purposes

My apologies if this should be in one of the programming sites rather than the mathematics one... I decided it was theoretical enough to post here. Feel free to move if someone with authority ...
0
votes
0answers
19 views

simulation of customer negotiation strategies using R

If I ask the question in the wrong forum, let me know, I will delete it. It is still difficult for me to decide the forum. I am currently studying the issue of Models for customer-supplier negotiation ...
1
vote
0answers
16 views

Is having a burn-in time relevant when only trying to sample from a distribution?

I'm trying to simulate - via the Metropolis-Hastings algorithm - a sample $X$ of size 10000 from a density $f$ using a proposal distribution $g$. The Markov chain $X$ obtained by this algorithm has ...
3
votes
0answers
41 views

How to implement an insurance risk model

So the problem goes as follows: "Suppose that the different policyholders of a casualty insurance company generate claims according to independent Poisson processes with a common rate $λ$, and that ...
0
votes
0answers
39 views

Is there a way to solve differential equation $\dot x = f(x,u)$ with linear algebra?

I'm going to solve a ODE system on the form: $$\dot x(t) = f(x(t),u(t))$$ Where an example of the system migth look like: $$(\dot x_1(t) ,\dot x_2(t) ,\dot x_3(t))= a x_1(t) + b x_2 (t) + c x_3 (t) +...
0
votes
0answers
39 views

Pros and cons of multivariate interpolation techniques for scattered data?

I have a numerical simulation $f$ that takes 6 input parameters $\mathbf x = x_1, x_2, \ldots x_6$. I have randomly selected $25,000$ random combinations of these inputs and calculated $f(\mathbf x)$. ...
0
votes
1answer
9 views

Simulate the number of times a random condition is met in n attempts

If every time a condition is evaluated, there is exactly an x chance of it succeeding (RAND() < x), is there any way to ...
0
votes
1answer
56 views

How to discard negative values while adopting Monte Carlo?

I am trying to simulate a random variable, for a Monte Carlo simulation, which is equal to another Normal random variable, superimposed with a zero mean gaussian random variable as specified below -- ...
0
votes
1answer
38 views

Richards equation unique solution

Richards equation is used for describe flow in unsaturated porous media: $$C{(h)}\frac{\partial h}{\partial t}= \nabla [K{(h)} \nabla (H)]$$ $h=$ capillary pressure $K$ and C properties in ...
2
votes
0answers
87 views

May the Euler equations, rather than the Navier-Stokes equations, generate turbulent flow?

In general, I think turbulence is resulted only from the viscosity term as in the Naiver-Stokes equation, and it dissipates energy in the flow. But the compressible Euler equations, which already ...
1
vote
0answers
51 views

Simulation of hitting time of brownian motion with drift

I want to generate the hitting time of brownian motion with drift (upper and lower depending on some binomial random variable $\delta = 0,1$). $\tau^{up} = inf(\tau : \mu \tau + \sigma W_{\tau}\ge h)...
0
votes
0answers
27 views

Derivation of tau time-stepping in Gillespie algorithm?

I'm trying to find the derivation of tau ($\tau$) in the Gillespie algorithm. All the papers and chapters I've found simply say, without actually showing its derivation: "Tau is given by" $\tau = \...
0
votes
0answers
20 views

For simulation purposes, how long samples to draw from distributions?

For simulation purposes, how long samples to draw from distributions? E.g. if I want something to follow an exponential distribution with mean 25, then upon trialing in scipy I found that ...
0
votes
2answers
32 views

Stretching the Brownian Motion in $[0,1]$ to get another Brownian Motion in $[0,t]$

I'm running a simulation of a Standard Brownian Motion by limit of a Symmetric Standard Random Walk $\{S_n ,n\geq 1\}$ and $S_n=\sum_{k=1}^n X_k$, where $$P(X_k =-1)=P(X_k =1)=\frac{1}{2},$$ and ...