(a, lag)
return np.lib.stride_tricks.as_strided(a, shape=shape, strides=strides)
Convert a into time-lagged vectors

    a    : (n, p)
    lag  : time steps used for prediction

    returns  (n-lag+1, lag, p)  array

    (Building time-lagged vectors is not necessary for neon.)
Convert a into time-lagged vectors
Convert a into time - lagged vectors
def rolling_window(a, lag):
    """
    Convert a into time-lagged vectors

    a    : (n, p)
    lag  : time steps used for prediction

    returns  (n-lag+1, lag, p)  array

    (Building time-lagged vectors is not necessary for neon.)
    """
    assert a.shape[0] > lag

    shape = [a.shape[0] - lag + 1, lag, a.shape[-1]]
    strides = [a.strides[0], a.strides[0], a.strides[-1]]
    return np.lib.stride_tricks.as_strided(a, shape=shape, strides=strides)
def rolling_window ( a , lag ) : assert a . shape [ 0 ] > lag shape = [ a . shape [ 0 ] - lag + 1 , lag , a . shape [ - 1 ] ] strides = [ a . strides [ 0 ] , a . strides [ 0 ] , a . strides [ - 1 ] ] return np . lib . stride_tricks . as_strided ( a , shape = shape , strides = strides )