This file is indexed.

/usr/include/openturns/swig/MCMC_doc.i is in libopenturns-dev 1.5-7build2.

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
%feature("docstring") OT::MCMC
"Monte-Carlo Markov Chain.

Available constructor:
    MCMC(*prior, conditional, observations, initialState*)

    MCMC(*prior, conditional, model, parameters, observations, initialState*)

Parameters
----------
prior : :class:`~openturns.Distribution`
    Prior distribution of the parameters of the underlying Bayesian statistical
    model.
conditional : :class:`~openturns.Distribution`
    Required distribution to define the likelihood of the underlying Bayesian
    statistical model.
model : :class:`~openturns.NumericalMathFunction`
    Function required to define the likelihood.
observations : 2D float sequence
    Observations required to define the likelihood.
initialState : float sequence
    Initial state of the Monte-Carlo Markov chain on which the Sampler is
    based.
parameters : 2D float sequence
    Parameters of the model to be fixed.

Notes
-----
MCMC provides a implementation of the concept of sampler, using a Monte-Carlo
Markov Chain (MCMC) algorithm starting from *initialState*. More precisely,
let :math:`t(.)` be the PDF of its target distribution and :math:`d_{\\\\theta}`
its dimension, :math:`\\\\pi(.)` be the PDF of the *prior* distribution,
:math:`f(.|\\\\vect{w})` be the PDF of the *conditional* distribution
when its parameters are set to :math:`\\\\vect{w}`, :math:`d_w` be the number of
scalar parameters of *conditional* distribution (which corresponds to the
dimension of the above :math:`\\\\vect{w}`), :math:`g(.)` be the function
corresponding to model and :math:`(\\\\vect{y}^1, \\\\dots, \\\\vect{y}^n)` be the
sample *observations* (of size :math:`n`):

In the first usage, it creates a sampler based on a MCMC algorithm whose target
distribution is defined by:

.. _PDF_target_formula:

.. math::

    t(\\\\vect{\\\\theta})
    \\\\quad \\\\propto \\\\quad
    \\\\underbrace{~\\\\pi(\\\\vect{\\\\theta})~}_{\\\\mbox{prior}} \\\\quad
    \\\\underbrace{~\\\\prod_{i=1}^n f(\\\\vect{y}^i|\\\\vect{\\\\theta})~}_{\\\\mbox{likelihood}}


In the first usage, it creates a sampler based on a MCMC algorithm whose target
distribution is defined by:

.. _second_PDF_target_formula:

.. math::

    t(\\\\vect{\\\\theta})
    \\\\quad \\\\propto \\\\quad
    \\\\underbrace{~\\\\pi(\\\\vect{\\\\theta})~}_{\\\\mbox{prior}} \\\\quad
    \\\\underbrace{~\\\\prod_{i=1}^n f(\\\\vect{y}^i|g^i(\\\\vect{\\\\theta}))~}_{\\\\mbox{likelihood}}

where the :math:`g^i: \\\\Rset^{d_{\\\\theta}} \\\\rightarrow\\\\Rset^{d_w}`
(:math:`1\\\\leq{}i\\\\leq{}n`) are such that:

.. math::

    \\\\begin{array}{rcl}
        g:\\\\Rset^{d_\\\\theta} & \\\\longrightarrow & \\\\Rset^{n\\\\,d_w}\\\\\\\\
        \\\\vect{\\\\theta} & \\\\longmapsto &
        g(\\\\vect{\\\\theta}) = \\\\Tr{(\\\\Tr{g^1(\\\\vect{\\\\theta})}, \\\\cdots, \\\\Tr{g^n(\\\\vect{\\\\theta})})}
        \\\\end{array}

In fact, the first usage is a particular case of the second.


The MCMC method implemented in OpenTURNS is the Random Walk Metropolis-Hastings
algorithm. A sample can be generated only through the MCMC's derived class:
:class:`~openturns.RandomWalkMetropolisHastings`."

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

%feature("docstring") OT::MCMC::computeLogLikelihood
"Compute the logarithm of the likelihood w.r.t. observations.

Parameters
----------
currentState : float sequence
    Current state.

Returns
-------
logLikelihood : float
    Logarithm of the likelihood w.r.t. observations
    :math:`(\\\\vect{y}^1, \\\\dots, \\\\vect{y}^n)`."

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

