def ppd(likelihood, prior, log=True):
    """
    Compute the (non-normalized) (log)posterior
    probability distribution given the (log)likelihood
    and the (log)prior probability distribution.
    
    Parameters
    ----------
    likelihood : float or array_like
        the (log)likelihood function
    prior : float or array_like
        the (log)prior probability distribution
    log : bool
         Must be True if log-likelihood and
         log-prior are given
    
    """
    if log:
        return prior + likelihood
    else:
        return prior * likelihood