This file is indexed.

/usr/include/openturns/swig/AdaptiveDirectionalSampling_doc.i is in libopenturns-dev 1.9-5.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
%feature("docstring") OT::AdaptiveDirectionalSampling
"Adaptative directional simulation.

Parameters
----------
event : :class:`~openturns.Event`
    Event we are computing the probability of.
rootStrategy : :class:`~openturns.RootStrategy`, optional
    Strategy adopted to evaluate the intersections of each direction with the
    limit state function and take into account the contribution of the
    direction to the event probability.
    Set to :class:`~openturns.SafeAndSlow` by default.
samplingStrategy : :class:`~openturns.SamplingStrategy`, optional
    Strategy adopted to sample directions.
    Set to :class:`~openturns.RandomDirection` by default.

Notes
-----
Let :math:`\\\\mathcal D_f` denote the failure domain defined as
:math:`\\\\mathcal D_f = \\\\{\\\\ux \\\\in \\\\mathbb R^{n_X} | g(\\\\ux) \\\\leq 0\\\\}`, where
:math:`\\\\ux` are realization of the random vector :math:`\\\\uX` and :math:`g` is the limit-state
function as defined elsewhere in the documentation.

The purpose of the ADS-2 algorithm and its variants is to estimate the
following probability:

.. math::

  P_f = \\\\int_{\\\\mathcal D_f} f_{\\\\uX}(\\\\ux)\\\\di{\\\\ux} \\\\\\\\
      = \\\\int_{\\\\mathbb R^{n_X}} \\\\mathbf{1}_{\\\\{g(\\\\ux) \\\\:\\\\leq 0\\\\: \\\\}}\\\\,f_{\\\\uX}(\\\\ux)\\\\di{\\\\ux} \\\\\\\\
      = \\\\Prob{\\\\{g(\\\\uX) \\\\leq 0\\\\}}.

Principles

The ADS-2 method [Munoz2011]_ combines the stratified and directional sampling concepts.
Stratified sampling consists in splitting the support of the random vector
:math:`\\\\ux` into :math:`m` mutually exclusive and collectively exhaustive subsets.
Here, ADS-2 splits the standard space into :math:`m = 2^d` quadrants, where
:math:`d` is the dimension of the random vector :math:`\\\\uX`.
Stratified sampling is often run in two steps: (i) a learning step is used for
polling the input space and detect the subsets that contribute most to the
probability and (ii) an estimation step is used for estimating
the probability by weighted sampling (some subsets are more sampled than the others).
Directional sampling uses the spheric symmetry of the standard space for
estimating the failure probability as the average of conditional probabilities
calculated on directions drawn at random in the standard space.

The learning step uses an a priori number of random directions that is
uniformly distributed over the quadrants, meaning the weights are as follows:

.. math::

    \\\\omega^1_i = \\\\frac{1}{m}, \\\\quad i = 1, \\\\ldots, m.


Directional sampling is used for estimating the failure probability in each quadrant:

.. math::

    \\\\hat P_i^{DS} = \\\\Prob{\\\\{g(\\\\uX) \\\\leq 0\\\\} \\\\mid \\\\uX \\\\in \\\\mathbb{Q}_i},\\\\,i = 1, \\\\ldots, m.


and the corresponding estimation variances are denoted as :math:`\\\\sigma_i^{DS\\\\,2}`.
These probabilities are estimated using the same number :math:`N^0_i` of random
directions per quadrant as told by the uniform weights distribution.

The probability of interest is then computed as a weighted average of the
previously defined conditional probabilities:

.. math::

    \\\\hat P_f = \\\\sum\\\\limits_{i=1}^m \\\\omega_i \\\\hat P_i^{DS}


where :math:`\\\\hat P_i^{DS}` is the conditional probability estimator in the i-th quadrant. The corresponding variance of the stratified estimator reads:

.. math::

    \\\\sigma^2 = \\\\frac{1}{N_l} \\\\left( \\\\sum\\\\limits_{i=1}^m \\\\omega_i \\\\sigma_i^{DS} \\\\right) ^2


where :math:`\\\\sigma_i^{DS\\\\,2}` is the variance of the conditional probability
estimator in the i-th quadrant.

At the end of the learning step, the weights :math:`\\\\omega_i` are updated so
as to minimize the stratified estimator variance.
Indeed, it can be shown that the updated weights:

.. math::

    \\\\omega^2_i = \\\\frac{\\\\omega^1_i \\\\sigma_i^{DS}}{\\\\sum\\\\limits_{j=1}^m \\\\omega^1_j \\\\sigma_j^{DS}}, i = 1, \\\\ldots, m,


