All Questions

Tagged with
Filter by
Sorted by
Tagged with
1
vote
0answers
58 views

Noise covariance matrix

I am trying to find the noise covariance matrix of a random vector $\mathbf{x}$ with itself. The elements of this vector represent image pixels and are treated as random variables i.e, $\mathbf{x}=\{...
5
votes
3answers
160 views

Improving the run time of random walk simulation

One of our professors told us that during his thesis he used Mathematica in simulating it since it is about networks, I don't know how he did it but all I know is he said it took about two weeks to ...
5
votes
1answer
396 views

Random walk in one dimension — meeting of two particles

I'm new to Mathematica and still teaching all by myself, hope you bear with me. I have the code: ...
5
votes
1answer
70 views

Random normalised variable generation

I want to generate 8 random variables (in reality to form 4 complex numbers) such that the sum of the 8 variables squared is equal to unity. The aim of generating such numbers is to perform a quantum ...
0
votes
1answer
37 views

How to (efficiently) generate and catch some data-set that has similar correlation?

...
0
votes
1answer
243 views

Using Random walk on a region [duplicate]

I want to simulate a random walk on two dimension equation using module. Checked the input so the path works ...
3
votes
3answers
179 views

2D Random walk under specific boundary

I try to create the code so that from initial point (that I can set), code runs so that it performs random walk, yet it turns off once the point hits the wall. I tried this method however, I was not ...
1
vote
3answers
111 views

Number of realizations in NExpectation, Method Monte Carlo

I have been looking in NExpectation about how large the sample size is when Mathematica performs Monte Carlo simulation. For example, if we write ...
9
votes
3answers
674 views

Creating random configurations of spherocylinders or cylinders

About the setting: We have a 3D simulation box with side $l$ and our catesian coordinate system is set with its origin at the centre of the box. We have a number $N$ of spherocylinders of aspect ...
9
votes
5answers
918 views

Simple Birth Death Process

I am trying to implement simple birth death process. Why my code does not work? Any suggestion. Thanks. Cross posted http://community.wolfram.com/groups/-/m/t/1205656 ...
3
votes
1answer
172 views

Place spheres randomly in a box without collisions?

Suppose I have a distribution of sphere radii, $P(r)$. I need to sample configurations of $N$ spheres in a cubic box of side $L$ (assume they fit), where the $N$ spheres have radii following the ...
6
votes
1answer
175 views

Basic Gaussian Process simulation/ white noise - massive problem

I have a certain problem with Mathematica or more precisely, myself handling it. It is correlated with a mathematical problem and its realization/simulation in Mathematica. I want to start with the ...
5
votes
0answers
45 views

Random Number Generation on Parallel Cores [duplicate]

So, I've noticed an odd trend in some of my Mathematica results recently- I'm running large Monte Carlo simulations on a system that involves running several jobs independently, each on a different ...
5
votes
1answer
826 views

Brownian dynamics simulation

is there any way to improve computational speed of the following Brownian dynamics simulation of a trapped particle in the Markovian case ? I time-discretized the equation of motion and then use a ...
0
votes
1answer
197 views

Beginner Simulating Gaussian Process with Correlation

I have no little experience with algorithms. I would like to learn how to simulate a real valued Gaussian process with correlation (e.g., exponentially correlated $\Gamma(t)=e^{-\vert t \vert/2}).$ ...
0
votes
0answers
81 views

averaging over large number of random realizations

I want to run following for few hundreds of a random variable set. This calculates: generate normal random variable find gain with squaring calculate performance metric find ...
4
votes
2answers
1k views

Calculate $\pi$ using Monte Carlo methods

I know that we can have an estimate of $\pi$ using Monte Carlo methods. I know that we make a huge loop and each time we take randomly two numbers in the range [0,1] and calculate the number of ...
-1
votes
1answer
164 views

Periodic boundary conditions for two walkers

For some reason I'm getting infinite loops most of the time i run this. Perhaps the periodic boundary conditions are wrong. Seems like the probability of the two positions to be the same is extremely ...
2
votes
1answer
406 views

Generate a simulated covariance matrix

I am working on a problem where one of the input variables is the level of covariance between the entries in a particular matrix. To simulate this problem in Mathematica, I will need to feed my code ...
4
votes
2answers
340 views

Confining/Periodic boundary conditions implementation for 2D Random Walker

I am new to Mathematica, and am having trouble implementing confining boundary conditions for a random walk simulation confining the walker to a pre-defined region (periodic boundary conditions would ...
2
votes
1answer
513 views

How to simulate Multifractional Brownian Motion?

The maximum I would ask, is hints, how to model MFBMotion. Link to paper Firstly, i wanted to simulate in MATLAB that code: ...
5
votes
2answers
2k views

Simple Monte Carlo simulation

I want to find the Monte Carlo simulation of the integral $$\int_0^1 \sqrt{1-x^2}\mathrm dx$$ The Cesàro mean is $$I_n=\frac1n\sum_{k=1}^{n} f(U_k) $$ I want to plot the scatter plot ((1,$I_1$)(2,$...
9
votes
3answers
967 views

Simulate random data with correlation

I would like to simulate some random data e.g. between 0 and 1, but with a given correlation. In other words some data where the correlation between two datasets is e.g. a constant or within a give ...
4
votes
1answer
498 views

Monte Carlo Volume Calculation and Speed Up

I am trying to do a Monte Carlo area calculation for an irregular area defined by: $$0 \le x \le 1, 10 \le y \le 13, y \ge 12 \cos(x), y \ge 10 + x^3$$ I used the code with modifications (so I can ...
8
votes
1answer
623 views

Optimizing Monte Carlo simulation of a Pred-Prey model

My assignment and code As part of an assignment for one of my classes, I'm trying to run a "massive" Monte Carlo simulation in Parallel on the follow model: ...
8
votes
1answer
320 views

Simulation Sample Paths for Stochastic Approximation Algorithm

Let $X_t$ be IID random variables in $[0,1]$ and CDF $F(\cdot)$. Suppose there exists a variable $Y_t$ given by: $Y_1 = X_1$ and $Y_t = \phi(X_t, \overline{Y}_{t-1}), \forall t >1$, where $\...
39
votes
6answers
4k views

2D random walk within a bounded area

I want to simulate a random walk in two dimensions within a bounded area, such as a square or a circle. I am thinking of using an If statement to define a boundary. ...
1
vote
2answers
258 views

Simulation Beta Distribution

Suppose a function such as: $\phi^{\alpha} (x,y) = \left\{ \begin{array}{l l} \alpha x & \quad \text{if $x < y$}\\ x & \quad \text{if $x = y$}\\ \alpha x + (1 -\alpha) & ...
6
votes
1answer
455 views

Simulating a bounded continuous random walk in $n$-dimensions

You're given three $n$-dimensional real vectors, $\mathbf{x_0}$, $\mathbf{a}$ and $\mathbf{b}$, with $\mathbf{a} \le \mathbf{x_0} \le \mathbf{b}$ (vector inequality means component-wise inequality). ...
4
votes
1answer
81 views

RandomVariate does not evaluate a Hyperbolic Distribution

Any Idea why I can't get a result from this expression: ...
8
votes
3answers
323 views

When does a list contain only ones?

I am starting with a list of length n that contains all -1's. For instance, when n = 6 the list is {-1, -1, -1, -1, -1, -1}. I ...
139
votes
7answers
28k views

How to generate a random snowflake

'Tis the season... And it's about time I posed my first question on Mathematica Stack Exchange. So, here's an holiday quest for you Graphics (and P-Chem?) gurus. What is your best code for generating ...
19
votes
4answers
5k views

Finding the volume of a sphere using the Monte Carlo algorithm

I used the following code to find the volume of the sphere $x^2+y^2+z^2 \leq 1$ in the first octant: ...
0
votes
1answer
117 views

Random variation inside NMaximize

I am using NMaximize as following code. ...
1
vote
2answers
352 views

Problem in simulating discrete time stochastic

I have been playing with some stochastic questions and specially the problem here.It seems no matter for the first time in bet, gambler is going to lose the first bet.Am I right?How can we correct the ...
17
votes
1answer
1k views

Simulating discrete time stochastic dynamic systems

What is the canonical way of simulating discrete time stochastic dynamical systems in Mathematica using the new functionality of Random processes? To take a concrete example, lets consider the ...
8
votes
1answer
406 views

1D Random Walk with Excluded Sites and Variable Time-Step

Here is the physical problem I would like to simulate: Consider the following variations to the 1d random walk: allow for certain, random sites to be excluded with probability 1/2. allow for the ...
20
votes
1answer
630 views

Simulating Theatre puzzle

I have been trying to simulate the process of the theatre puzzle from the Joy of X (Strogatz). The puzzle, and some relevant material are here. My simplistic coding for this process follows: ...
15
votes
2answers
782 views

Fast Simulations with Compile

this post relates to another post that I didn't follow up propely. If I wanted to simulate a system of stochastic proesses like the following, and loop over this run many many times would writing the ...
10
votes
2answers
815 views

Fluorescence Correlation Spectroscopy Simulation

I am simulating Fluorescence Correlation Spectroscopy which basically involves tracking the random motion of particles in a box with periodic boundary conditions and then calculating their intensity ...
12
votes
4answers
2k views

3D Random Walk with Periodic Boundary Conditions

I am working on a 3D random walk with periodic boundary conditions and have written a program that will do this for me, but it is extremely slow. Does anyone have any suggestions on how I could speed ...
16
votes
1answer
909 views

Simulating Stochastic Processes the MMA way

This question is really a specific problem and a methodological one concerning MMA best practices. I want to simulate a system of stochastic processes. If this were a geometric Brownian motion or ...