def margins_to_dict(margins):
    """Convert the margin's informations into a dictionary.

    Parameters
    ----------
    margins : the list of OpenTurns distributions
        The marginal distributions of the input variables.

    Returns
    -------
    margin_dict : dict
        The dictionary with the information of each marginal.
    """
    margin_dict = {}
    for i, marginal in enumerate(margins):
        margin_dict[i] = {}
        name = marginal.getName()
        params = list(marginal.getParameter())
        if name == 'TruncatedDistribution':
            margin_dict[i]['Type'] = 'Truncated'
            in_marginal = marginal.getDistribution()
            margin_dict[i]['Truncated Parameters'] = params
            name = in_marginal.getName()
            params = list(in_marginal.getParameter())
        else:
            margin_dict[i]['Type'] = 'Standard'

        margin_dict[i]['Marginal Family'] = name
        margin_dict[i]['Marginal Parameters'] = params
    return margin_dict