Stack Exchange Network

Stack Exchange network consists of 174 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.

0
votes
0answers
9 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
22 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
16 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
27 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 ...
0
votes
0answers
14 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
13 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 ...
2
votes
0answers
31 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
34 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
23 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
8 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
25 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 -- ...
2
votes
0answers
64 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
38 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
11 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
19 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
1answer
24 views

How to simulate the random variable $Y$ using another random variable $X$?

Let $X$ be the discrete uniform random variable on taking values in the set $\{1,2,3,4,5\}.$ We want to simulate the random variable $Y$ which is the discrete uniform random variable taking values in ...
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
2answers
23 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 ...
0
votes
0answers
64 views

The average service time of the drive-in teller and the inside-bank teller?

A bank has one drive-in teller (who can serve customers without leaving their cars). The drive-in teller has a room (i.e., a queue) for one additional customer to wait. Customers arriving when the ...
0
votes
0answers
9 views

Is there a clear distinction between event-based and process-based modelling?

Is there a clear distinction between event-based and process-based modelling? Particularly, because I've noticed that once one starts to add "structures" to "purely event-based" model, then it starts ...
1
vote
1answer
32 views

CDF with probability and Weibull

A bakers oven may be out of use due for two reasons. With probability 0.8 the oven will be damaged from dirt and it will take exactly 5 minutes to repair it. With probability 0.2 the oven will need ...
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 ...
0
votes
0answers
13 views

Range of the bounded expectation

I have a probability function $P$ depends on a standard normal random variable $\eta$. Given a random draw of $\eta^r$ from the standard normal distribution ($\eta\~N(0,1)$), I can get a probability $...
0
votes
0answers
56 views

Ito or Stratonovich equation

Consider the two coupled Ito SDEs $dX_t=-\lambda X_t\cdot dt+\sigma\cdot dB_t$ $dY_t=-\sin Y_t\cdot dt+s\cdot X_t\cdot \cos Y_t dt$ I assume that $X_t$ is an Ornstein-Uhlenbeck process, and that $...
0
votes
0answers
18 views

Algebraic construction of a state space system

How could a state space system be automatically constructed based on the knowledge of underlying circuit? E.g. - $$ \dot{v_c}=\frac{-v_c}{CR}+\frac{V_{dc}}{CR} $$ That is, the representation is ...
0
votes
0answers
15 views

Can we use average simulation results to predict an event with randomness?

The subject is quite ambiguous. Let me use an example to clarify. For example, we have a patient booking schedule for a doctor, which specifies the schedule time for patients. There are so many ...
-1
votes
2answers
33 views

Simulate a discrete random variable

We have a discrete random variable $X$ with the following probability distribution \begin{equation*} p(X=i)=p_i,\quad i=1,2,\ldots 1000, \quad \sum_{i=1}^{1000}p_i=1. \end{equation*} How we can apply ...
0
votes
1answer
34 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 ...
0
votes
1answer
65 views

Cauchy simulation in R

How do I simulate Cauchy distribution from Uniform distribution in (-pi/2, pi/2) in R? Not allowed to used any functions that already exist in R that generate Cauchy
0
votes
2answers
27 views

Simulation of Poisson using exponential

I have shown using the inverse method that if $U\sim U(0,1)$ then $X=-1/\lambda \cdot \log(U) \sim\exp(\lambda)$. Using that, how do I write a code in R that generates $n$ samples from the $\...
1
vote
3answers
51 views

Does Runge Kutta methods run well with variable $h$?

When using Runge Kutta methods for real time simulations there is a problem with the constant step length $h$ since the operating systems often interrupt the simulation and the main loop therefore has ...
0
votes
0answers
10 views

Rejection-Samplig starting from Cumulative Distributions

Could you please help me on the following problem on a rejection sampling method? I know the cdf of a random variables $X$ that depends on two positive parameters $a\ge 0$, $b\ge 0$ with $a\le b$, ...
0
votes
0answers
18 views

Simulating inter- and intra-person variability in Gaussian distributions

I'm writing a Monte Carlo simulation and it involves a number of different variables which can exhibit both inter-person and intra-person variability. These variables are modeled using Gaussian ...
1
vote
2answers
168 views

Monte Carlo to evaluate infinite integral on R

I am using Monte Carlo method to evaluate the integral above: $$\int_0^\infty \frac{x^4sin(x)}{e^{x/5}} \ dx $$ I transformed variables using $u=\frac{1}{1+x}$ so I have the following finite integral: ...
1
vote
1answer
49 views

Log transforming an ODE

