1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
#! /usr/bin/env python
from __future__ import print_function
from openturns import *
TESTPREAMBLE()
RandomGenerator.SetSeed(0)
try:
# Default dimension parameter to evaluate the model
defaultDimension = 1
# Default spatial dimension
spatialDimension = 1
# Amplitude values
amplitude = NumericalPoint(defaultDimension, 1.0)
# Scale values
scale = NumericalPoint(spatialDimension, 1.0)
# Default constructor
myDefautModel = ExponentialCauchy()
print("myDefautModel = ", myDefautModel)
# Second order model with parameters
myModel = ExponentialCauchy(amplitude, scale)
print("myModel = ", myModel)
timeValueOne = 1.
print("covariance matrix at t = ", timeValueOne,
" : ", myModel.computeCovariance(timeValueOne))
print("covariance matrix at t = ", -1.0 * timeValueOne,
" : ", myModel.computeCovariance(-1.0 * timeValueOne))
# Evaluation at time higher to check the decrease of the exponential values
timeValueHigh = 15.
print("covariance matrix at t = ", timeValueHigh, " : ",
myModel.computeCovariance(timeValueHigh).__str__())
timeGrid = RegularGrid(0.0, 1.0 / 3.0, 4)
print("discretized covariance over the time grid=",
timeGrid, "is=", myModel.discretize(timeGrid))
except:
import sys
print("t_ExponentialCauchy_std.py", sys.exc_info()[0], sys.exc_info()[1])
|