Skip to main content

Questions tagged [random-process]

The tag has no usage guidance.

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

Compiling an ItoProcess

I am a new mathematica user. I am trying to use the Compile command to speed up my RandomFunction output. The code looks like this: ...
rahman62's user avatar
4 votes
0 answers
81 views

Riesz fractional derivatives/Laplacian for Lévy flights?

There are pretty popular Lévy flights for diffusion with steps of infinite variance, mathematically requiring Riesz fractional derivatives, which in Fourier transform multiplies by $|k|^\alpha$. I ...
Jarek Duda's user avatar
2 votes
1 answer
69 views

Joint Moments of Stochastic Process at Different Times

Suppose I have a random process defined in Mathematica, e.g. h = TelegraphProcess[a] I know you can use Mathematica to calculate different statistics like the mean,...
Sahand Tabatabaei's user avatar
0 votes
0 answers
43 views

Defining function through a formula

I would like to define a cocycle on a group that maps into the unit circle. That is, I want to be able to define a function $f:G\times G\to\mathbb{T}$ such that $f(e_G,a)=f(a,e_G)=1$ for all $a\in G$ ...
aqwer's user avatar
  • 1
2 votes
2 answers
107 views

Optimization of a Markov сhain with symbolic transition rate

I am trying to work on 1D random walk that can move to left, right or stay with probabilities $p_i$,$q_i$,$r_i$ that changes with the site $i$. I am trying to simulate this by using a recurrence ...
Hugo Andrade's user avatar
1 vote
2 answers
176 views

How to use first time generated randomly matrix? [closed]

I'm trying to solve one (very little) problem. :) I've generated 3x3 randomly matrix with V[i_, j_] := Table[RandomInteger[{-10i, 10j}], {3}, {3}]; Now I want to ...
stoboja's user avatar
  • 19
3 votes
2 answers
177 views

Approximate a Wiener Process by a Karhunen-Loève expansion

I'm trying to approximate a Wiener Process by a Karhunen-Loeve expansion (see slide 20) with the following code: ...
Stratus's user avatar
  • 2,954
2 votes
1 answer
203 views

Applying NDSolveValue on a differential equation

I am trying to solve stochastic Schrodinger equation (Schrodinger equation in the presence of Ornstein Uhlenbeck Process) $$i\frac{d}{dt}\begin{pmatrix}c_1(t)\\ c_2(t)\end{pmatrix}=H(t)\begin{pmatrix}...
Radmehr's user avatar
  • 51
2 votes
1 answer
101 views

Simulating a discrete time stochastic process

I would like to simulate and plot many paths of a discrete random variable $\tau_{t}$ that follows the following process: with probability $\tau_{t-1}$, $\tau_{t}$ is either $0.6$ with probability $x$...
Federico's user avatar
1 vote
0 answers
41 views

How can I use RandomFunction to solve an SDE in reverse time?

I am working with a problem of the Ito-stochastic differential form given by $$\mathrm{d}x=g(x,t)\,\mathrm{d}t+f(x,t)\,\mathrm{d}W,$$ where $W$ is a Wiener process. I furthermore have to satisfy the ...
JAC's user avatar
  • 21
1 vote
0 answers
62 views

I am unable to improve the (MAProcess) time series model

I am a time series novice and have been learning the art/trade from examples while being governed by the NIST handbook (ch.6, sec.4). My question is regarding: How to improve the estimated time ...
dearN's user avatar
  • 5,351
0 votes
0 answers
45 views

Possible Bug with MultinomialDistribution

