Questions tagged [simulation]

A vast area which includes generating results from computer models.

Filter by
Sorted by
Tagged with
0
votes
0answers
14 views

Conditional Variance Implementation, Integral approximation with Monte Carlo

as part of my master's thesis, I have to implement the following conditional variance \begin{align*} \mathbb{V}ar[\hat{v}|\hat{y}] &= \mathbb{E}\left[\hat{v}^{2} \mid \hat{y}\right] - \mathbb{E}\...
0
votes
0answers
20 views

Real Life Example for Jackson Network

I have this jackson network with the provided arrival flow rates and service rates, can anyone provide me a real life example for this network having as unit of measure job/sec or job/min for the ...
1
vote
0answers
14 views

Simulating from differential equation inside Point Process

I've been reading Stochastic Epidemic Models with Inference by Britton and Pardoux where I found the following notation for the Markovian SIR model: I was looking for references/guidance on how could ...
1
vote
0answers
21 views

Searching sample distribution with given parameteres

I have a very simple question, but it is hard, at least to me, for giving a solution. Given values of mean, variance and median, can you find a method to generate a random sample with these parameters?...
0
votes
0answers
12 views

How do I calculate this Probability in two Constraints (Cell Population Simulation)

I am simulating Cell Populations of Stem Cells and I've come across this equation in an article: $P_{SC} = P_{SC} (N_{SC}, N_{EP} , N_{LP} , N_{MC} ) \in [P_{min,SC} , P_{max,SC }]$ Symbol explanation:...
2
votes
0answers
26 views

Simulating from some polynomial distributions

Let $f:\mathcal{R}^+\to \mathcal{R}^+$ a continuous distribution of the type $$ f(x|a_0,a_1,\cdots,a_n)=\frac{1}{k}(a_0+\sum_{i=1} a_i x^i), $$ where $a_0,a_1,\cdots,a_n$ are given parameters and $k$ ...
0
votes
1answer
20 views

Multivariate control variate technique

In the control variate technique, one tries to improve convergence of the expected value of a random variable $X$, estimated from simulating a range of $n$ Monte Carlo simulations. This is done by ...
1
vote
0answers
60 views

Calculate the covariance matrix for three random variables

I have the task: The random values $X$, $Y$ and $Z$ are related by the ratio $2X -3Y + Z = 0$. Moreover, $EX = EY = EZ = 0$, $DX = 2, DY = 1, DZ = 5$. Calculate the covariance matrix $\Lambda$ of ...
0
votes
0answers
43 views

Absorption Times of Markov Chains in Continuous State-Space

