Questions tagged [stochastic-calculus]

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

Filter by
Sorted by
Tagged with
24
votes
2answers
1k views

How to implement Markov Chain Monte Carlo with built-in functions?

These days I'm trying to conduct a model sensitivity test which is heavily based on the Markov Chain Monte Carlo simulation approach. And I find this 'MCMC' package that can perform Markov Chain ...
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 ...
16
votes
3answers
2k views

Plotting the solution of a vector stochastic differential equation

I have a vector stochastic differential equation, $$\mathrm dq = p\,\mathrm dt\qquad q(0)=0$$ $$\mathrm dp = (-q -p)\mathrm dt+\mathrm dW\qquad p(0)=10$$ This can be entered to give me the process ...
15
votes
2answers
6k views

Solving a stochastic differential equation

How do I solve the following simple stochastic differential equation: $$ m x''[t] + \Gamma x'[t] + k x[t] = \sqrt[]{(2 k_{b} T/\Gamma)} \eta[t] $$ here $\eta[t]$ is Brownian motion, i.e. Wiener ...
15
votes
2answers
783 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 ...
14
votes
2answers
2k views

Mathematica code for hidden Markov models (HMM)

I am looking for some simple Mathematica code to model an HMM with just a few states and an equal number of observable signals (emissions). I am hoping to generate sample paths and keep track of the ...
13
votes
1answer
305 views

Regime Change Stochastic Process

I would like to simulate an Ito process in which the drift and diffusion terms change after hitting a boundary for the first time. For example, a Geometric Brownian Motion X which has 0 drift and ...
13
votes
2answers
805 views

Efficient GeometricBrownianMotionProcess Monte Carlo simulation

Following the answers in this post, I'm trying to implement something similar. If the GBM stays inside the corridor [L, U] between predefined times it should return ...
10
votes
1answer
896 views

ItoProcess for stochastic reaction-diffusion equation

I am trying to simulate a stochastic differential equation in time and space, but I'm unsure if this can be done in Mathematica. The sde that I would like to study is: $$ dN[x,t]=N[x,t](1-N[x,t])dt+\...
8
votes
3answers
821 views

Share experiences, preferably the surprising ones, with using ItoProcess

Can people please share their experiences, preferably the surprising ones, with using ItoProcess? I am a big fan of ItoProcess and have already used it for several finance-related tasks, though I ...
8
votes
1answer
2k views

Monte Carlo simulation using geometric Brownian motion

I'm relatively new to Mathematica programming, so forgive my rather unsophisticated question: I'm trying to do a Monte Carlo simulation using geometric Brownian motion (GBM). I want to write a ...
6
votes
1answer
1k views

ItoProcess function

