Create a random walk processΒΆ

In this basic example we are going to build a white noise process by its origin and distribution.

In [1]:
from __future__ import print_function
import openturns as ot
import math as m
In [2]:
# Define the distribution, origin
myDist = ot.ComposedDistribution([ot.Normal(), ot.Exponential(0.2)], ot.ClaytonCopula(0.5))
myOrigin = ot.Point(myDist.getMean())
In [3]:
# Define the mesh
myTimeGrid = ot.RegularGrid(0, 0.1, 10)
In [4]:
# Create the process:
process = ot.RandomWalk(myOrigin, myDist, myTimeGrid)
print(process)
class=ProcessImplementation dimension=2 description=[X0,X1] mesh=class=Mesh name=Unnamed dimension=1 vertices=class=Sample name=Unnamed implementation=class=SampleImplementation name=Unnamed size=10 dimension=1 description=[t] data=[[0],[0.1],[0.2],[0.3],[0.4],[0.5],[0.6],[0.7],[0.8],[0.9]] simplices=[[0,1],[1,2],[2,3],[3,4],[4,5],[5,6],[6,7],[7,8],[8,9]]
In [5]:
# Draw a sample
sample = process.getSample(6)
sample.drawMarginal(0)
Out[5]:
../../_images/examples_probabilistic_modeling_random_walk_process_6_0.svg