Questions tagged [stochastic-calculus]

Questions about stochastic calculus in Mathematica, for example how to use ItoProcess and RandomFunction.

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

solve a stochastic differential equations

I would like to solve a coupled stochastic differential equations. $\dfrac{dx_1}{dt} = (x_2^2+x_3^2)\eta_1+x_3 x_2\eta_2 + ax_1\\ \dfrac{dx_2}{dt}= (x_1^2+x_3^2)\eta_2 +x_3 x_1\eta_1+ bx_2\\ \...
user avatar
  • 479
0 votes
1 answer
70 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 ...
user avatar
  • 101
1 vote
1 answer
49 views

Wrong means given by `RandomFunction` for `StratonovichProcess`

Hello I was trying to compute mean of multiple Stratonovich integral (for $W$ standard Wiener process). $$ J_{(1,1)} = \int_0^1 \left(\int_0^s 1\,\circ \mathrm{d}W_t\right) \circ \mathrm{d}W_s $$ ...
user avatar
  • 211
0 votes
1 answer
99 views

Interacting Brownian particles via harmonic repulsive potential

Following this paper (DOI: 10.1103/PhysRevResearch.1.032038) I want to simulate thermally driven particles in a viscous fluid that interact via the harmonic repulsive potential in 2D, namely $V(r_{ij}...
user avatar
  • 21
0 votes
0 answers
67 views

I need to calculate the optimal value of a function involving integration

I am working on a capacity sharing problem which involves the function as the picture below. I want to calculate the derivative of the function with respect to the variable $a_1.$ The profit function ...
user avatar
  • 1
2 votes
2 answers
95 views

How to find the supremum of a brownian motion?

I imagine this is quite simple but unable to find it, if I simulate a standard brownian motion, $(B_t)_{t \geq 0}$, with ...
user avatar
0 votes
1 answer
88 views

Ito process with white noise

I would like to solve following system of SDEs, dx_i[t] = f[x_i[t]]*dt + dw_i[t] where d denotes ...
user avatar
0 votes
0 answers
63 views

System of stochastic differential equations

Is it possible to solve numerically system of coupled non-linear differential equations with noise? The system looks like ...
user avatar
2 votes
0 answers
87 views

Kloeden–Platen–Schurz algorithm for SDE

RandomFunction's Method setting includes "Kloeden–Platen–Schurz" as a possibility. ...
user avatar
  • 211
1 vote
0 answers
211 views

Fokker-Planck equation [closed]

Is there any package for simulation of Fokker-Planck equation in Mathematica? Or, in general for stochastic differential equations?
user avatar
1 vote
1 answer
89 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 ...
user avatar
1 vote
0 answers
59 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, ...
user avatar
0 votes
0 answers
19 views

How to simulate a non-White Gaussian process? [duplicate]

I am trying to numerically solve a second order stochastic differential equation. Usually the noise is assumed to be Wiener Process which is white as far as I know. Is it possible to use a Random ...
user avatar
  • 111
0 votes
1 answer
197 views

How add noise to a differential equation?

I have a differential equation: $$\frac{dx}{dt}=\operatorname{sech}(x-1)$$ I want to add noise to it and try to solve it numerically, but it seems that I am programming something wrong, because there ...
user avatar
  • 1,596
2 votes
1 answer
131 views

How can I calculate the Allan Variance of a list of Data?

I have a list with over 10.000 elements of data. Now I wanna calculate the Allan Variance of this Measurement. The Allan Variance is defined as following: $$\sigma_y^2(\tau)=\frac1{2\tau^2}\langle(x_{...
user avatar
  • 45
1 vote
1 answer
86 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 ...
user avatar
1 vote
0 answers
100 views

Coupled stochastic differential equation [closed]

I am trying to solve the following coupled system of stochastic differential equations: $\qquad \dot{x}(t)=y(t)\,\eta(t)$ $\qquad \dot{y}(t)=x(t)\,\eta(t)$ $x$ and $y$ are functions to be solved for ...
user avatar
  • 111
8 votes
1 answer
256 views

Can built-in functions deal with stochastic delay differential equations (SDDE)?

I know that functions like NDSolve can deal with delay differential equations and in the meanwhile, functions like ItoProcess ...
user avatar
2 votes
1 answer
90 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\...
user avatar
  • 3,286
4 votes
1 answer
106 views

WhenEvent in Stochastic Differential Equation

Is there a way to add events with WhenEvent or similar when using ItoProcess? Minimal example of my problem would be to change ...
user avatar
  • 211
2 votes
1 answer
129 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. ...
user avatar
  • 3,286
0 votes
1 answer
179 views

Random number in system of equations, solving using NDSolve & WhenEvent

I need to analyse the effect of random forcing on the system of coupled equations. For example, I have shown the equations below. $$\begin{pmatrix} x1''\\x2''\\x3''\\x4''\\x5'' \end{pmatrix} + M_{(5 \...
user avatar
  • 125
-2 votes
1 answer
206 views

How can I can plot a stochastic process? [closed]

How I can plot the following stochastic process using mathmatica
user avatar
1 vote
0 answers
57 views

Mean of ItoProcess

I've defined the following ItoProcess ...
user avatar
  • 159
2 votes
0 answers
53 views

TransformedProcess: a few questions about it

I have a couple of technical questions that, after searching the internet for hours, I have not been able to find an answer to. Mathematica's online instructions are not even addressing the issue at ...
user avatar
  • 133
1 vote
1 answer
139 views

Simulating a bivariate Ito process

I would like to simulate a bivariate process where the two components, say $X_1(t) $ and $ X_2(t), $ which are related by the following stochastic differential equations: ...
user avatar
  • 133
0 votes
0 answers
70 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 ...
user avatar
  • 499
1 vote
0 answers
87 views

Having trouble moving program from python to Mathematica

I'm trying to move a Covid-19 model programmed in python to Mathematica and I can't figure out how to translate this segment of the code to Mathematica. ...
user avatar
1 vote
1 answer
98 views

3D Plotting for the solution of stochastic differential equation

I have the following solution of the SDE: $$U(x,t)=-6+12 * \tanh \left[x+\left(B(t)-\frac{t^{2}}{2}\right)+\int_{0}^{t} e^{s^{2}} d s\right]^{2}$$ Where $B(t)$ is white noise. In the following code ...
user avatar
0 votes
0 answers
63 views

Explosion of solution with NDSolve

I'm trying to solve a delayed ODE involving white noise with the help of NDSolve. This provides a reasonable solution for times between 0 and 20000. After that the solution seems to explode. A curious ...
user avatar
  • 1
14 votes
1 answer
250 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 ...
user avatar
  • 21.7k
6 votes
1 answer
155 views

ItoProcess for 3 coupled SDEs sourced by 5 Wiener processes

Context I am trying to solve a stochastic equation corresponding to Vector resonant relaxation (the way orbital planes of stars diffuse near the galactic center, see below). Setup Within the ...
user avatar
  • 21.7k
2 votes
2 answers
109 views

Driving a stochastic spiral by a velocity Brownian motion

I want to obtain the position x[t], solution of dx/dt=v and v the Orstein-Ulhenbeck process and use this x[t] in the cartesian coordinate definition of a stochastic spiral x_1(t)=tcos(t+x(t)) , x_2(t)...
user avatar
3 votes
0 answers
188 views

Kolmogorov backward PDE with boundary conditions

I am trying to solve numerically Kolmogorov backward PDE with boundary conditions: ...
user avatar
  • 1,548
1 vote
1 answer
185 views

Find PDF of a stochastic process

I consider the following Ito process ...
user avatar
0 votes
1 answer
69 views

Problem with iterations of Prepend/While

I am doing some work with black-scholes and am trying to find random interest rates based on some given information. This is my original code: ...
user avatar
1 vote
1 answer
83 views

Expectation and direct integration give different results [closed]

I have an integral I want to compute: $\qquad \int_{\mathbb R^4} e^{-(x_1+x_2+x_3+x_4)} \left( 1-x_1-x_3 \right) dx$ To me, this should be equivalent (modulo some scaling factor) to computing the ...
user avatar
  • 117
0 votes
2 answers
67 views

Extracting solutions from SDE

I have an SDE system which I solve using ...
user avatar
0 votes
0 answers
92 views

Solving SDE system in Ito form

Can mathematica solve a linear SDE system in Ito form, for example $$ \begin{equation} \begin{bmatrix} dx_1 \\ dx_2 \\ dx_3 \\ dx_4 \end{bmatrix} = \begin{bmatrix} x_1 & ix_2 &...
user avatar
0 votes
1 answer
121 views

Simulating a poker win rate over time

Poker players start with a fixed bankroll (bankroll) and play with a win-rate winRate (say measured in dollars per hour) and ...
user avatar
  • 2,975
1 vote
0 answers
61 views

Is it possible to speed up SDE simulation?

Is it possible to speed up SDE simulation in Mathematica? I am simulating a large number of Heston processes that look like the following (note this code is only a slight modification of the ...
user avatar
  • 43
0 votes
0 answers
91 views

How to solve forward Kolmogorov birth-death equations for unspecified number of populations

I'm attempting to use a forward Kolmogorov differential equation to model a birth-death process. This is fairly trivial when there's only one population, but I'm working with an unspecified and time-...
user avatar
  • 1
8 votes
1 answer
348 views

Optimization of the following code

Consider the function $$ h:[-1,1]\times I_{\sigma}\to I_{\sigma} $$ $$ (\omega, x)\mapsto \sqrt[3]{x + \sigma \omega} $$ where $ \sigma > \frac{2}{3\sqrt{3}}, I_{\sigma} = [x_-(\sigma), x_+(\sigma)]...
user avatar
2 votes
0 answers
68 views

Simulating Stochastic Matrix Differential Equation with Arbitrary Autocorrelation Function

I want to numerically simulate a matrix differential equation that includes a stochastic (vector) Gaussian noise $\mathbf{n}$, where the different vector components are independent, and each component ...
user avatar
1 vote
2 answers
233 views

Cannot solve coupled stochastic differential equations and how to find correlation of solutions?

I am trying to solve the equations $x'[t] = y[t]$, $y'[t]+(w^2+4*\gamma^2)x[t]+\gamma*y[t])=B[t]$ with the initial conditions $x[0]=0,y[0]=v_0$ This is what I have tried. ...
user avatar
1 vote
1 answer
93 views

Quality of parametric 3D plot on 2D plane

I need to plot the solution of an SDE which takes its values on the plane $\{z = 1\} \subseteq \mathbb R^3$. Here is the code of a minimal working example (the solution to the SDE is just the driving ...
user avatar
4 votes
2 answers
407 views

Adding conditions to stochastic differential equations

Consider the following process ...
user avatar
  • 1,885
1 vote
1 answer
90 views

Parametric Ito Process

Is it possible to make a parametric ItoProcess ? I'd like to write that equation : ...
user avatar
  • 1,225
1 vote
1 answer
97 views

Ito Process with Piecewise

I have the following ItoProcess : ...
user avatar
  • 1,225
1 vote
0 answers
47 views

Discrete variables in ParametricNDSolve [closed]

I'm trying to write a stochastic differential equation, using ParametricNDSolve and WhenEvents : ...
user avatar
  • 1,225