# Create a parametric spectral density functionΒΆ

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 .

The library defines this model thanks to the object CauchyModel.

```import openturns as ot

ot.Log.Show(ot.Log.NONE)
```
1. Define a spectral density function from correlation matrix

```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
```
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

1. Define a spectral density function from a covariance matrix

```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
```
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