Questions tagged [simulation]

Simulation is the imitation of the operation of a real-world process or system over time.

The act of simulating something first requires that a model be developed; this model represents the key characteristics or behaviors of the selected physical or abstract system or process. The model represents the system itself, whereas the simulation represents the operation of the system over time.

See, Wikipedia Simulation

287 questions
7
votes
3 answers

How to define a distribution that 90% of the time gives me 0?

This maybe a simple question, but I am just stuck with it. I want to do some simulation, say with 0.9 probability, I get a 1, and 0.1 probability get a 0. How would I do that? Where should I start? Thanks!
Chen Stats Yu
  • 4,986
  • 2
  • 24
  • 50
6
votes
2 answers

Simulating a Stochastic Process within certain bounds

I would like to simulate paths of a Geometric Brownian Motion till it hits one of two barriers, say 10 or 200. data2 = RandomFunction[ GeometricBrownianMotionProcess[0.05, .15, 100], {0, 10, .01}, 1] ListLinePlot[data2] data3 =…
Amatya
  • 6,888
  • 3
  • 26
  • 35
5
votes
4 answers

Finding the area of a circle using monte carlo simulation

I wrote the following code to find the area of the circle $x^2+y^2=1$ using monte carlo simulation : McArea[Num_] := Module[{hit, miss, index, x, y}, hit = 0; miss = 0; For[index = 1, index <= Num, index = index + 1, x = Random[Real, {-1,…
johny
  • 355
  • 3
  • 7
5
votes
2 answers

Accelerate the speed of selection in Random

Tossing 4 points on a circle at a time, and calculate the chance of all 4 points on the upper part of the circle. This is very simple by math: $$\left( \frac{1}{2} \right)^4 = 0.0625$$ But I want do a simulation in Mathematica. po =…
kile
  • 1,671
  • 5
  • 10
4
votes
1 answer

How to make a pendulum simulation draw the bob's trajectory?

This is the code for a simple pendulum simulation g = 9.81; l = 2; Theta0 = 15 Pi/180 Animate[Graphics[ List[{Line[{{0, 0}, length {l Sin[T], -l Cos[T]}} /. {T -> Theta0 Cos[Sqrt[g/l] t]}],PointSize[0.1], Point[{length {l Sin[T], -l Cos[T]}}…
Gabu
  • 284
  • 1
  • 7
3
votes
1 answer

How to speed up a system simulation?

I need to simulate a series of nonlinear (and linear) with thousands of state variables. Here is a simple linear example {1.00336 x1 + 0.0049723 x2 + 0.00167211 x3, x1, x2} If I define the following function and then use NestList I get the…
Ed Mendes
  • 618
  • 5
  • 11
3
votes
0 answers

Inhomogeneous Compound Poisson process

I need to use a compound Poisson process with time-varying jump intensity. Mathematica has the function of compound Poisson process as well as inhomogeneous Poisson process, but no combination of these two. Is it possible to create such a process?…
Livvy
  • 31
  • 1
3
votes
4 answers

Monte Carlo or how to calculate the model several times

follow question: How can I calculate this model several times automatically. Clear[P]; P[t_] := P[t] = P[t - 1] + RandomVariate[NormalDistribution[0, RP]]; P[0] = 1; ListLinePlot[Table[P[t], {t, 1, 20}]] I used Table[Table[P[t], {t, 1, 10}], {i,…
Alex
  • 31
  • 1
1
vote
2 answers

How to find estimators of unknown parameter of a distribution using method of least square estimation

I had defined pdf of distribution, generate data and specify the least square function.I am not aware of the code for finding estimators and bias of this distribution using method of least square estimation. I am trying to implement simulation. can…
Akhilraj N S
  • 115
  • 4
1
vote
0 answers

Simulating a bicycle going around a circle

I want to simulate a bicycle moving around a circle. Instead of graphs and calculations, I want to almost see an actual simulation of this happening. How could I do this? I tried looking up simulations on Mathematica online. However, I couldn't find…
freebird
  • 31
  • 1
0
votes
0 answers

Simulation of the semicircle Wigner Theorem

Let's begin with some termes: For $1\le i
Zbigniew
  • 411
  • 1
  • 4
  • 12
0
votes
1 answer

Simulating from Custom Function

I am going through an old research paper and I am stuck in one area of the coding. I'll spare you with most of the details but the function I want to simulate from is a complicated multivariate beta function that looks…
Jim
  • 93
  • 7
0
votes
1 answer

How can I get the compensated compound Poisson process in Mathematica

Let us consider the following martingale "compensated compound Poisson process" $M_t=\sum_{k=1}^{N_t} Z_k-\lambda t E(Z)$ where $N_t$ is a Poisson process with intensity $\lambda$, $Z_k$ is iid random variable and indepent with $N_t$. If we…
Ailiy Evan
  • 103
  • 3
0
votes
1 answer

How to find estimates and bias from simulated data using method of least square estimation

f[\[Alpha]_, \[Lambda]_] := ProbabilityDistribution[( 4*\[Lambda]*\[Alpha]* x^(\[Alpha] - 1)*(1 - x)*(2 - x)^(\[Alpha] - 1)*(1 - x^\[Alpha]*(2 - x)^\[Alpha])^(\[Lambda] - 1))/(1 + (1 - x^\[Alpha]*(2 -…
Akhilraj N S
  • 115
  • 4
0
votes
2 answers

How do I get my simulation to run?

I am simulating a birth-death population process. My code is RESULTS = {}; For[iterator = 1, iterator < 21, iterator++, n = 25; t = 0; results = {{t, n}}; mu = 1; lam = 1; While[t < 200, death = lam*n; birth = mu*n; rate = death + birth; …
Mlo27
  • 115
  • 3
1
2