Questions tagged [stochastic-calculus]

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

Filter by
Sorted by
Tagged with
3
votes
0answers
99 views

Kolmogorov backward PDE with boundary conditions

I am trying to solve numerically Kolmogorov backward PDE with boundary conditions: ...
1
vote
1answer
94 views

Find PDF of a stochastic process

I consider the following Ito process ...
0
votes
1answer
61 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: ...
1
vote
1answer
64 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 ...
0
votes
0answers
40 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 &...
0
votes
1answer
91 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 ...
1
vote
0answers
36 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 ...
0
votes
0answers
47 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-...
8
votes
1answer
307 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)]...
1
vote
0answers
40 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 ...
1
vote
2answers
83 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. ...
1
vote
1answer
69 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 ...
4
votes
2answers
292 views

Adding conditions to stochastic differential equations

Consider the following process ...
1
vote
1answer
48 views

Parametric Ito Process

Is it possible to make a parametric ItoProcess ? I'd like to write that equation : ...
1
vote
1answer
44 views

Ito Process with Piecewise

I have the following ItoProcess : ...
1
vote
0answers
24 views

Discrete variables in ParametricNDSolve [closed]

I'm trying to write a stochastic differential equation, using ParametricNDSolve and WhenEvents : ...
0
votes
1answer
207 views

How can I remove a stochastic trend from a time series

I am having some troubles with removing a stochastic trend from a time series. I am carrying out a study on the US debt to GDP ratio. I noted that there's a smooth stochastic trend in the series. ...
3
votes
1answer
161 views

Defining stochastic differential equations and simulating a system of three SDEs

I am trying to work on stochastic differential equations and I have been trying to use Mathematica's built-in function to simulate the system of equations below. When i use the randomfunction to ...
1
vote
2answers
55 views

Passing the same random values for two stochastic processes

I have two Ito processes as shown below. I can define them separately, and simulate and plot them separately. The thing is, I do not want to apply RandomFunction to proc1 and proc2 separately. Because ...
2
votes
0answers
36 views

Monitoring time step manually within RandomFunction

Consider the following stochastic differential equation ...
2
votes
1answer
127 views

Stochastic ODE Integration problems using RandomFunction

