def param_squared_mean(ns_run, logw=None, simulate=False, param_ind=0):
    "Mean of the square of single parameter (second moment of its\n    posterior distribution).\n\n    Parameters\n    ----------\n    ns_run: dict\n        Nested sampling run dict (see the data_processing module\n        docstring for more details).\n    logw: None or 1d numpy array, optional\n        Log weights of samples.\n    simulate: bool, optional\n        Passed to ns_run_utils.get_logw if logw needs to be\n        calculated.\n    param_ind: int, optional\n        Index of parameter for which the second moment should be\n        calculated. This corresponds to the column of ns_run['theta']\n        which contains the parameter.\n\n    Returns\n    -------\n    float\n    "
    if (logw is None):
        logw = nestcheck.ns_run_utils.get_logw(ns_run, simulate=simulate)
    w_relative = np.exp((logw - logw.max()))
    w_relative /= np.sum(w_relative)
    return np.sum((w_relative * (ns_run['theta'][:, param_ind] ** 2)))
Mean of the square of single parameter (second moment of its
posterior distribution).

Parameters
----------
ns_run: dict
    Nested sampling run dict (see the data_processing module
    docstring for more details).
logw: None or 1d numpy array, optional
    Log weights of samples.
simulate: bool, optional
    Passed to ns_run_utils.get_logw if logw needs to be
    calculated.
param_ind: int, optional
    Index of parameter for which the second moment should be
    calculated. This corresponds to the column of ns_run['theta']
    which contains the parameter.

Returns
-------
float
def param_squared_mean(ns_run, logw=None, simulate=False, param_ind=0):
    "Mean of the square of single parameter (second moment of its\n    posterior distribution).\n\n    Parameters\n    ----------\n    ns_run: dict\n        Nested sampling run dict (see the data_processing module\n        docstring for more details).\n    logw: None or 1d numpy array, optional\n        Log weights of samples.\n    simulate: bool, optional\n        Passed to ns_run_utils.get_logw if logw needs to be\n        calculated.\n    param_ind: int, optional\n        Index of parameter for which the second moment should be\n        calculated. This corresponds to the column of ns_run['theta']\n        which contains the parameter.\n\n    Returns\n    -------\n    float\n    "
    if (logw is None):
        logw = nestcheck.ns_run_utils.get_logw(ns_run, simulate=simulate)
    w_relative = np.exp((logw - logw.max()))
    w_relative /= np.sum(w_relative)
    return np.sum((w_relative * (ns_run['theta'][:, param_ind] ** 2)))