1%feature("docstring") OT::GeneralLinearModelResult 2"General linear model result. 3 4Parameters 5---------- 6inputSample, outputSample : :class:`~openturns.Sample` 7 The samples :math:`(\vect{x}_k)_{1 \leq k \leq N} \in \Rset^d` and :math:`(\vect{y}_k)_{1 \leq k \leq N}\in \Rset^p`. 8metaModel : :class:`~openturns.Function` 9 The meta model: :math:`\tilde{\cM}: \Rset^d \rightarrow \Rset^p`, defined in :eq:metaModel. 10residuals : :class:`~openturns.Point` 11 The residual errors. 12relativeErrors : :class:`~openturns.Point` 13 The relative errors. 14basis : collection of :class:`~openturns.Basis` 15 Collection of the :math:`p` functional basis: :math:`(\varphi_j^l: \Rset^d \rightarrow \Rset)_{1 \leq j \leq n_l}` for each :math:`l \in [1, p]`. 16 Its size should be equal to zero if the trend is not estimated. 17trendCoefficients : collection of :class:`~openturns.Point` 18 The trend coefficients vectors :math:`(\vect{\alpha}^1, \dots, \vect{\alpha}^p)`. 19covarianceModel : :class:`~openturns.CovarianceModel` 20 Covariance function of the Gaussian process with its optimized parameters. 21optimalLogLikelihood : float 22 The maximum log-likelihood corresponding to the model. 23 24Notes 25----- 26The structure is usually created by the method *run()* of a :class:`~openturns.GeneralLinearModelAlgorithm`, and obtained thanks to the *getResult()* method. 27 28The meta model :math:`\tilde{\cM}: \Rset^d \rightarrow \Rset^p` is defined by: 29 30.. math:: 31 :label: metaModel 32 33 \tilde{\cM}(\vect{x}) = \left( 34 \begin{array}{l} 35 \mu_1(\vect{x}) \\ 36 \dots \\ 37 \mu_p(\vect{x}) 38 \end{array} 39 \right) 40 41where :math:`\mu_l(\vect{x}) = \sum_{j=1}^{n_l} \alpha_j^l \varphi_j^l(\vect{x})` and :math:`\varphi_j^l: \Rset^d \rightarrow \Rset` are the trend functions. 42 43If a normalizing transformation *T* has been used, the meta model is built on the inputs :math:`\vect{z}_k = T(\vect{x}_k)` and the meta model writes: 44 45.. math:: 46 :label: metaModelWithT 47 48 \tilde{\cM}(\vect{x}) = \left( 49 \begin{array}{l} 50 \mu_1\circ T(\vect{x}) \\ 51 \dots \\ 52 \mu_p\circ T(\vect{x}) 53 \end{array} 54 \right) 55 56Examples 57-------- 58Create the model :math:`\cM: \Rset \mapsto \Rset` and the samples: 59 60>>> import openturns as ot 61>>> f = ot.SymbolicFunction(['x'], ['x * sin(x)']) 62>>> sampleX = [[1.0], [2.0], [3.0], [4.0], [5.0], [6.0]] 63>>> sampleY = f(sampleX) 64 65Create the algorithm: 66 67>>> basis = ot.Basis([ot.SymbolicFunction(['x'], ['x']), ot.SymbolicFunction(['x'], ['x^2'])]) 68>>> covarianceModel = ot.GeneralizedExponential([2.0], 2.0) 69>>> algo = ot.GeneralLinearModelAlgorithm(sampleX, sampleY, covarianceModel, basis) 70>>> algo.run() 71 72Get the result: 73 74>>> result = algo.getResult() 75 76Get the meta model: 77 78>>> metaModel = result.getMetaModel() 79>>> graph = metaModel.draw(0.0, 7.0) 80>>> cloud = ot.Cloud(sampleX, sampleY) 81>>> cloud.setPointStyle('fcircle') 82>>> graph = ot.Graph() 83>>> graph.add(cloud) 84>>> graph.add(f.draw(0.0, 7.0)) 85>>> graph.setColors(['black', 'blue', 'red']) 86" 87 88// --------------------------------------------------------------------- 89 90%feature("docstring") OT::GeneralLinearModelResult::getTrendCoefficients 91"Accessor to the trend coefficients. 92 93Returns 94------- 95trendCoef : collection of :class:`~openturns.Point` 96 The trend coefficients vectors :math:`(\vect{\alpha}^1, \dots, \vect{\alpha}^p)` 97" 98 99// --------------------------------------------------------------------- 100 101%feature("docstring") OT::GeneralLinearModelResult::getCovarianceModel 102"Accessor to the covariance model. 103 104Returns 105------- 106covModel : :class:`~openturns.CovarianceModel` 107 The covariance model of the Gaussian process *W*. 108" 109 110// --------------------------------------------------------------------- 111 112%feature("docstring") OT::GeneralLinearModelResult::getBasisCollection 113"Accessor to the collection of basis. 114 115Returns 116------- 117basisCollection : collection of :class:`~openturns.Basis` 118 Collection of the :math:`p` function basis: :math:`(\varphi_j^l: \Rset^d \rightarrow \Rset)_{1 \leq j \leq n_l}` for each :math:`l \in [1, p]`. 119 120Notes 121----- 122If the trend is not estimated, the collection is empty. 123" 124 125// --------------------------------------------------------------------- 126 127%feature("docstring") OT::GeneralLinearModelResult::getMetaModel 128"Accessor to the metamodel. 129 130Returns 131------- 132metaModel : :class:`~openturns.Function` 133 The meta model :math:`\tilde{\cM}: \Rset^d \rightarrow \Rset^p`, defined in :eq:'metaModel'. 134" 135 136// --------------------------------------------------------------------- 137 138%feature("docstring") OT::GeneralLinearModelResult::getTransformation 139"Accessor to the normalizing transformation. 140 141Returns 142------- 143transformation : :class:`~openturns.Function` 144 The transformation *T* that normalizes the input sample. 145" 146 147// --------------------------------------------------------------------- 148 149%feature("docstring") OT::GeneralLinearModelResult::setTransformation 150"Set accessor to the normalizing transformation. 151 152Parameters 153---------- 154transformation : :class:`~openturns.Function` 155 The transformation *T* that normalizes the input sample. 156" 157 158// --------------------------------------------------------------------- 159 160%feature("docstring") OT::GeneralLinearModelResult::getNoise 161"Accessor to the Gaussian process. 162 163Returns 164------- 165process : :class:`~openturns.Process` 166 Returns the Gaussian process :math:`W` with the optimized parameters. 167" 168 169// --------------------------------------------------------------------- 170 171%feature("docstring") OT::GeneralLinearModelResult::getOptimalLogLikelihood 172"Accessor to the optimal log-likelihood of the model. 173 174Returns 175------- 176optimalLogLikelihood : float 177 The value of the log-likelihood corresponding to the model. 178" 179 180// --------------------------------------------------------------------- 181 182