1%feature("docstring") OT::KarhunenLoeveReduction
2"Perform the reduction of a field.
3
4This object projects a field on the Karhunen-Loeve basis by computing
5the coefficients, lifts the coefficients, combines them with the
6value of the modes on the mesh which creates the reduced field.
7
8Parameters
9----------
10result : :class:`~openturns.KarhunenLoeveResult`
11    Decomposition result.
12trend : :class:`~openturns.TrendTransform`, optional
13    Process trend, useful when the basis built using the covariance function
14    from the space of trajectories is not well suited to approximate the mean
15    function of the underlying process.
16
17See also
18--------
19KarhunenLoeveProjection, KarhunenLoeveLifting
20
21Examples
22--------
23Create a KL decomposition of a Gaussian process:
24
25>>> import openturns as ot
26>>> numberOfVertices = 10
27>>> interval = ot.Interval(-1.0, 1.0)
28>>> mesh = ot.IntervalMesher([numberOfVertices - 1]).build(interval)
29>>> covariance = ot.SquaredExponential()
30>>> process = ot.GaussianProcess(covariance, mesh)
31>>> sampleSize = 10
32>>> sample = process.getSample(sampleSize)
33>>> threshold = 0.0
34>>> algo = ot.KarhunenLoeveSVDAlgorithm(sample, threshold)
35>>> algo.run()
36>>> klresult = algo.getResult()
37
38Generate some trajectories and reduce them:
39
40>>> sample2 = process.getSample(5)
41>>> reduction = ot.KarhunenLoeveReduction(klresult)
42>>> reduced = reduction(sample2)
43
44Same, but into account the trend:
45
46>>> trend = ot.TrendTransform(ot.P1LagrangeEvaluation(sample.computeMean()), mesh)
47>>> reduction = ot.KarhunenLoeveReduction(klresult, trend)
48>>> reduced = reduction(sample2)"
49
50// ---------------------------------------------------------------------
51
52%feature("docstring") OT::KarhunenLoeveReduction::setTrend
53"Trend accessor.
54
55Parameters
56----------
57trend : :class:`~openturns.TrendTransform`, optional
58    Process trend, useful when the basis built using the covariance function
59    from the space of trajectories is not well suited to approximate the mean
60    function of the underlying process."
61