I'm attempting to add noise to a set of ODE's with two state variables. $$\frac{dx}{dt} = 10 -(x-1)\left(1+\frac{exp\left(\frac{x-1}{5y}\right)}{50y}\right)$$ $$\frac{dy}{dt} = 2(1-y) -y\cdot exp\left(...
0
votes
0answers
22 views

Puzzling behavior of ItoProcess with Abs

Hi I am simulating a Fisher-Wright diffusion, it works ...
3
votes
1answer
139 views

Solving a stochastic dynamical system

I'm attempting to add gaussian white noise into a single equation of a 2 state variable dynamical system $$\frac{dx(t)}{dt}=1-x(t)\left(1+e^{-y(t)}\right)$$ $$\frac{dy(t)}{dt}=1-y(t)\left(1+e^{\frac{x(...
1
vote
1answer
109 views

Stability of the numerical methods for SDE

I've been figuring out with the methods for integrating of stochastic differential equations in Mathematica. I've considered the one-dimensional system: $$dx=-x dt+\sigma x dw$$ with some initial ...
1
vote
0answers
51 views

How to apply TransformedProcess to a user defined ItoProcess?

Hi I would like to manipulate user defined Ito processes, say multiply my process by a deterministic function . Thanks in advance ...
1
vote
2answers
74 views

Ignoring overflows in SDE simulations

I'm trying to compute the average of the solution to an SDE by simulating some of its sample paths and then taking their Mean. The problem is my SDE is explosive ...
22
votes
3answers
2k views

Efficient way to simulate thousands of Markov chains

I am currently trying to simulate relaxation of a protein population while maintaining the stochastic properties of the system. For this, I used a Markov chain to describe the temporal evolution of ...
1
vote
1answer
91 views

Help to extend this evaluation!

I'm performing a stochastic evaluation, where i'm interested in the assymptotic behavior of the solutions, but my computer can't stand very large times. So I thought that I could evaluate a certain ...
1
vote
1answer
94 views

Build a histogram from stochastic data

I have the following code yielding my stochastic "paths": ...
2
votes
1answer
135 views

Simulation of the stochastic system

I have the stochastic system which consists of 4 nonlinear equations. White Gaussian noise is used in the third equation only. Nevertheless, the whole system is stochastic. Some problems arise when ...
3
votes
1answer
69 views

How to plot more paths to this SDE simulation? [duplicate]

I have the following code that simulates an Ito process in Mathematica, ...
2
votes
1answer
110 views

Stochastic Mathieu equation: Is this a numerical instability?

So I am a beginner with stochastic differential equations and came across Mathematica's capabilities for solving them. I am solving the stochastic Mathieu equation with a harmonic forcing term that ...
1
vote
1answer
137 views

Solve a System of mixed SDE and ODE

I have a system of differential equation to solve, but it's a mixed system of ODE and SDE. I'm not sure whether there is any way to solve this kind of system or not. My equations are: ...
0
votes
0answers
157 views
1
vote
0answers
68 views

How to simulate two coupled birth-death-immigration processes?

I am simulating a birth-death-immigration process for two coupled populations that interact by virtue of the birth-rate in one population being equal to the death-rate in the other population. The two ...
2
votes
1answer
145 views

How to reformulate differential equation problem as OrnsteinUhlenbeckProcess

I have the following differential equation m*x''[t] + k*x'[t] - randomForce[t] == 0 which describes an oscillating particle with mass ...
0
votes
0answers
187 views

Solving a differential equation with a stochastic force term with NDSolve [duplicate]

I am asking how NDSolve can be used to solve the following differential equation, What is the correct code to solve the following differential equation ...
1
vote
0answers
106 views

An Ito process with intermediate constraints

I have a controlled stochastic process described by $\dot{x} = X(x) + u(t) + \eta_x(t),$ where $u$ is the control, $\eta_x$ is a white noise with zero mean. The equation is called Langevin equation. ...
1
vote
1answer
493 views

NDSolve for 2d Langevin equation

I want to simulate the movement of a damped single particle which vibrates due to Brownian motion. $m \ddot{x} + \gamma \dot{x} - \xi(t)=0$ where $\gamma$ is the friction constant and $\xi(t)$ a "...
1
vote
1answer
165 views

ItoProcess and/or RandomFunction numerical failure for coupled SDEs

I'm trying to simulate a physical system including noise using the ItoProcess command, the system is governed by two coupled differential equations. The potential ...
1
vote
0answers
82 views

Dealing with Vector Outputs from ItoProcess, RandomProcess (Stochastic Differential Equations)

I'm modeling stochastic chemical kinetics and the ItoProcess[] function has served me well. I am trying to write an efficient code to analyze many (Paths) trajectories of several different reagents (...
2
votes
2answers
411 views

Stochastic Lotka-Volterra Predator-Prey Model

I am struggling with writing a stochastic version of Lotka-Volterra predator-prey model. This is as far as I have gotten: ...
0
votes
0answers
177 views

How to generate a fractional Brownian motion?

In Mathematica 9.0 I run the following piece of code: ...
0
votes
0answers
192 views

Estimate parameters of two correlated geometric Brownian motions

I would like estimate the parameters of the following set of Geometric Brownian Motions: $d P(t) = \mu_P P(t) d t + \sigma_P P(t) d Z_P(t)$ $d X(t) = \mu_X X(t) d t + \sigma_X X(t) d Z_X(t)$ ...
2
votes
1answer
438 views

How to solve a stochastic differential equation? [closed]

This is a stochastic differential equation, $$ dx(t) = -x(t)dt + e^{(-t)} dw(t)$$ I am not able to determine the next steps to solve this equation.
1
vote
2answers
106 views

How can I add new columns to a Table after each evaluation?

I'm interested in simulating chemical reactions with perturbations. I can simulate a given reaction using NDSolve ("rxn"} with a given added noise component ("noise1"). Due to the noise, each ...
1
vote
0answers
85 views

ItoProcess with log

I would like to use ItoProcess to simulate some paths of $r(t)$, a process that follows the sde $$d\ln\left(r\left(t\right)\right)=\left(\theta-\ln\left(r(t)\right)\...
1
vote
1answer
229 views

Continuous noise representation

I am new to stochastic processes (and actually Mathematica too) and there are many things that I still didn't fully understand yet so please forgive me if I say something wrong. What I am trying to ...
3
votes
1answer
339 views

Ito Process paths over a Plot3D

I was wondering if its possible to draw the simulated paths of an Ito diffusion over the probability density function. Ito Process: ...
5
votes
1answer
166 views

ITO Process with random initial position

I am trying to define an ITO process with random initial state but its only drawing once an uses it for all paths. Here is the code: ...