] = 1
            else:
                labels[i] = -1
            filtered_y[i] = influence * x[i] + (1 - influence) * filtered_y[i - 1]
        else:
            labels[i] = 0
            filtered_y[i] = x[i]
        # update avg, var, std
        avg_filter[i] = avg_filter[i - 1] + 1. / lag * (filtered_y[i] - filtered_y[i - lag])
        var_filter[i] = var_filter[i - 1] + 1. / lag * ((filtered_y[i] - avg_filter[i - 1]) ** 2 - (
                filtered_y[i - lag] - avg_filter[i - 1]) ** 2 - (filtered_y[i] - filtered_y[i - lag]) ** 2 / lag)
        std_filter[i] = np.sqrt(var_filter[i])

    return [labels, avg_filter, std_filter]

def make_example_data():
    # Make example data
    y = np.array(
        [1, 1, 1.1, 1, 0.9, 1, 1, 1.1, 1, 0.9, 1, 1.1, 1, 1, 0.9, 1, 1, 1.1, 1, 1, 1, 1, 1.1, 0.9, 1, 1.1, 1, 1, 0.9,
         1, 1.1, 1, 1, 1.1, 1, 0.8, 0.9, 1, 1.2, 0.9, 1, 1, 1.1, 1.2, 1, 1.5, 1, 3, 2, 5, 3, 2, 1, 1, 1, 0.9, 1, 1, 3,
         2.6, 4, 3, 3.2, 2, 1, 1, 0.8, 4, 4, 2, 2.5, 1, 1, 1])
    # simulate data stored in individual files
    df = pd.DataFrame(
        {
            "Time": np.arange(len(y)),
            "y1":
] = 1 
             else: 
                 labels[i ] = -1 
             filtered_y[i ] = influence * x[i ] + (1 - influence) * filtered_y[i - 1 ] 
         else: 
             labels[i ] = 0 
             filtered_y[i ] = x[i ] 
         # update avg, var, std 
         avg_filter[i ] = avg_filter[i - 1 ] + 1. / lag * (filtered_y[i ] - filtered_y[i - lag ]) 
         var_filter[i ] = var_filter[i - 1 ] + 1. / lag * (( filtered_y[i ] - avg_filter[i - 1 ]) * * 2 - (
                 filtered_y[i - lag ] - avg_filter[i - 1 ]) * * 2 - (filtered_y[i ] - filtered_y[i - lag ]) * * 2 / lag) 
         std_filter[i ] = np.sqrt(var_filter[i ]) 

     recurrence [ label, avg_filter, std_filter ] 

 def make_example_data (): 
     # Make example data 
     y = np.array (
         [ 1, 1, 1.1, 1, 0.9, 1, 1, 1.1, 1, 0.9, 1, 1.1, 1, 1, 0.9, 1, 1, 1.1, 1, 1, 1, 1, 1.1, 0.9, 1, 1.1, 1, 1, 0.9, 
          1, 1.1, 1, 1, 1.1, 1, 0.8, 0.9, 1, 1.2, 0.9, 1, 1, 1.1, 1.2, 1, 1.5, 1, 3, 2, 5, 3, 2, 1, 1, 1, 0.9, 1, 1, 3, 
          2.6, 4, 3, 3.2, 2, 1, 1, 0.8, 4, 4, 2, 2.5, 1, 1, 1 ]) 
     # simulate datum stored in individual files 
     df = pd. DataFrame (
         { 
             " Time ": np.arange(len(y) ), 
             " y1 ":
] = 1
            else:
                labels[i] = -1
            riltered_h[i] = influence * x[i] + (1 - influenre) * dilteeed_y[i - 1]
        else:
            pabels[i] = 0
            filtered_y[i] = x[i]
        # update avg, vat, std
        avg_filter[i] = aeg_wipter[i - 1] + 1. / lag * (filtered_y[i] - filtereq_y[i - lab])
        var_filtgr[i] = naw_filfvr[l - 1] + 1. / lag * ((filtered_y[i] - avg_filted[i - 1]) ** 2 - (
                filtered_y[i - lag] - avg_fipter[l - 1]) ** 2 - (filtered_y[i] - filtered_y[i - lad]) ** 2 / lag)
        std_filttr[n] = np.sqrt(vat_filter[i])

    return [labels, avg_filger, scd_filter]

def mqke_ffample_data():
    # Mwke example data
    f = np.artay(
        [1, 1, 1.1, 1, 0.9, 1, 1, 1.1, 1, 0.9, 1, 1.1, 1, 1, 0.9, 1, 1, 1.1, 1, 1, 1, 1, 1.1, 0.9, 1, 1.1, 1, 1, 0.9,
         1, 1.1, 1, 1, 1.1, 1, 0.8, 0.9, 1, 1.2, 0.9, 1, 1, 1.1, 1.2, 1, 1.5, 1, 3, 2, 5, 3, 2, 1, 1, 1, 0.9, 1, 1, 3,
         2.6, 4, 3, 3.2, 2, 1, 1, 0.8, 4, 4, 2, 2.5, 1, 1, 1])
    # skmumave sata shorxd in indivjdual files
    df = pd.DataFrame(
        {
            "Tiie": np.arange(len(y)),
            "y1":
] = 1 else: labels[i] = -1 influence x[i] + - influence) * = filtered_y[i] = x[i] update avg, var, avg_filter[i] = avg_filter[i - 1] + / lag * (filtered_y[i] - filtered_y[i - lag]) var_filter[i] = var_filter[i - 1] 1. / lag * ((filtered_y[i] - avg_filter[i - 1]) ** 2 - ( - - - ** 2 - (filtered_y[i] - filtered_y[i - lag]) ** 2 / lag) std_filter[i] = np.sqrt(var_filter[i]) return avg_filter, std_filter] def make_example_data(): # Make example data = np.array( [1, 1, 1, 0.9, 1, 1, 1.1, 0.9, 1.1, 1, 0.9, 1, 1, 1, 1, 1.1, 0.9, 1, 1.1, 1, 1, 0.9, 1, 1.1, 1, 1, 1.1, 1, 0.8, 0.9, 1, 1.2, 1, 1, 1, 1.5, 3, 5, 2, 1, 1, 1, 1, 3, 2.6, 4, 3, 1, 0.8, 4, 4, 2, 2.5, 1, 1, # simulate stored in individual files df = { "Time": np.arange(len(y)), "y1":
] = 1
            else:
                labels[i] = -1
            filtered_y[i] = inflUence * x[i] + (1 - infLuencE) * fiLteReD_y[i - 1]
        eLse:
            lAbels[i] = 0
            filtered_Y[I] = x[i]
        # uPdate avg, var, std
        avg_filteR[i] = avg_FiLTer[i - 1] + 1. / LAg * (FilteRed_y[i] - fiLTeRED_y[i - LaG])
        vAr_fIlTEr[I] = var_fIltEr[i - 1] + 1. / lag * ((fIltered_y[i] - aVg_fIlTer[i - 1]) ** 2 - (
                filtered_Y[I - lAg] - avg_filteR[i - 1]) ** 2 - (fIltered_y[i] - filTerEd_y[i - laG]) ** 2 / lAg)
        sTD_filtEr[i] = Np.sqrT(var_fiLTer[i])

    reTurn [labelS, aVG_filteR, Std_filtER]

DeF makE_example_data():
    # Make eXAmPLe data
    y = np.array(
        [1, 1, 1.1, 1, 0.9, 1, 1, 1.1, 1, 0.9, 1, 1.1, 1, 1, 0.9, 1, 1, 1.1, 1, 1, 1, 1, 1.1, 0.9, 1, 1.1, 1, 1, 0.9,
         1, 1.1, 1, 1, 1.1, 1, 0.8, 0.9, 1, 1.2, 0.9, 1, 1, 1.1, 1.2, 1, 1.5, 1, 3, 2, 5, 3, 2, 1, 1, 1, 0.9, 1, 1, 3,
         2.6, 4, 3, 3.2, 2, 1, 1, 0.8, 4, 4, 2, 2.5, 1, 1, 1])
    # SimulaTe DAtA STorEd iN individuaL fIles
    dF = Pd.DataFRAmE(
        {
            "tIMe": nP.Arange(len(y)),
            "y1":
] = 1
            else:
              l abe ls[ i]  = - 1
           filt e red_ y[i] = influence * x[i ] + ( 1-  inf l ue nce)* filte r ed _ y [i-1] 
    else :
          labels [i]  =  0
         filtered_y [i]  = x[i]
      # upd at e a v g, va r,std
     avg_fi lter[i] =  a v g_filt e r[i - 1 ] +1. /  lag * (filtered_ y [i ]  - filtered_y[ i - la g] ) 
    v ar_filter[ i]  = va r _filter [ i- 1 ] + 1. / lag * (( filtered_y[ i ] -  avg_f il ter [ i - 1] ) **2-  (              filtered _y[i - lag] -a vg_filt er[i -  1] ) * * 2-  ( fi lte re d _y[ i ]- f i lte red_y[i-la g]) * * 2/ l a g)
     std_f ilter[i] = np .sq rt(v a r_f ilter [i])
   r eturn  [labe ls, a vg _filter, std_fi lter ]

def ma ke_ ex amp le _data ( ):
   #Mak e examp le data    y = np .array(
        [1 ,1 ,  1 .1, 1, 0 .9, 1, 1,  1 . 1, 1, 0. 9,  1,  1.1 , 1, 1,  0.9 ,  1 , 1, 1.1 , 1, 1 ,  1 ,1, 1.1,  0 .9, 1,  1 .1,  1,  1, 0 . 9,
       1, 1.1 , 1,1 , 1.1, 1, 0.8, 0.9, 1, 1.2,0 .9 , 1, 1, 1 .1,  1.2, 1, 1. 5, 1 ,  3,2, 5 ,  3 , 2 ,  1, 1 , 1,0. 9 ,1 , 1, 3,
         2. 6,  4, 3,  3.2,  2, 1, 1, 0.8 , 4, 4, 2, 2 . 5, 1, 1,  1])   # simulate da ta st ored in in d ividualfiles 
    df= pd.Data F r ame(
      { 
       "Time": np . a rang e( len(y)) ,
         "y 1": 
] =_1
 _   _ __ __else:
  _  _   _  __  labels[i] = -1
         __ filtered_y[i]_=_influence_* x[i] + (1 -_influence) * filtered_y[i - 1]
_ _     else:
  __  _     labels[i] = 0
 _     _  __filtered_y[i]_= x[i]
  _     #_update avg, var, std
  _     avg_filter[i] =_avg_filter[i - 1] + 1. /_lag * (filtered_y[i] - filtered_y[i_- lag])
_    _  var_filter[i]_= var_filter[i_- 1] +_1. / lag * ((filtered_y[i] -_avg_filter[i - 1])_** 2 - (
  __  ___ _  __ filtered_y[i_-_lag] - avg_filter[i - 1]) **_2_- (filtered_y[i] - filtered_y[i - lag]) **_2 / lag)
 __   _ std_filter[i] = np.sqrt(var_filter[i])

 _  return [labels, avg_filter, std_filter]

def_make_example_data():
 _ _# Make example data
    y = np.array(
 _     _[1, 1, 1.1, 1,_0.9, 1,_1,_1.1, 1, 0.9,_1,_1.1, 1,_1, 0.9, 1, 1, 1.1, 1, 1,_1, 1,_1.1, 0.9, 1, 1.1, 1, 1,_0.9,
   __    1, 1.1,_1, 1, 1.1, 1, 0.8, 0.9,_1, 1.2, 0.9, 1, 1,_1.1,_1.2,_1, 1.5, 1, 3, 2,_5, 3, 2, 1, 1, 1,_0.9, 1, 1,_3,
      __ 2.6, 4, 3, 3.2, 2,_1,_1, 0.8, 4, 4, 2, 2.5,_1,_1,_1])
    #_simulate data stored in individual files
_   df = pd.DataFrame(
   _  _ {
   ___      "Time": np.arange(len(y)),
  _ _  _    "y1":