def effective_prior(p_tar, c_miss, c_fa):
    """This function adjusts a given prior probability of target p_targ,
    to incorporate the effects of a cost of miss, cmiss, and a cost of false-alarm, cfa.

    Args:
       p_tar: target prior
       c_miss: cost of miss
       c_fa: cost of false alarm
    Returns:
       Effective prior

    """
    beta = p_tar * c_miss / (1 - p_tar) / c_fa
    p_eff = beta / (1 + beta)
    return p_eff