%define OT_KrigingRandomVector_doc
"KrigingRandom vector, a conditioned Gaussian process.

Available constructors:
    KrigingRandomVector(*krigingResult, points*)


Parameters
----------
krigingResult : :class:`~openturns.KrigingResult`
    Structure that contains elements of computation of a kriging algorithm
points : 1-d or 2-d sequence of float
    Sequence of values defining a :class:`~openturns.Point` or a :class:`~openturns.Sample`.

Notes
------

KrigingRandomVector helps to create Gaussian random vector, :math:`Y: \Rset^n \mapsto \Rset^d`, with stationary covariance function  :math:`\cC^{stat}: \Rset^n \mapsto \cM_{d \times d}(\Rset)`, conditionally to some observations.

Let :math:`Y(x=x_1)=y_1,\cdots,Y(x=x_n)=y_n` be the observations of the Gaussian process. We assume the same Gaussian prior as in the :class:`~openturns.KrigingAlgorithm`:

.. math::

    Y(\vect{x}) = \Tr{\vect{f}(\vect{x})} \vect{\beta} + Z(\vect{x})

with :math:`\Tr{\vect{f}(\vect{x})} \vect{\beta}` a generalized linear model, :math:`Z(\vect{x})` a zero-mean Gaussian process with a stationary autocorrelation function :math:`\cC^{stat}`:

.. math::

    \mathbb{E}[Z(\vect{x}), Z(\vect{\tilde{x}})] = \sigma^2 \cC^{stat}_{\theta}(\vect{x} - \vect{\tilde{x}})

The objective is to generate realizations of the random vector :math:`Y`, on new points :math:`\vect{\tilde{x}}`, conditionally to these observations. For that purpose, :class:`~openturns.KrigingAlgorithm` build such a prior and stores results in a :class:`~openturns.KrigingResult` structure on a first step. This structure is given as input argument.

Then, in a second step, both the prior and the covariance on input points :math:`\vect{\tilde{x}}`, conditionally to the previous observations, are evaluated (respectively :math:`Y(\vect{\tilde{x}})` and :math:`\cC^{stat}_{\theta}(\vect{\tilde{x}})`).

Finally realizations are randomly generated by the Gaussian distribution :math:`\cN ( Y(\vect{\tilde{x}}), \cC^{stat}_{\theta}(\vect{\tilde{x}}) )`

KrigingRandomVector class inherits from :class:`~openturns.UsualRandomVector`. Thus it stores the previous distribution and returns elements thanks to that distribution (realization, mean, covariance, sample...)

"
%enddef
%feature("docstring") OT::KrigingRandomVector
OT_KrigingRandomVector_doc

// ---------------------------------------------------------------------

%define OT_KrigingRandomVector_getRealization_doc
"Compute a realization of the conditional Gaussian process (conditional on the learning set).

The realization predicts the value on the given input *points*.

Returns
-------
realization : :class:`~openturns.Point`
    Sequence of values of the Gaussian process.

See also
--------
getSample

Examples
--------
>>> import openturns as ot
>>> ot.RandomGenerator.SetSeed(0)
>>> sampleSize = 6
>>> dimension = 1
>>> f = ot.SymbolicFunction(['x0'], ['x0 * sin(x0)'])
>>> X = ot.Sample(sampleSize, dimension)
>>> for i in range(sampleSize):
...     X[i, 0] = 3.0 + i
>>> X[0, 0] = 1.0
>>> X[1, 0] = 3.0
>>> Y = f(X)
>>> # create algorithm
>>> basis = ot.ConstantBasisFactory(dimension).build()
>>> covarianceModel = ot.SquaredExponential([2.23606797749979])
>>> algo = ot.KrigingAlgorithm(X, Y, covarianceModel, basis)
>>> algo.run()
>>> # get the results
>>> result = algo.getResult()
>>> # Random vector evaluation
>>> rvector = ot.KrigingRandomVector(result, [[0]])
>>> # Realization of the random vector
>>> realization = rvector.getRealization()
"
%enddef
%feature("docstring") OT::KrigingRandomVector::getRealization
OT_KrigingRandomVector_getRealization_doc

// ---------------------------------------------------------------------

%define OT_KrigingRandomVector_getSample_doc
"Compute a sample of realizations of the conditional Gaussian process (conditional on the learning set).

The realization predicts the value on the given input *points*.

Returns
-------
realizations : :class:`~openturns.Sample`
    2-d float sequence of values of the Gaussian process.

See also
--------
getRealization

Examples
--------
>>> import openturns as ot
>>> ot.RandomGenerator.SetSeed(0)
>>> sampleSize = 6
>>> dimension = 1
>>> f = ot.SymbolicFunction(['x0'], ['x0 * sin(x0)'])
>>> X = ot.Sample(sampleSize, dimension)
>>> for i in range(sampleSize):
...    X[i, 0] = 3.0 + i
>>> X[0, 0] = 1.0
>>> X[1, 0] = 3.0
>>> Y = f(X)
>>> # create algorithm
>>> basis = ot.ConstantBasisFactory(dimension).build()
>>> covarianceModel = ot.SquaredExponential([2.23606797749979])
>>> algo = ot.KrigingAlgorithm(X, Y, covarianceModel, basis)
>>> algo.run()
>>> # get the results
>>> result = algo.getResult()
>>> # Random vector evaluation
>>> rvector = ot.KrigingRandomVector(result, [[0.0]])
>>> # Realization of the random vector
>>> realizations = rvector.getSample(5)
"
%enddef
%feature("docstring") OT::KrigingRandomVector::getSample
OT_KrigingRandomVector_getSample_doc


// ---------------------------------------------------------------------

%define OT_KrigingRandomVector_getKrigingResult_doc
"Return the kriging result structure.

Returns
-------
krigResult : :class:`~openturns.KrigingResult`
    The structure containing the elements of a KrigingAlgorithm.


Examples
--------
>>> import openturns as ot
>>> ot.RandomGenerator.SetSeed(0)
>>> sampleSize = 6
>>> dimension = 1
>>> f = ot.SymbolicFunction(['x0'], ['x0 * sin(x0)'])
>>> X = ot.Sample(sampleSize, dimension)
>>> for i in range(sampleSize):
...    X[i, 0] = 3.0 + i
>>> X[0, 0] = 1.0
>>> X[1, 0] = 3.0
>>> Y = f(X)
>>> # create algorithm
>>> basis = ot.ConstantBasisFactory(dimension).build()
>>> covarianceModel = ot.SquaredExponential([2.23606797749979])
>>> algo = ot.KrigingAlgorithm(X, Y, covarianceModel, basis)
>>> algo.run()
>>> # get the results
>>> result = algo.getResult()
>>> # Random vector evaluation
>>> rvector = ot.KrigingRandomVector(result, [[0.0]])
>>> # Get the kriging result
>>> krigResult = rvector.getKrigingResult()"
%enddef
%feature("docstring") OT::KrigingRandomVector::getKrigingResult
OT_KrigingRandomVector_getKrigingResult_doc
