Create a gaussian process from spectral densityΒΆ

In this example we are going to build a gaussian process from its spectral density.

[1]:
from __future__ import print_function
import openturns as ot
[2]:
# define a spectral model
amplitude = [1.0, 2.0]
scale = [4.0, 5.0]
spatialCorrelation = ot.CorrelationMatrix(2)
spatialCorrelation[0,1] = 0.8
mySpectralModel = ot.CauchyModel(scale, amplitude, spatialCorrelation)
[3]:
# define a mesh
myTimeGrid =  ot.RegularGrid(0.0, 0.1, 20)
[4]:
# create the process
process = ot.SpectralGaussianProcess(mySpectralModel, myTimeGrid)
print(process)
 SpectralGaussianProcess=SpectralGaussianProcess dimension=2 spectralModel=class=CauchyModel amplitude=[1,2] scale=[4,5] spatial correlation=
[[ 1   0.8 ]
 [ 0.8 1   ]] maximal frequency=5 n frequency=10
[5]:
# draw a sample
sample = process.getSample(6)
sample.drawMarginal(0)
[5]:
../../_images/examples_probabilistic_modeling_gaussian_process_spectral_6_0.svg