Compute  the statistical significance of a test statistic at each point
        of the time series by using timeseries boootstrap.

def ts_stats_significance_bootstrap(ts, stats_ts, stats_func, B=1000, b=3):
    """ Compute  the statistical significance of a test statistic at each point
        of the time series by using timeseries boootstrap.
    """
    pvals = []
    for tp in np.arange(0, len(stats_ts)):
        pf = partial(stats_func, t=tp)
        bs = bootstrap_ts(ts, pf, B=B, b=b)
        ci = get_ci(bs, blockratio=b / len(stats_ts))
        pval = abs(get_pvalue(stats_ts[tp], ci))
        pvals.append(pval)
    return pvals