minimize the final estimation variance in \\\\eqref{eq:pf_est_sda2_var}.
Note that some weights might be zero (due to a somewhat arbitrary rounding of
the conditional probabilities' estimation variance). The quadrants associated
with a zero-weight will not be sampled in the estimation step.

Eventually, the estimation step proceeds in essentially the same way as the
learning step with different weights for the quadrants though.
\\\\eqref{eq:pf_est_sda2} and \\\\eqref{eq:pf_est_sda2_var} are used for evaluating
the final probability probability estimate and its variance.

The computational budget per step is parametrized by a fraction
:math:`\\\\gamma_l, l = 1,\\\\,2` of the total budget :math:`N`, such that :math:`\\\\gamma_1 + \\\\gamma_2 = 1`.
The number of directions sampled in quadrant :math:`i` at step :math:`l` is then defined as follows:

.. math::

    N^l_i = N * \\\\gamma_l * \\\\omega_i.


The number of evaluation of the limit-state function :math:`g` is of course
greater than the total budget :math:`N` since directional sampling is used.

Variants

The ADS-2+ variant performs a dimension reduction step after the learning step
for reducing the number of stratified quadrants. The statistic :math:`\\\\tilde T_k`
aggregates the sensitivity of expectation along dimension :math:`k`.
It is defined as follows:

.. math::

    \\\\tilde T_k = \\\\sum\\\\limits_{i_l \\\\in \\\\lbrace -1,1 \\\\rbrace,l \\\\neq k} \\\\lvert \\\\tilde I_{(i_1,\\\\dots,i_{k-1},-1,i_{k+1},\\\\dots,i_p)} - \\\\tilde I_{(i_1,\\\\dots,i_{k-1},1,i_{k+1},\\\\dots,i_p)} \\\\rvert.

It is used for ranking the contributions of the quadrants.
Then, only the :math:`d' < d` most influential variables according to
:math:`\\\\tilde T_k` are stratified, leaving the remaining variables simulated without
stratification. The corresponding quadrants will not be sampled.

The DP-ADS-2 variant combines the ADS method with a rotation of the quadrants.
The idea is to get a possible design point (available e.g. after a
preliminary FORM analysis) on the bisector of one of the quadrants to make the
stratification even more efficient and thus save some evaluations of the model.

This 2-step algorithm can be generalized to :math:`L > 2` steps by adding more
than one learning step. For now, only ADS-2 is implemented.

See also
--------
Simulation"


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

%feature("docstring") OT::AdaptiveDirectionalSampling::getRootStrategy
"Get the root strategy.

Returns
-------
strategy : :class:`~openturns.RootStrategy`
    Root strategy adopted."

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

%feature("docstring") OT::AdaptiveDirectionalSampling::setRootStrategy
"Set the root strategy.

Parameters
----------
strategy : :class:`~openturns.RootStrategy`
    Root strategy adopted."

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

%feature("docstring") OT::AdaptiveDirectionalSampling::getSamplingStrategy
"Get the direction sampling strategy.

Returns
-------
strategy : :class:`~openturns.SamplingStrategy`
    Direction sampling strategy adopted."

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

%feature("docstring") OT::AdaptiveDirectionalSampling::setSamplingStrategy
"Set the direction sampling strategy.

Parameters
----------
strategy : :class:`~openturns.SamplingStrategy`
    Direction sampling strategy adopted."

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

%feature("docstring") OT::AdaptiveDirectionalSampling::setPartialStratification
"Partial stratification accessor.

Parameters
----------
partialStratification : bool
    Partial stratification."

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

%feature("docstring") OT::AdaptiveDirectionalSampling::getPartialStratification
"Partial stratification accessor.

Returns
-------
partialStratification : bool
    Partial stratification."

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

%feature("docstring") OT::AdaptiveDirectionalSampling::setQuadrantOrientation
"Quadrant orientation accessor.

Parameters
----------
orientation : sequence of float
    Quadrant orientation."

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

%feature("docstring") OT::AdaptiveDirectionalSampling::getQuadrantOrientation
"Quadrant orientation accessor.

Returns
-------
orientation : :class:`~openturns.Point`
    Quadrant orientation."

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

%feature("docstring") OT::AdaptiveDirectionalSampling::setMaximumStratificationDimension
"Maximum stratification dimension accessor.

Parameters
----------
max : int
    Maximum stratification dimension."

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

%feature("docstring") OT::AdaptiveDirectionalSampling::getMaximumStratificationDimension
"Maximum stratification dimension accessor.

Returns
-------
max : int
    Maximum stratification dimension."

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

%feature("docstring") OT::AdaptiveDirectionalSampling::setGamma
"Gamma accessor.

The computational budget per step :math:`\\\\gamma_l`.

Parameters
----------
gamma : sequence of float
    Gamma value."

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

%feature("docstring") OT::AdaptiveDirectionalSampling::getGamma
"Gamma accessor.

The computational budget per step :math:`\\\\gamma_l`.

Returns
-------
gamma : :class:`~openturns.Point`
    Gamma value."

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

%feature("docstring") OT::AdaptiveDirectionalSampling::getTStatistic
"T statistic accessor.

The statistic :math:`\\\\tilde T_k` aggregates the sensitivity of expectation.

Returns
-------
gamma : :class:`~openturns.Point`
    T statistic value."