While looking in the help manual of Mathematica concerning the ItoProcess function I found the following: ItoProcess[{a,b,c},x,t]: represents an Ito Process y(t)=c(t,x(t)), where dx(t)=a(t,x(t))dt+b(...
6
votes
1answer
228 views

Error in ARIMAProcess example

I am trying to compile the sample of ARIMAProcess of MMA here .It doesn't work.What is wrong?Could you please help?I am using exact same code. ...
5
votes
2answers
389 views

Use of Ito's lemma in ItosLemma.m (or any other method in Mathematica)

This is a follow-up question on this question: Use of Ito's lemma in ItoProcess My problem is to find some method how to use Ito's lemma in Mathematica. As an example: How can I apply Ito's ...
5
votes
2answers
307 views

Solve a stochastic equation analytically

I have a function $\vec{F}_i(t)$, which is unknown, but I do know it's mean $\langle \vec{F}_i(t) \rangle = \vec{0}$ and it's variance $\langle \vec{F}_i(t) \cdot \vec{F}_j(t') \rangle = 2 k_B T \...
5
votes
1answer
332 views

How to use Tandem Queueing Network Process?

Mathematica provides QueueingNetworkProcess and QueueingProcess. However, I can't seem to figure out how to create a tandem ...
5
votes
1answer
163 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: ...
5
votes
2answers
975 views

Boundary condition for stochastic differential equation

I have a simple stochastic differential equation (SDE) with white noise: ...
5
votes
1answer
163 views

Random Variable in Recurrence Function

Following the previously published question, I'm looking for the solution of RecurrenceTable with explicit random variable. For example, something like ...
5
votes
1answer
394 views

How to use some other driving process than the WienerProcess?

According to the following reference page http://reference.wolfram.com/language/ref/ItoProcess.html The driving process dproc can be any process that can be converted to a standard Ito process ...
4
votes
2answers
266 views

Adding conditions to stochastic differential equations

Consider the following process ...
4
votes
1answer
234 views

Parallelization of the stochastic Euler scheme

I wrote a simulation to approximate the law of a stochastic differential equation via a Monte Carlo method using the stochastic Euler scheme. Then I thought, it would be a good idea to speed up ...
4
votes
1answer
381 views

Defining stochastic differential equation & simulating a system of three SDEs

I am no expert on SDE but I've been messing around with MMA's built in functions and it makes it quite easy to do some simple simulations. I bumped into this system of equations (below) in a paper and ...
3
votes
2answers
374 views

Plot 2d-ItoProcess data in a plane

I am trying to simulate a simple 2d Ito SDE (randomly perturbed Hamiltonian system). Below is the code. ...
3
votes
4answers
746 views

Hypergeometric function with a matrix argument

I am looking for the evaluation of a Hypergeometric function with a matrix argument as for example in Koev and Edelman or as showcased in this Wikipedia article. From what I understand from ...
3
votes
1answer
319 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: ...
3
votes
1answer
904 views

Plot A Function Of A Stochastic Process

I am trying to do something very simple in Mathematica 9. I want to play around with option pricing and for that I thought it best to use the new stochastic process functionality. So, first of all I ...
3
votes
1answer
122 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(...
3
votes
1answer
116 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 ...
3
votes
1answer
61 views

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

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

Use of Ito's lemma in ItoProcess

In the documentation for the ItoProcess it says: Converting an ItoProcess to standard form automatically makes use of Ito's ...
3
votes
1answer
991 views
3
votes
0answers
293 views

Stochastic Schrödinger Equation

I have a stochastic coupled Schrödinger equation to solve. $$i\frac{\mathrm d X_k(t)}{\mathrm dt}=-\left(x_{k+1}(t)+x_{k-1}(t)\right)+V_k x_k(t)+\eta_k t x_k(t)$$ where $\left\langle\eta_k(t)\eta_j(...
3
votes
0answers
285 views

Solve ItoProcess SDE

I specified a SDE for a random process $y(t)$ using ItoProcess is there a mathematica function that provides the analytic solution for $y(t)$? I know ...
3
votes
0answers
274 views

Malliavin Derivative with Mathematica is it possible?

Is it possible to define a Malliavin calculus with Mathematica 9? Consider a random variables on the Wiener-space $\Omega=\mathcal{C}([0,1])$ of the form $$F=F(\omega)=\displaystyle\int_{0}^{T}h_{t}...
2
votes
2answers
224 views

Stochastic problem

I have to organize a small sports league and I am puzzled on how to create the game plan. We are 8 persons playing table soccer with 2 vs. 2 matches. The idea is that each person plays once with ...
2
votes
1answer
125 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 ...
2
votes
1answer
369 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.
2
votes
1answer
195 views

Expectation of GeometricBrownianMotionProcess

I am trying to compute $$\mathbb E\left[\max\left(\frac{S_{1/2}+S_1}{2}-K,0\right)\right]$$ where $K=100$ and $S_t$ is a geometric brownian motion (with $S_0=100$, drift $r=0.05$ and volatility $\...
2
votes
1answer
149 views

Stochastic process, Corelation function, Numerical solution, real data

I am new in Mathematica and stochastic process too. I would like to compute (auto)correlation function from real data. So I decide try/test Mathematica script on ...
2
votes
1answer
112 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(...
2
votes
2answers
340 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: ...
2
votes
2answers
504 views

Simulation of two Ito processes

I would like to simulate two processes, Ito Process "A" and Ito Process "B". What I need is to have only one path of process "B" but many paths of process "A" - however, I need all these paths of ...
2
votes
1answer
124 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 ...
2
votes
1answer
98 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 ...
2
votes
1answer
307 views

Solving SDE: $\frac{dy(t)}{dt}=(c+\sigma_wW(t))y(t)+\epsilon(t) $ in Mathematica

I want to solve this differential equation $\frac{dy(t)}{dt}=(c+\sigma_w W(t))y(t)+\epsilon(t) $. For details see https://math.stackexchange.com/questions/1385633/solving-sde-fracdytdt-c-sigma-wwtyt-...
2
votes
1answer
119 views

How to obtain SliceDistribution or StationaryDistribution for an ItoProcess when it is known to exist?

According to this reference page StationaryDistribution[proc] represents the stationary distribution of the process proc, when it exists. When I define the OrnsteinUhlenbeckProcess by the ...
2
votes
0answers
34 views

Monitoring time step manually within RandomFunction

Consider the following stochastic differential equation ...
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 ...
1
vote
2answers
58 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. ...