I'm doing some numerical simulations of an exponential growth like system which, for simplicity, has the form: $$ \frac{dx}{dt}= ax + bxy \quad\quad \frac{dy}{dt}= cy + dxy $$ For some parameter ...
0
votes
0answers
46 views

Antithetic sampling and Monte Carlo simulation

Consider: \begin{align} f(x) = \left\{ \begin{array}{ll} 0, & 0 < x < 0.9 \\ 100, & 0.9 < x < 0.91 \\ 0, & \textrm{otherwise} \\ \end{array}\right. \end{align} Determine ...
2
votes
1answer
64 views

Can we find an unbiased estimator of $\pi$?

Suppose we want to estimate $\pi$. We adopt the following strategy. We generate $n$ iid observations $Z_1,Z_2,...,Z_n$ from the unit disk $D=\{(x,y):x^2+y^2<1\}$ and let $R=\{(x,y):-\dfrac{1}{\sqrt{...
0
votes
0answers
39 views

Simulation of jump times of Cox process with CIR intensity

I want to sample the jump times of a Cox process where the intensity $\lambda(t)$ is given by a CIR process, i.e. $$ \mathrm{d}\lambda(t)=\kappa(\theta-\lambda(t))\mathrm{d}t+\sigma\sqrt{\lambda (t)}\...
0
votes
0answers
19 views

Generating correlated QUASI random numbers

Hi I am trying to generate correlated quasi random numbers using a sobol sequence in matlab. My Problem is the Following: Using "standard" random numbers it is easy to generate the 6 correlated random ...
0
votes
0answers
45 views

Am I doing simulation the correct way?

The probability of finding a particle at a particular location $(x,y,z)$ and a particular time $t$ in a 3-D diffusion environment with drift $u,v,w$ and diffusion coefficient $D$ is given by: $$f(x,y,...
1
vote
0answers
33 views

Stochastic simulation Gillespie algorithm for areas instead of volumes?

I am trying to find resources on the Gillespie stochastic simulation algorithm for my system which happens on a surface. The original algorithm was developed for a reactor of volume $V$, but my system ...
-1
votes
1answer
49 views

coordinates of a car given its trajectory.

I have some straight and curve pieces that I use to build tracks for a car (robot), so every time the shape of the track where the car will move is known but I don't have its equation (I think getting ...
0
votes
0answers
19 views

Functions for tank movement (differential steering)

I'm programming a game, of sorts, where a tank is steered based on the thrust applied to each of its caterpillar-tracks. I'm in need of two functions: $R(T_l, T_r, d)$ which will return the angular ...
-1
votes
1answer
82 views

Wave equation of fluid over substrate of variable height? [Reference Request]

I'm looking for a two dimensional wave-like equation (or the best that can be had) for the following situation: Roughly we have a fluid resting not over a fixed flat surface but over a substrate of ...
2
votes
2answers
128 views

Gambler's ruin: one player

The following is an example problem very common in a Computational Statistics course I have. I'm asked to comment the result of the following experiment: A person has certain amount of money $C$ ...
0
votes
2answers
66 views

Absorbing Markov chain in a computer. Is “almost every” turned into always convergence in computer executions?

Let $\{X_n\}_{n=0}^\infty$ be an absorbing Markov chain. It is well-known that $$ P(\text{chain gets absorbed}|X_0=i)=1. $$ My question is how this is interpreted in practice. We have that for almost ...
0
votes
2answers
39 views

How should I simulate a value from the distribution corresponding to this density function?

Suppose that the density function $f$ is given by $$f(x) = \begin{cases}x^2, \, 0\leq x <1\\\frac{4}{27}(4 - x),\,1 \leq x < 4\\0, \text{ elsewhere.}\end{cases}$$ Exercise: Show how one may ...
2
votes
0answers
75 views

Modelling Diode current with ODE [closed]

I want to write ODE system for simulating following electrical circuit: At each small step dt i just do euler integration. I only know ODE for leaky capacitor: <...
2
votes
0answers
122 views

Markov Processes and Detailed Balance

Section 2.2.3 of this book: http://itf.fys.kuleuven.be/~fpspXIII/material/Barkema_FPSPXIII.pdf discusses the detailed balance condition in the context of Markov chain Monte Carlo algorithms. First ...
0
votes
0answers
13 views

To Generating a random variable from a non conventional density function i.e. the time dependent diffusion equation

I am interested in generating a random variable, this is, to obtaining a point (x,y)) by a non conventional density function i.e. the time dependent diffusion equation over an irregular domain on $R^2$...