.. _method-bayes_calibration-posterior_stats-mutual_info:

"""""""""""
mutual_info
"""""""""""


Calculate the mutual information between prior and posterior


.. toctree::
   :hidden:
   :maxdepth: 1

   method-bayes_calibration-posterior_stats-mutual_info-ksg2


**Specification**

- *Alias:* None

- *Arguments:* None


**Child Keywords:**

+-------------------------+--------------------+--------------------+-----------------------------------------------+
| Required/Optional       | Description of     | Dakota Keyword     | Dakota Keyword Description                    |
|                         | Group              |                    |                                               |
+=========================+====================+====================+===============================================+
| Optional                                     | `ksg2`__           | Use second Kraskov algorithm to compute       |
|                                              |                    | mutual information                            |
+----------------------------------------------+--------------------+-----------------------------------------------+

.. __: method-bayes_calibration-posterior_stats-mutual_info-ksg2.html



**Description**


The mutual information quantifies how much information two random variables
contain about each other. It is a measure of the mutual dependence of two
random variables. The mutual information is a non-negative measure, with zero
representing complete independence of the two random variables. For continuous
random variables :math:`X`  and :math:`Y` , the mutual information is


.. math:: 

   I(X,Y) = \int \int p(x,y) \log \frac{ p(x,y) }{ p(x)p(y) } dx dy.

The mutual information can also be interpreted as the reduction in
uncertainty of one random variable due to the knowledge of another. By
specifying, ``mutual_info``, the mutual information between the posterior
parameters and the prior parameters is calculated.

The mutual information is calculated using a :math:`k` -nearest neighbor
approximation algorithm. As of Dakota 6.6, there are two such algorithms
available, both of which are derived in :cite:p:`Kra04` . By default, Dakota uses
the first such algorithm; the second may be selected by specifying the keyword
``ksg2``. Further details can be found in the :ref:`theory section <uq:bayes_experimental_design>`
section of the User's Guide.

*Expected Output*

If ``mutual_information`` is specified, the calculated value will be reported
to the screen at the end of the calibration.

*Additional Discussion*

Due to the necessary approximation of the multidimensional integral above, a
negative mutual information may be reported for applications whose true value
is close to or equal to zero.
As of Dakota 6.6, mutual information calculations are primarily used in the
implementation of the :dakkw:`method-bayes_calibration-experimental_design`
algorithm.


