Note
Click here to download the full example code
Create an event based on a processΒΆ
This example gives elements to create an event based on a multivariate stochastic process. Let be a stochastic process of dimension , where is discretized on the mesh . We suppose that contains vertices.
We define the event as:
where is a domain of .
A particular domain is the cartesian product of type:
In that case, the library defines by its both extreme points : and .
In the general case, is a Domain object that is able to check if it contains a given point in .
The library creates an Event object from the process and the domain . Then, it is possible to get a realization of the event , which is scalar if is a realization of on .
import openturns as ot
import openturns.viewer as viewer
from matplotlib import pylab as plt
ot.Log.Show(ot.Log.NONE)
Define a 2-d mesh
indices = [40, 20]
mesher = ot.IntervalMesher(indices)
lowerBound = [0., 0.]
upperBound = [2., 1.]
interval = ot.Interval(lowerBound, upperBound)
mesh = mesher.build(interval)
Create the covariance model
amplitude = [1.0, 2.0, 3.0]
scale = [4.0, 5.0]
spatialCorrelation = ot.CorrelationMatrix(3)
spatialCorrelation[0, 1] = 0.8
spatialCorrelation[0, 2] = 0.6
spatialCorrelation[1, 2] = 0.1
covmodel = ot.ExponentialModel(scale, amplitude, spatialCorrelation)
# Create a normal process
process = ot.GaussianProcess(covmodel, mesh)
Create a domain A in R^3: [0.8; 1.2]*[1.5; 1.6]*[0.5; 0.7]
lowerBound = [0.8, 1.5, 0.5]
upperBound = [1.2, 1.6, 0.7]
domain = ot.Interval(lowerBound, upperBound)
# Create the event
event = ot.ProcessEvent(process, domain)
Total running time of the script: ( 0 minutes 0.002 seconds)