R prototype to assess optimal lag (tau) for time time series forcasting using vicinity information