%feature("docstring") OT::MCMC::getBurnIn
"Get the length of the burn-in period.

Returns
-------
lenght : int
    Length of the burn-in period, that is the number of first iterates of the
    MCMC chain which will be thrown away when generating the sample."

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

%feature("docstring") OT::MCMC::setBurnIn
"Set the length of the burn-in period.

Parameters
----------
lenght : int
    Length of the burn-in period, that is the number of first iterates of the
    MCMC chain which will be thrown away when generating the sample."

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

%feature("docstring") OT::MCMC::getConditional
"Get the *conditional* distribution.

Returns
-------
conditional : :class:`~openturns.Distribution`
    Distribution taken into account in the definition of the likelihood, whose
    PDF with parameters :math:`\\\\vect{w}` corresponds to :math:`f(.|\\\\vect{w})`
    in the equations of the
    :ref:`target distribution's PDF <PDF_target_formula>`."

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

%feature("docstring") OT::MCMC::getModel
"Get the model.

Returns
-------
model : :class:`~openturns.NumericalMathFunction`
    Model take into account in the definition of the likelihood, which
    corresponds to :math:`g`, that is the functions :math:`g^i`
    (:math:`1\\\\leq i \\\\leq n`) in the equation of the
    :ref:`target distribution's PDF <second_PDF_target_formula>`."

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

%feature("docstring") OT::MCMC::getObservations
"Get the observations.

Returns
-------
observations : 2D float sequence
    Sample taken into account in the definition of the likelihood, which
    corresponds to the :math:`n`-tuple of the :math:`\\\\vect{y}^i`
    (:math:`1\\\\leq i \\\\leq n`) in equations of the
    :ref:`target distribution's PDF <PDF_target_formula>`."

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

%feature("docstring") OT::MCMC::setObservations
"Set the observations.

Parameters
----------
observations : 2D float sequence
    Sample taken into account in the definition of the likelihood, which
    corresponds to the :math:`n`-tuple of the :math:`\\\\vect{y}^i`
    (:math:`1\\\\leq i \\\\leq n`) in the equations of the
    :ref:`target distribution's PDF <PDF_target_formula>`."

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

%feature("docstring") OT::MCMC::getParameters
"Get the parameters.

Returns
-------
parameters : float sequence
    Fixed parameters of the model :math:`g` required to define the likelihood."

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

%feature("docstring") OT::MCMC::setParameters
"Set the parameters.

Parameters
----------
parameters : float sequence
    Fixed parameters of the model :math:`g` required to define the likelihood."

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

%feature("docstring") OT::MCMC::getPrior
"Get the *prior* distribution.

Returns
-------
prior : :class:`~openturns.Distribution`
    The prior distribution of the parameter of the underlying Bayesian
    statistical model, whose PDF corresponds to :math:`\\\\pi` in the equations of
    the :ref:`target distribution's PDF <PDF_target_formula>`."

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

%feature("docstring") OT::MCMC::setPrior
"Set the *prior* distribution.

Parameters
----------
prior : :class:`~openturns.Distribution`
    The prior distribution of the parameter of the underlying Bayesian
    statistical model, whose PDF corresponds to :math:`\\\\pi` in the equations of
    the :ref:`target distribution's PDF <PDF_target_formula>`."

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

%feature("docstring") OT::MCMC::getThinning
"Get the thinning parameter.

Returns
-------
thinning : integer
    Thinning parameter: storing only every :math:`k^{th}` point after the
    burn-in period.

Notes
-----
When generating a sample of size :math:`q`, the number of MCMC iterations
performed is :math:`l+1+(q-1)k` where :math:`l` is the burn-in period length
and :math:`k` the thinning parameter."

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

%feature("docstring") OT::MCMC::setThinning
"Set the thinning parameter.

Parameters
----------
thinning : integer, :math:`k \\\\geq 0`
    Thinning parameter: storing only every :math:`k^{th}` point after the
    burn-in period.

Notes
-----
When generating a sample of size :math:`q`, the number of MCMC iterations
performed is :math:`l+1+(q-1)k` where :math:`l` is the burn-in period length
and :math:`k` the thinning parameter."