In the previous section a method is presented which allows the computation of the maximum posterior probability estimate
. As measurement data are limited and noise corrupted this estimate will not be the true parameter density. Hence, the uncertainty of the parameter density has to be evaluated.
Sampling of posterior probability density
In order to analyze the uncertainty of the estimate, a sample of the posterior probability density
is generated. This is possible, as the unnormalized posterior probability of a distribution
can be evaluated efficiently given (24)  (28). In this work the sampling is performed with a classical MetropolisHastings method [19]. Also Gibbs or slice sampling approaches may be employed. Compared to importance and rejection sampling these methods are well suited as they do not require the selection of an appropriate proposal density, a task which is difficult in this case.
The main point of concern when using MCMC sampling for the problem at hand is that the prior probability and the posterior probability respectively are only nonzero on a (n
_{
φ
} 1) dimensional subset of the density parameter space (28). This is due to the fact that the sum over the elements of φ has to be one for Θ_{
φ
} being a probability density. If a standard proposal step was used, the acceptance rate would have been zero.
This problem can be overcome by performing the sampling in the (n
_{
φ
} 1)dimensional space,
, and computing the remaining density parameter via the closing condition
. According to this the update step for φ consists of two steps:
1. Draw proposals
from the (
n
_{
φ
} 1)dimensional reduced proposal density
T
_{
r
},
2. Determine
such that
,
In this work, the reduced proposal density is chosen to be a multivariate normal distribution,
, with covariance matrix
.
This twostep proposal generation procedure is in the following denoted by
φ
^{k+1}~
T(
φ
^{k+1}
φ
^{
k
}). The proposed density parameter vector
φ
^{k+1 }is accepted with probability
The distinction of the two cases is hereby crucial to ensure that only probability densities
which are greater than zero for all
are accepted.
By combining update and acceptance step one obtains an algorithm which draws a sample of weighting vectors
, or respectively parameter densities
, from the posterior distribution. The number of sample members is thereby S
_{
φ
}. The pseudo code for the routine is given in Algorithm 1. In particular, the facts that

the conditional probabilities
are only computed once in the beginning, and that

every evaluation of the acceptance probability p
_{
a
}requires only a small number of algebraic operations,
ensure hereby an efficient sampling. Without this reformulation the integral defining the conditional probability
would have to be computed in each update step. The resulting computational effort would be very large.
Algorithm 1 Sampling of posteriori distribution
Require: data
, prior p(Θ_{
φ
}), model p(yθ ), ansatz functions
, initial point φ
^{0}.
Calculation of conditional probabilities
employing p(yθ ).
Initialize the Markov Chain with φ
^{0}.
for
k = 1 to S
_{
φ
}
do
Given φ
^{
i
} propose φ
^{k+1 }from proposal density T (φ
^{k+1}φ
^{
k
}).
Calculate posterior probability
.
Generate uniformly distributed random number r ∈ [0,1].
if
r < p
_{
a
}(φ
^{k+1}φ
^{
k
}) then
Accept proposed parameter vector φ
^{k+1}.
else
Restore previous parameter vector, φ
^{k+1 }= φ
^{
k
}.
end if
end for
end
Bayesian confidence intervals
The sample
generated by Algorithm 1 contains information about the shape of the posterior density
. This information can be employed to determine the Bayesian confidence intervals, also called credible intervals.
In this work an approach is presented which employs the percentile method [17] to analyze the uncertainty of Θ_{
φ
}. The 100αth percentile of a random variable r is the value
below which 100α % of the observations fall. Accordingly, the 100(1α)th percentile interval of r is defined as
. The Bayesian confidence interval is frequently defined as the 95th percentile interval [18]. Thus, the parameter is contained in
with a probability of 95% given the measurement data and the prior knowledge.
For the problem of estimating parameter densities, the 100
αth percentile is not simply a number but a function. As we are interested in the confidence intervals of Θ
_{
φ
}(
θ), the percentiles are defined pointwise for every
θ. The 100
αth percentile of Θ
_{
φ
}(
θ) is thus the function
which gives for every parameter vector
θ the value under which 100
α % of the observations fall,
Consequently, the 100(1
α)% Bayesian confidence interval
of Θ
_{
φ
}(
θ) is defined as
As the sample
is given, an approximation of
and
can be obtained by studying the percentiles of the sample [26]. For instance the nearest rank method or linear interpolation between closest ranks can be used to determine
.