hyppo/time_series/_utils.py
def compute_scale_at_lag(x, y, opt_lag, compute_distance, **kwargs):
    """Run the mgc test at the optimal scale (by shifting the series)."""
    n = x.shape[0]
    if not compute_distance:
        compute_distance = "precomputed"
    distx, disty = compute_dist(x, y, metric=compute_distance, **kwargs)

    slice_distx = distx[opt_lag:n, opt_lag:n]
    slice_disty = disty[0 : (n - opt_lag), 0 : (n - opt_lag)]

    mgc = MGC()
    with warnings.catch_warnings():
        warnings.filterwarnings("ignore")
        opt_scale = mgc.test(slice_distx, slice_disty, reps=0)[2]["opt_scale"]

    return opt_scale
Run the mgc test at the optimal scale (by shifting the series).
Run the mgc test at the optimal scale (by shifting the series).
Run the mgc test at the optimal scale ( by shifting the series ) .
def compute_scale_at_lag(x, y, opt_lag, compute_distance, **kwargs):
    n = x.shape[0]
    if not compute_distance:
        compute_distance = "precomputed"
    distx, disty = compute_dist(x, y, metric=compute_distance, **kwargs)
    slice_distx = distx[opt_lag:n, opt_lag:n]
    slice_disty = disty[0 : (n - opt_lag), 0 : (n - opt_lag)]
    mgc = MGC()
    with warnings.catch_warnings():
        warnings.filterwarnings("ignore")
        opt_scale = mgc.test(slice_distx, slice_disty, reps=0)[2]["opt_scale"]
    return opt_scale
def compute_scale_at_lag ( x , y , opt_lag , compute_distance , ** kwargs ) : n = x . shape [ 0 ] if not compute_distance : compute_distance = "precomputed" distx , disty = compute_dist ( x , y , metric = compute_distance , ** kwargs ) slice_distx = distx [ opt_lag : n , opt_lag : n ] slice_disty = disty [ 0 : ( n - opt_lag ) , 0 : ( n - opt_lag ) ] mgc = MGC ( ) with warnings . catch_warnings ( ) : warnings . filterwarnings ( "ignore" ) opt_scale = mgc . test ( slice_distx , slice_disty , reps = 0 ) [ 2 ] [ "opt_scale" ] return opt_scale
Run the mgc test at the optimal scale (by shifting the series).
Run the mgc test at the optimal scale ( by shifting the series ) .
"""Run the mgc test at the optimal scale (by shifting the series)."""
x
y
opt_lag
compute_distance