TrendTransform

class TrendTransform(*args)

Trend transformation.

Parameters:

myTrendFunc : Function

The trend function f_{trend} of a process.

Notes

A multivariate stochastic process X: \Omega \times\cD \rightarrow \Rset^d of dimension d where \cD \in \Rset^n may write as the sum of a trend function f_{trend}: \Rset^n \rightarrow \Rset^d and a stationary multivariate stochastic process X_{stat}: \Omega \times\cD \rightarrow \Rset^d of dimension d as follows:

X(\omega,\vect{t}) = X_{stat}(\omega,\vect{t}) + f_{trend}(\vect{t})

We note (\vect{x}_0, \dots, \vect{x}_{N-1}) the values of one field of the process X, associated to the mesh \cM = (\vect{t}_0, \dots, \vect{t}_{N-1}) of \cD. We note (\vect{x}^{stat}_0, \dots, \vect{x}^{stat}_{N-1}) the values of the resulting stationary field. Then we have:

\vect{x}^{stat}_i = \vect{x}_i - f_{trend}(\vect{t}_i)

Examples

Create a trend function: f_{trend} : \Rset \mapsto \Rset where f_{trend}(t)=1+2t+t^2:

>>> import openturns as ot
>>> f = ot.SymbolicFunction(['t'], ['1+2*t+t^2'])
>>> fTrend = ot.TrendTransform(f)

Add it to a process:

>>> myGrid = ot.RegularGrid(0.0, 0.1, 10)
>>> amplitude=[5.0]
>>> scale=[0.2]
>>> myCovModel=ot.ExponentialModel(scale, amplitude)
>>> myXProcess=ot.GaussianProcess(myCovModel, myGrid)
>>> myYProcess = ot.CompositeProcess(fTrend, myXProcess)

Remove it from a field:

>>> myField = myYProcess.getRealization()
>>> myStatField = fTrend.getInverse()(myField)

Then re-add it:

>>> myInitialField = fTrend(myStatField)

Methods

__call__(…) <==> x(…)
getCallsNumber() Get the number of calls of a FieldFunction.
getClassName() Accessor to the object’s name.
getEvaluation() Get the evaluation function of h.
getId() Accessor to the object’s id.
getInputDescription() Get the description of the inputs.
getInputDimension() Get the dimension of the input.
getInverse() Accessor to the inverse trend function.
getMarginal(*args) Get the marginal(s) at given indice(s).
getName() Accessor to the object’s name.
getOutputDescription() Get the description of the outputs.
getOutputDimension() Get the dimension of the output.
getOutputMesh(inputMesh) Get the mesh associated to the output process.
getShadowedId() Accessor to the object’s shadowed id.
getSpatialDimension() Get the dimension of the mesh.
getVisibility() Accessor to the object’s visibility state.
hasName() Test if the object is named.
hasVisibleName() Test if the object has a distinguishable name.
setInputDescription(inputDescription) Set the description of the inputs.
setName(name) Accessor to the object’s name.
setOutputDescription(outputDescription) Set the description of the outputs.
setShadowedId(id) Accessor to the object’s shadowed id.
setVisibility(visible) Accessor to the object’s visibility state.
__init__(*args)

x.__init__(…) initializes x; see help(type(x)) for signature

getCallsNumber()

Get the number of calls of a FieldFunction.

Returns:

callsNumber : int

Counts the number of times the FieldFunction has been called since its creation.

getClassName()

Accessor to the object’s name.

Returns:

class_name : str

The object class name (object.__class__.__name__).

getEvaluation()

Get the evaluation function of h.

Returns:

h : EvaluationImplementation

Evaluation function of h: \Rset^n \times \Rset^d \mapsto \Rset^q.

Examples

>>> import openturns as ot
>>> h = ot.SymbolicFunction(['t', 'x'], ['x + t^2'])
>>> n = 1
>>> myVertexValueFunction = ot.ValueFunction(h, n)
>>> print(myVertexValueFunction.getEvaluation())
[t,x]->[x + t^2]
getId()

Accessor to the object’s id.

Returns:

id : int

Internal unique identifier.

getInputDescription()

Get the description of the inputs.

Returns:

inputDescription : Description

Describes the inputs of the function.

getInputDimension()

Get the dimension of the input.

Returns:

d : int

Input dimension d of the function.

getInverse()

Accessor to the inverse trend function.

Returns:

myInverseTrendTransform : InverseTrendTransform

The f_{trend}^{-1} function.

getMarginal(*args)

Get the marginal(s) at given indice(s).

Parameters:

i : int or list of ints, 0 \leq i < d

Indice(s) of the marginal(s) needed. d is the dimension of the FieldFunction.

Returns:

fieldFunction : FieldFunction

FieldFunction restricted to the concerned marginal(s) at the indice(s) i of the field function f_{dyn}.

getName()

Accessor to the object’s name.

Returns:

name : str

The name of the object.

getOutputDescription()

Get the description of the outputs.

Returns:

outputDescription : Description

Describes the outputs of the function.

getOutputDimension()

Get the dimension of the output.

Returns:

q : int

Output dimension q of the function.

getOutputMesh(inputMesh)

Get the mesh associated to the output process.

Returns:

outputMesh : Mesh

The mesh of the output process.

getShadowedId()

Accessor to the object’s shadowed id.

Returns:

id : int

Internal unique identifier.

getSpatialDimension()

Get the dimension of the mesh.

Returns:

spatialDimension : int, n \geq 0

Dimension of the mesh \cM.

getVisibility()

Accessor to the object’s visibility state.

Returns:

visible : bool

Visibility flag.

hasName()

Test if the object is named.

Returns:

hasName : bool

True if the name is not empty.

hasVisibleName()

Test if the object has a distinguishable name.

Returns:

hasVisibleName : bool

True if the name is not empty and not the default one.

setInputDescription(inputDescription)

Set the description of the inputs.

Parameters:

inputDescription : sequence of str

Describes the inputs of the function.

setName(name)

Accessor to the object’s name.

Parameters:

name : str

The name of the object.

setOutputDescription(outputDescription)

Set the description of the outputs.

Parameters:

outputDescription : sequence of str

Describes the outputs of the function.

setShadowedId(id)

Accessor to the object’s shadowed id.

Parameters:

id : int

Internal unique identifier.

setVisibility(visible)

Accessor to the object’s visibility state.

Parameters:

visible : bool

Visibility flag.