26
votes
Accepted
Efficient way to simulate thousands of Markov chains
While the other answers focus on circumventing the simulations, I focus on how to speed up the simulations themselves. (Sometimes, simulations might be unavoidable.)
In this situation, when calling <...
21
votes
Accepted
How to implement Markov Chain Monte Carlo with built-in functions?
As of Version 11.3, there is an undocumented utility package, called
Statistics`MCMC`
I came to know of it from the example notebook of this repository by @...
18
votes
Efficient way to simulate thousands of Markov chains
I essentially derive a second distribution - without a need for stochastic modelling - from DiscreteMarkovProcess timeslices according to your state to value ...
16
votes
Efficient way to simulate thousands of Markov chains
In general, Mathematica is not always the best tool for this type of simulation. That said, you do not need to compute sample paths to compute the mean or variance.
For a Markov chain with ...
11
votes
Mathematica code for hidden Markov models (HMM)
Mathematica V10 introduced the following two functions:
- HiddenMarkovProcess
- FindHiddenMarkovStates
Examples of their ...
10
votes
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 on Mathematica.
It is not clear to me what exactly "removing a stochastic trend" means.
If we assume "difference-...
10
votes
Accepted
Optimization of the following code
The function $x \mapsto P_x([a,b])$ is continuous and piecewise linear, so it can be easily and exactly integrated with the trapezoidal rule. Then the resulting quadrature rule can be compiled for ...
8
votes
Accepted
Can built-in functions deal with stochastic delay differential equations (SDDE)?
For numerical model we can define RandomFunction[] with WienerProcess[] outside of NDSolve ...
8
votes
Accepted
Numerically solving a system of SDE's with Levy noise?
To simulate Levy jumps we can use numerical model described in the paper Analysis of a stochastic SEIS epidemic model with the standard Brownian
motion and Lévy jump. In this model we use ...
7
votes
Accepted
ItoProcess for stochastic reaction-diffusion equation
Here's a solution following @acl's suggestion of discretizing in space. I added a diffusion coefficient d and used reflecting boundary conditions.
...
7
votes
Accepted
Continuous noise representation
For white noise, you can use WhiteNoiseProcess. This is just a process, so you need to pass it to RandomFunction to get actual ...
7
votes
7
votes
Accepted
Find PDF of a stochastic process
For simple processes this can be done by using the function PDF:
...
6
votes
Accepted
How to reformulate differential equation problem as OrnsteinUhlenbeckProcess
One could do:
...
6
votes
Accepted
6
votes
ItoProcess for 3 coupled SDEs sourced by 5 Wiener processes
The typographic error is in the definition of the matrix
...
5
votes
Accepted
Stochastic process, Corelation function, Numerical solution, real data
Sample CorrelationFunction is a biased estimator. It works better when applied to the whole ensemble of paths instead of calculating it pathwise and taking means. ...
5
votes
How to implement Markov Chain Monte Carlo with built-in functions?
I'm currently implementing a MCMC in Mathematica.
What I've done so far.
1.-Build your Model
2.-Import your data (X,Y,σ)
3.-Assign the initial parameters (P1=1 and P2=2) for example.
4.-Sample ...
5
votes
Accepted
Solving a stochastic dynamical system
A few things:
1) The second equation doesn't match the ODEs as noted by @b.gatessucks.
2) You need to use \[DifferentialD]t on the right hand sides.
3) ...
4
votes
Accepted
ITO Process with random initial position
I don't believe this is directly possible - the process is evaluated before the random paths are generated. I'll ponder further, but if you want the same effect, try something like this:
...
4
votes
Hypergeometric function with a matrix argument
You can use the new in M9 function MatrixFunction to do this. For instance:
...
4
votes
Accepted
Random Variable in Recurrence Function
You can avoid pre-evaluation with the following definition
...
4
votes
Accepted
Build a histogram from stochastic data
When requiring details information for many built in "data types" that are represented graphically by a gray box (e.g., TemporalData or ...
4
votes
Accepted
Defining stochastic differential equations and simulating a system of three SDEs
Two things:
1) You can't use {} to group terms as in your z equation. See, for example, here for more info.
2) You need to ...
4
votes
Accepted
4
votes
Ito Process sourced by Gaussian Process?
It is not a solution, but some comparison two different approach to the same problem (oscillator with random force). What we expecting from ItoProcess in this case? ...
4
votes
Accepted
How can I calculate the Allan Variance of a list of Data?
I think this does what you need:
...
4
votes
Accepted
How add noise to a differential equation?
One way to make random noise over the range t = 0 to 10:
...
4
votes
Accepted
Stochastic process: Understanding Ornstein Uhlenbeck Process
You have different x axes. For the correlation function the x axis is 0,1,2,... And for the Table you have 0,0.1,0.2,0.3,... (Note: f is not defined, I set it to f=0.1)
If we change the x axis of the ...
4
votes
Accepted
Solving Stochastic Gross-Pitaevskii equation
We can compute correlation function with OrnsteinUhlenbeckProcess[] using mean in time as follows
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
stochastic-calculus × 154differential-equations × 52
random × 28
random-process × 18
probability-or-statistics × 17
plotting × 16
simulation × 10
numerical-integration × 8
finance × 8
equation-solving × 5
matrix × 4
performance-tuning × 4
numerics × 4
code-request × 4
time-series × 4
correlation × 4
calculus-and-analysis × 3
modeling × 3
system-modeling × 3
list-manipulation × 2
graphics × 2
graphics3d × 2
fitting × 2
symbolic × 2
warning-messages × 2