I have the following question about the Absorption Times of Markov Chains in Continuous State-Space. I was reading the following article on Absorption Times of Markov Chains (https://en.wikipedia.org/...
0
votes
0answers
42 views

Brownian Motion with initial value different than 0, Expected value?

Im trying to simulate brownian motion and brownian motion with drift and i know they have properties like: $ B(0) = 0 \ $ almost surely $ B(t) \ \text{has distribution } N(0,t \sigma ^2) $ But what ...
2
votes
3answers
144 views

Simulating Coin Flips vs Probability of Coin Flips

Is there a standard formula for calculating the maximum, minimum and average number of times you need to flip a coin before observing a desired sequence? Suppose you have a coin that has a 95% chance ...
0
votes
0answers
31 views

Simulate a Markov chain subject to known values at some time steps

I am working with a natural process (occurrence of rock types along a vertical well) that can be modeled as a Markov chain. The (finite) state space and the transition matrix (or transition rate ...
2
votes
1answer
49 views

Verify that $I$ and $X$ are negatively correlated.

In certain situations, a random variable $X$ with known mean is simulated to obtain an estimate of $P(X \leq a)$ for some constant given $a$. The simple estimator of a simulation for a run is $I = I (...
0
votes
0answers
21 views

Scaling a Poisson variable by population size in a stochastic simulation

I am writing a simple stochastic simulation where a community has a birth and death process. So the births are based upon a Poisson variable with parameter $b$, and the deaths are based upon a Poisson ...
1
vote
0answers
57 views

Monte Carlo for estimating small

Suppose that I have two samples $x_1,\cdots,x_n$ and $y_1,\cdots, y_m$ of two random variables $X$ and $Y$, with $m$ and $n$ very large. I want to estimate the probability $P(Y>X)$ which I know is ...
0
votes
0answers
23 views

What is the probability that 2 people get the same result in a binomial simulation?

If I'm using a simulator for Bernoulli distributions, and I'm doing 10 trials with a probability of 0.25, assuming it's completely random, what are the chances that I'm going to get the same exact ...
1
vote
0answers
33 views

The probability of two or more hurricanes making contact with the ground in the United States is 0.28. Find the rate of Poisson process.

The occurrences of hurricanes that make landfall during the meteorological phenomenon “El Niño” are modeled as a Poisson process (Bove et al. (1998)). The authors claim that "During an El Niño ...
0
votes
0answers
14 views

Simulate the response of nonlinear systems exited by an impulse signal

I'm trying to replicate an algorithm, which requires to collect responses of the nonlinear system excited by impulse signals. Is there any chance to simulate the impulse response of nonlinear systems ...
2
votes
1answer
48 views

Question related the pressure plot in time-dependent Navier--Stokes

I'm simulating the time-dependent Navier--Stokes equations using a Taylor-Hood finite element scheme: $$\dfrac{\partial u}{\partial t}-\nu\Delta u+(u\cdot\nabla)u+\nabla p=f$$ $$\nabla \cdot u=0$$ The ...
0
votes
0answers
23 views

How can I simulate a game of blackjack for different 'return to players'

I'm trying to simulate one game of blackjack, I'm doing it using code, but I think it's still a maths related question more than a programming one. My current working is this, for a return to player ...
0
votes
0answers
13 views

how to choose the terms of risk free rate in order to price a call option

For pricing a call option, we can use the following Black-Scholes formula. My question is related to the choice of risk-free rate $r$ here. The time to maturity of my option is three years. I want to ...
0
votes
0answers
31 views

How can I simulate the use of a casino bonus n number of times

If I have a free £50 casino bonus that has to be wagered 40x (£2000 total), and I use the bonus on a game with a return to player of 95% and medium variance using £1 spins/games. Is there a way I can ...
0
votes
0answers
25 views

Modelling uncertainties in sampling

I am seeking to complete/perfect a simulation program in Excel that models the following: Step 1 Sample N items where the probability p of any item being in one of two states. It is handy to depict ...
1
vote
1answer
87 views

Flipping Coins: Sequences vs Independent Flips

Here is a problem I thought of: Suppose I am watching someone flip a fair coin. Each flip is completely independent from the previous flip. I watch this person flip 3 consecutive heads. I interrupt ...
1
vote
0answers
35 views

Simulate the sum of $n$ dependent bernoulli random variables.

Simulate the sum of $n$ dependent bernoulli random variables. I know that the sum of $n$ independent bernoulli radom variables with probability $p$ is distributed as a binomial random variable. I ...
0
votes
0answers
24 views

Information in a Markov Process

I have a system that can be simulated with a Markov process $M_1$, but it could also be simulated with a higher order Markov process $M_n$, which has memory for 1 or more previous states. Is there a ...
1
vote
0answers
15 views

Is the simple mean of log returns a better estimate than the method of moments one?

Given the geometric Brownian motion, obtained with the Itô's Lemma: $$d \ln S_t = \left(\mu - \frac{\sigma^2}{2} \right) dt + \sigma d W_t$$ Where $\mu$ and $\sigma$ are constants, we have that: $$ \...
2
votes
1answer
30 views

Simulated data not matching with calculated probability function

I love the FiveThirtyEight Riddler puzzle. I try to do it as much as possible, but I'm not really trained in math or stats. This weeks puzzle has you calculating the expected distance of two random &...
1
vote
0answers
35 views

Simulating a Poisson process which isn't homogeneous

Is there a tractable way to simulate (take a sample from) a Poisson process with intensity parameter that varies according to $\lambda(t)$ on an interval of time $[0,t]$? Assumptions about niceness of ...
0
votes
0answers
6 views

How to adjust a covariance matrix for simulating normal multivariate distribution?

I have a covariance matrix from which I'd like to simulate from. As I understand it, it has variances along the diagonal, and covariances on the off-diagonals. I want to "adjust" the matrix ...
0
votes
0answers
22 views

Simulate Normal Distribution

Suppose that I have normal distribution properties. So the $\mu = 5$ and $\sigma = 5$. If I want to generate $n$ samples such that maximum value within the population is 10 given population is ...
0
votes
0answers
59 views

Analyzing a Gambling Race Paradox

Suppose a number of players are given $100$ points each, and repeatedly engage in a gamble having positive expected value, with the goals of being the first player to reach $100000$ points. Solving ...
2
votes
1answer
87 views

What does it mean when we say a variable changes linearly?

I know that probably my question is a bit silly/simple but I will be thankful if anyone could help me. I have attached a screenshot in which a variable is defined for an object somehow that it ...
2
votes
1answer
84 views

Random walk, gaussian, biased, chemotaxis

https://www.flandershealth.us/microbiology/a-biased-random-walk.html Im interested in simplest math, simulation friendly, that could describe how microbes move. Their movement is similar to a random ...
0
votes
0answers
55 views

Accounting for Chance Changes in Averages

Moderators: I really don't know what to name this or what tags to put so feel free to edit this I'm a software developer, and in my spare time, I wanted to create a computer program to play a card ...
0
votes
0answers
28 views

Confirm multivariate Gaussian derivation by simulation in Matlab

I have a random process which is defined according to the model, \begin{equation*} Y_i=Bf_i+W_i, \quad i=1,\ldots,N \end{equation*} Where $B,W_1,\ldots,W_N$ are i.i.d. with, \begin{gather*} ...
1
vote
0answers
83 views

Sampling from Gaussian Copula with a conditional distribution approach

In the paper "Cheng and al. (2007)" on pages 193-194, the authors propose an algorithm that generates variables with a given copula function $C$ being the joint distribution. This procedure ...
1
vote
1answer
80 views

Simulating a probability of $\frac1e$ given a fair coin

The problem asks to simulate a probability of $1/e$ given a fair coin, and asks the expected number of tosses for each simulation. It seems to do with CLT but I don't know how to link a normal $N(np,...
0
votes
0answers
43 views

Stochastic simulation in R with large matrices

I am running a simulation in $R$ of a queueing system. One of the problems I have is that the running time is heavily impacted by a read operation on a matrix that has to be performed multiple times (...
1
vote
0answers
18 views

Using integral within discrete time model

I have a semi-discrete model, tracking the number of insects that emerge from pupae, and I'm struggling a bit with the maths. I have an emergence function, let's say $e(t)\sim N(\mu,\sigma^2)$, ...
3
votes
0answers
49 views

How can I solve this infinite series?

I'm trying to make a game which is based on custom-made economic system. I tried to make the value of currency increased by someone earning it, as the currency is decreased as the one takes it. And ...
1
vote
0answers
47 views

Rejection method

I need to simulate a distribution using the rejection method $$p(x) = c\begin{cases} \frac{1}{1+x^2} ,& x \leq 0\\ 1, & 0<x<2\\ e^{-x}, & x \geq 2\\ \end{cases} $$ CDF is: $$ F\...
2
votes
0answers
66 views

Strange parking problem on my street - looking to solve for the probability spots are effectively filled

This my first post here, so forgive me if the style is not to spec yet. The street I live on has the following parking structure: On the 15th of every month the cars switch sides they are legally ...
2
votes
1answer
58 views

Solve for withdrawal rate in Monte Carlo simulation of retirement

I've been working with compound returns and distribution of wealth over time for quite some time now and I feel like I am hitting a wall. What am I trying to achieve? Imagine that you are about to ...
4
votes
3answers
219 views

A coin is tossed several times and the outcomes are being recorded in a string of H and T. How long - on average - will you have to wait for an "TTH?" [closed]

Problem. A coin is tossed several times and the outcomes are being recorded in a string of H (heads) and T (tails). For example, that is recorded as "HHTTTHTH," so, how long - on average - ...
2
votes
1answer
69 views

Find an estimate for $\int_{\pi/2}^\pi \sin(x) dx$ using the Monte Carlo Simulation

I want to find an estimate for $$\int_{\pi/2}^\pi \sin(x) dx$$ I want to use the monte carlo simulation method. I've plotted the graph of $\sin(x)$ in the given interval. The total area $$\begin{align*...
1
vote
0answers
31 views

Generating random variable from no closed-form marginal density using r or other programming language

Suppose $U\sim N(0,I_p)$, $Y|U\sim N(x(t),\sigma_e^2I_m)$, and the marginal distribution of $Y$ is $f(y)=\int_u f(y|u)f(u)du$. $x(t)$ is composite function of $U$, basically $x(t)$ is a function of $z(...
3
votes
3answers
234 views

How to sample random variables X and Y from a joint distribution.

I have the following joint distribution function $f(x,y)$: $$f(x,y)=\begin{cases} \frac{1}{30}xy+\frac{x}{y^2} & \text{ for } 1\le y\le 4,\ 1/2\le x\le 3/2\\ 0 & \text{ otherwise.} \end{cases}$...
3
votes
1answer
48 views

Simulating a random process with correlation structure $e^{-|t-s|}$

Consider a random process $X_t$ such that $$dX_t\sim N(0,dt)$$ and $$\operatorname{corr}(dX_t,dX_s)=e^{-k|t-s|}.$$ This question is probably trivial but how can I simulate the path path of $X_t$? Any ...
2
votes
0answers
44 views

How to simulate $E[X | \mathcal F_t] $ when there is no Markovianity?

Let $(\mathcal F_t)$ be a filtration and $X$ a random variable such that $E[X | \mathcal F_t] \neq X$ and $E[X | \mathcal F_t] \neq E[X]$ for all $t\in [a,b]$. We consider the conditional expectation $...

1
2 3 4 5
13