I think there is a bug in MultinomialDistribution[]. I want to generate N random variables with densities vec{p}={p1,p2,p3,...} Of course I check that Total[vec{p}]=1 (they are densities so they sup ...
sam84's user avatar
  • 497
0 votes
1 answer
91 views

Bad performance of 3D self-avoid persistent random walk with periodic boundary conditions

I'm trying to simulate a self-avoiding persistent random walk with periodic boundary conditions a large number of times. For some reason, the script I've written is extremely slow for self-avoiding ...
M  .  M's user avatar
  • 105
3 votes
1 answer
325 views

Stochastic process: Understanding Ornstein Uhlenbeck Process

Recently, I have been trying to simulate a random/stochastic variable that follows Gaussian distribution and also has an exponential correlation function $\left\langle X(t)X(s)\right\rangle= e^{-\frac{...
sined's user avatar
  • 583
2 votes
0 answers
104 views

Solving stochastic equation

I am trying to solve, numerically, a classic stochastic Liouville's equation, namely \begin{equation} \frac{dA(t)}{dt} = -B(t)A(t)+ {\cal C}(t) \end{equation} with $B(t)=\cos(\omega t)$, and ...
sined's user avatar
  • 583
5 votes
1 answer
147 views

Applying Fourier Shift Theorem using Power Spectrum

I have a power spectrum $P(\omega) = 10/\omega^2$ and I want to simulate a random time-series realization of this process $f(t)$ and a time-shifted copy of that realization $f(t- \tau)$. To do this, I ...
compscinoob's user avatar
2 votes
2 answers
361 views

How to define the density of random 3D points and plot it?

The following code draws a random distribution of particles in 3D. The Manipulate box allows to change a few parameters (number of particles, size of clusters, ...). I would like to define the local ...
Cham's user avatar
  • 4,093
1 vote
2 answers
127 views

How can I improve this code?

The code below is working well, but it's very slow in the Manipulate box. I know that the Do and AppendTo parts aren't very ...
Cham's user avatar
  • 4,093
3 votes
1 answer
60 views

Plotting Individual Variables from RandomFunction

I have defined an Ito Process such that: ...
Cameron F.'s user avatar
-1 votes
1 answer
160 views

How to set Ornstein-Uhlenbeck function with deterministic, not a constant parameter [closed]

I want to calculate Mean and Variance of this equation $$r(t) = x(t) +y(t) + k(t), r(0) = r_0,$$ $$dx(t) = -ax(t)dt + σdW_1(t), x(0) = 0,$$ $$dy(t) = -by(t)dt + ηdW_2(t), y(0) = 0,$$ Where $W_n(t)$ ...
user13232877's user avatar
4 votes
1 answer
116 views

What is this this application of KalmanEstimator doing?

I struggle to understand the Kalman filter and the documentation for KalmanEstimator. Please help me understand the first Application on that documentation page. The code in question is copied here: <...
Ted Ersek's user avatar
  • 7,134
0 votes
1 answer
118 views

WienerProcess - estimate the expected value after `n` steps

Is there a way to adjust the estimated value of the WienerProcess after n steps? Eg. could we evaluate the value of ...
matzar's user avatar
  • 101
3 votes
3 answers
117 views

Problems with DiscreteUniformDistribution

DiscreteUniformDistribution does not seem to work as it should. For a very simple example, let's consider a discrete random variable with PMF given by prob(-1)=1/2 and prob(1)=1/2. First, we create ...
nlmath's user avatar
  • 51
4 votes
2 answers
208 views

Is there a way to generate a data-driven Monte Carlo sample from a histogram?

I have a vector with 50 elements. These are values of a random variable. I have represented the data as Histogram[RandomVariable1Histogram]. However, I need to ...
slow_learner's user avatar
1 vote
2 answers
183 views

Add gaussian noise to 2D Point

I implemented a program for a camera calibration in Mathematica with with prototypical data to see if my calibration works. Here I converted 3D object coordinates into 2D sensor coordinates. I have ...
Sabine Schleise's user avatar
11 votes
1 answer
314 views

Generating random sequence of integers with ordering constraints

I would like to write a Mathematica routine for generating random musical melodies that obey (some of) the constraints of traditional tonal harmony. For simplicity's sake, I'm interested only in ...
Kim Fierens's user avatar
  • 1,857
7 votes
1 answer
1k views

How can I generate the same random number in Mathematica and MATLAB?

As a part of my research studies, I have developed a code which is essentially based on random generation of numbers. The first version of the code was written in MATLAB, however, for some reasons I ...
KratosMath's user avatar
  • 1,287
1 vote
1 answer
276 views

Correlated random field generation

I need to generate two correlated gaussian random fields. As far as I know, this question and this other provides the means to generate a single autocorrelated process. However, I am clueless about ...
slow_learner's user avatar
1 vote
0 answers
65 views

Stochastic noise with known propability density function

How can I generate samples for random function, which functional "probability density" is known? When I say "probability density" for random function $\xi(\mathbf{q},t)$, I mean, ...
Alex Goldstein's user avatar
2 votes
1 answer
105 views

Existing template for coalescing random walk

I would like to simulate a 2-dimensional random walk on a lattice where the particles coalesce/merge when they occupy a similar site on the lattice. Would it be possible to tweak in an efficient way ...
Matt's user avatar
  • 427
6 votes
1 answer
339 views

Animating a random walk of 3D water molecules?

Inspired by David G. Stork’s post https://mathematica.stackexchange.com/a/84097/10361, I tried to have the molecules perform a random walk ...
Sooner's user avatar
  • 387
1 vote
1 answer
171 views

Mean of an Ito Process

I would like to compute the mean of s[t] which is given by the first equation in these coupled stochastic ordinary differential equation ...
el Kettani Perla's user avatar
1 vote
1 answer
251 views

How to add noise to these random straight lines in 3D?

Here's a code that draws a pack of random straight lines in 3D: ...
Cham's user avatar
  • 4,093
1 vote
1 answer
109 views

Implementing Random process for exponential correlation function

I'm trying to simulate a random process for a variable $-1<X(t)<1$ with average 0, i.e., $\left\langle X(t)\right\rangle =0$ and correlation $\left\langle X(t)X(0) \right\rangle \propto e^{-t/\...
sined's user avatar
  • 583
0 votes
1 answer
176 views

Simulation of a recursive stochastic process

I would like to simulate and plot multiple paths of the following stochastic difference equation, for any initial condition $\pi_{0} \in (0,1)$: $\pi_{t+1} = \gamma \pi_{t}$ with probability $1/3 \pi_{...
Federico's user avatar
2 votes
1 answer
132 views

ItoProcess with matrix of equations

What is the cleanest/simplest way to use ItoProcess to solve the equation $$i \text{d}\boldsymbol{\psi} = H\cdot\boldsymbol{\psi} \text{d}t + \boldsymbol{\psi}^2\...
Tom's user avatar
  • 3,416
0 votes
0 answers
123 views

ItoProcess with WhiteNoiseProcess

Is there a way to use ItoProcess with a white noise process, instead of the usual WienerProcess? If I just naively use ...
Tom's user avatar
  • 3,416
2 votes
1 answer
200 views

Why is ItoProcess failing here? (Stochastic Differential Equation) [closed]

Why is this code returning errors and failing to run? If I replace Abs[x[t]]^2 with just x[t] it works perfectly. ...
Tom's user avatar
  • 3,416
2 votes
1 answer
100 views

RandomFunction with a QueueingProcess for more than one service handler hangs, why?

In Mathematica, I want to, say, investigate a M/M/4 queue, that is a single queue with 4 services each handling jobs from that same queue. The arrival rate is 4 and the service rate is 2. I've ...
nanitous's user avatar
  • 285
1 vote
0 answers
53 views

Generalize WienerProcess

Together the WhiteNoiseProcess, which includes the option of specifying a specific distribution for the noise, and the TransformProcess, which allows functions of processes, provide a great deal of ...
Kenric's user avatar
  • 334
1 vote
0 answers
89 views

Mean of ItoProcess

I've defined the following ItoProcess ...
mvc's user avatar
  • 159
0 votes
0 answers
136 views

Correlated random variables

Assume we have a random variable $X(t)$ that changes as a function of time satisfying a correlation $\left\langle X(0) X(\tau) \right\rangle=e^{-\tau/\tau_c}$. Is Mathematica able to generate random ...
sined's user avatar
  • 583
7 votes
1 answer
341 views

RandomPoint inside mesh for walk-on-spheres Monte Carlo PDE solver

I'm trying to understand a Monte-Carlo Laplace/Poisson PDE solver: http://www.cs.cmu.edu/~kmcrane/Projects/MonteCarloGeometryProcessing/paper.pdf This method inspired by random-walks and ray-tracing ...
flinty's user avatar
  • 25.5k
0 votes
0 answers
45 views

How can i calculate the dynamical evolution of states and a probability plot of them?

Using 4 correlation matrices i define as my market states i have to follow the evolution of the market as dynamical transitions between these states. In other words, i have to show the evolution ...
Tony Steiner's user avatar
14 votes
1 answer
344 views

Ito Process sourced by Gaussian Process?

Question Is it possible to extend the function ItoProcess so that it takes correlated noise? I.e would like to be able to write ...
chris's user avatar
  • 23k
2 votes
0 answers
54 views

How is a Lévy stabile process pdf normalized?

I'm interested in how to deal with α-stabile probability density functions, for example one with the Laplace image like: $ \phi(s) = s^{(\alpha-1)}*e^{-\nu s^{\alpha}} $ I can work with this ...
Castle's user avatar
  • 127
3 votes
1 answer
287 views

Fast way of re-ordering list

I have a list which at each iteration of my algorithm is being modified. What I want to do is to find the elements that satisfy certain criterion (below it's simply being above the neighborhood ...
Al Guy's user avatar
  • 1,610
4 votes
1 answer
320 views

Connecting 2 graphs according to NearestNeighbor and degree distribution

Context and example: Suppose we have 2 graphs $g_1,g_2$ that we connect together by introducing edges between each node of $g_1$ and its corresponding nearest neighbors within the second graph $g_2.$ ...
user avatar
0 votes
2 answers
178 views

Need to calculate total distance traveled in a 2D random walk

Part1 s = {0., 0.}; path = Table[s += RandomReal[{-0.5, 0.5}, 2], {100}]; ListLinePlot[path, ImageSize -> Small] path This part of the code generates 100 xy ...
NP code's user avatar
0 votes
3 answers
911 views

How can I generate monotonic random real numbers

My question is simple, and therefore I made a search of an answer to it using the Repository of this forum. There are relevant questions, however, none of them answers to the following question. My ...
Tugrul Temel's user avatar
  • 6,223