def compare_actual_and_theoretical_cvd(actual_cvd, theoretical_cvd):
    """Compare actual to theoretical distribution

    Args:
        actual_cvd: Output of comparison_vector_distribution()
        theoretical_cvd: Output of  get_theoretical_comparison_vector_distribution()

    Returns:
        Pandas dataframe comparing actual to theoretical distribution
    """
    theoretical_cvd = theoretical_cvd[["gam_concat", "count"]].copy()
    theoretical_cvd = theoretical_cvd.rename(columns={"count": "count_theoretical"})

    actual_cvd = actual_cvd.rename(columns={"count": "count_actual"})

    merged = actual_cvd.merge(
        theoretical_cvd, left_on="gam_concat", right_on="gam_concat"
    )

    merged["count_diff"] = merged["count_actual"] - merged["count_theoretical"]
    return merged