.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_probabilistic_modeling/stochastic_processes/plot_parametric_spectral_density.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_probabilistic_modeling_stochastic_processes_plot_parametric_spectral_density.py: Create a parametric spectral density function ============================================= .. GENERATED FROM PYTHON SOURCE LINES 6-13 This example illustrates how the User can create a density spectral function from parametric models. The library implements the *Cauchy spectral model* as a parametric model for the spectral density function :math:`S`. The library defines this model thanks to the object *CauchyModel*. .. GENERATED FROM PYTHON SOURCE LINES 15-19 .. code-block:: Python import openturns as ot ot.Log.Show(ot.Log.NONE) .. GENERATED FROM PYTHON SOURCE LINES 20-21 1. Define a spectral density function from correlation matrix .. GENERATED FROM PYTHON SOURCE LINES 21-30 .. code-block:: Python amplitude = [1.0, 2.0, 3.0] scale = [4.0, 5.0, 6.0] spatialCorrelation = ot.CorrelationMatrix(3) spatialCorrelation[0, 1] = 0.8 spatialCorrelation[0, 2] = 0.6 spatialCorrelation[1, 2] = 0.1 spectralModel_Corr = ot.CauchyModel(amplitude, scale, spatialCorrelation) spectralModel_Corr .. raw:: html
class=CauchyModel amplitude=class=Point name=Unnamed dimension=3 values=[4,5,6] scale=class=Point name=Unnamed dimension=3 values=[1,2,3] spatial correlation=class=CorrelationMatrix dimension=3 implementation=class=MatrixImplementation name=Unnamed rows=3 columns=3 values=[1,0.8,0.6,0.8,1,0.1,0.6,0.1,1] isDiagonal=false


.. GENERATED FROM PYTHON SOURCE LINES 31-32 2. Define a spectral density function from a covariance matrix .. GENERATED FROM PYTHON SOURCE LINES 32-41 .. code-block:: Python spatialCovariance = ot.CovarianceMatrix(3) spatialCovariance[0, 0] = 4.0 spatialCovariance[1, 1] = 5.0 spatialCovariance[2, 2] = 6.0 spatialCovariance[0, 1] = 1.2 spatialCovariance[0, 2] = 0.9 spatialCovariance[1, 2] = -0.2 spectralModel_Cov = ot.CauchyModel(scale, spatialCovariance) spectralModel_Cov .. raw:: html
class=CauchyModel amplitude=class=Point name=Unnamed dimension=3 values=[2,2.23607,2.44949] scale=class=Point name=Unnamed dimension=3 values=[4,5,6] spatial correlation=class=CorrelationMatrix dimension=3 implementation=class=MatrixImplementation name=Unnamed rows=3 columns=3 values=[1,0.268328,0.183712,0.268328,1,-0.0365148,0.183712,-0.0365148,1] isDiagonal=false


.. _sphx_glr_download_auto_probabilistic_modeling_stochastic_processes_plot_parametric_spectral_density.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_parametric_spectral_density.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_parametric_spectral_density.py `