Module Assign NameStore Str Import alias identifier ImportFrom alias Import alias identifier ImportFrom alias Import alias FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad keyword AttributeLoad NameLoad attr For NameStore Call NameLoad NameLoad body AugAssignAdd SubscriptStore NameLoad Index TupleLoad Num Num BinOpPow BinOpSub SubscriptLoad NameLoad Index TupleLoad Num NameLoad SubscriptLoad NameLoad Index TupleLoad Num NameLoad Num Assign SubscriptStore NameLoad Index TupleLoad Num Num Num For NameStore Call NameLoad Num NameLoad body Assign NameStore Num For NameStore Call NameLoad NameLoad body AugAssignAdd NameStore BinOpPow BinOpSub SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad Num NameLoad Num Assign SubscriptStore NameLoad Index TupleLoad NameLoad Num BinOpAdd SubscriptLoad NameLoad Index TupleLoad BinOpSub NameLoad Num Num NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad Num Num For NameStore Call NameLoad Num NameLoad body Assign NameStore Num For NameStore Call NameLoad NameLoad body AugAssignAdd NameStore BinOpPow BinOpSub SubscriptLoad NameLoad Index TupleLoad Num NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Num Assign SubscriptStore NameLoad Index TupleLoad Num NameLoad BinOpAdd SubscriptLoad NameLoad Index TupleLoad Num BinOpSub NameLoad Num NameLoad Assign SubscriptStore NameLoad Index TupleLoad Num NameLoad Num For NameStore Call NameLoad Num Call NameLoad NameLoad body For NameStore Call NameLoad Num Call NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Index TupleLoad BinOpSub NameLoad Num BinOpSub NameLoad Num Assign NameStore SubscriptLoad NameLoad Index TupleLoad NameLoad BinOpSub NameLoad Num Assign NameStore SubscriptLoad NameLoad Index TupleLoad BinOpSub NameLoad Num NameLoad If CompareLt NameLoad NameLoad body If CompareLt NameLoad NameLoad body Assign NameStore Num Assign NameStore NameLoad orelse Assign NameStore Num Assign NameStore NameLoad orelse If CompareLt NameLoad NameLoad body Assign NameStore Num Assign NameStore NameLoad orelse Assign NameStore Num Assign NameStore NameLoad Assign NameStore Num For NameStore Call NameLoad NameLoad body AugAssignAdd NameStore BinOpPow BinOpSub SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Num Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpAdd NameLoad NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad NameLoad Return TupleLoad SubscriptLoad NameLoad Index TupleLoad Num Num NameLoad NameLoad decorator_list NameLoad ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num NameLoad body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Num Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Num NameLoad NameLoad body Expr Str If CompareIsNot NameLoad NameLoad body Assign NameStore Num If CompareIs NameLoad NameLoad body Assign NameStore SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad Slice NameLoad Assign NameStore Num If AttributeLoad NameLoad attr body Print Str For NameStore Call NameLoad NameLoad body Print NameLoad Str If CompareIs NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index NameLoad orelse Assign NameStore NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Num Num body Assign NameStore AttributeLoad NameLoad attr Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad For NameStore Call NameLoad NameLoad body Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad NameLoad ExtSlice Slice Index NameLoad Assign SubscriptStore NameLoad ExtSlice Slice Index NameLoad Call NameLoad Call AttributeLoad NameLoad attr Num BinOpSub SubscriptLoad AttributeLoad NameLoad attr Index Num Num keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareLt AttributeLoad NameLoad attr NameLoad body If AttributeLoad NameLoad attr body Print Str NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad Assign NameStore ListLoad For NameStore Call NameLoad SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num body Expr Call AttributeLoad NameLoad attr ListLoad Assign NameStore BinOpSub SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num Num Assign NameStore BinOpSub SubscriptLoad AttributeLoad NameLoad attr Index Num Num While BoolOpAnd CompareGtE NameLoad Num CompareGtE NameLoad Num body Expr Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr NameLoad If CompareEq SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Num body AugAssignSub NameStore Num AugAssignSub NameStore Num orelse If CompareEq SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Num body AugAssignSub NameStore Num orelse If CompareEq SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Num body AugAssignSub NameStore Num orelse Break Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad If AttributeLoad NameLoad attr body Print Str Print Str Str Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore Call NameLoad Num AttributeLoad NameLoad attr body If AttributeLoad NameLoad attr body Print Str NameLoad Str Str NameLoad Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareGt NameLoad NameLoad body Print Str NameLoad Str Break orelse If CompareLt BinOpDiv Call AttributeLoad NameLoad attr BinOpSub NameLoad NameLoad NameLoad AttributeLoad NameLoad attr body Break Assign NameStore Num For NameStore Call NameLoad NameLoad body AugAssignAdd NameStore SubscriptLoad Call NameLoad SubscriptLoad NameLoad Index NameLoad AttributeLoad NameLoad attr Index Num Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num Assign NameStore ListLoad For NameStore Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr ListLoad Assign NameStore Num For NameStore NameLoad body If CompareEq SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num Num body Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Index AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad AugAssignAdd NameStore NameLoad Assign NameStore BinOpSub NameLoad Num Assign NameStore BinOpSub SubscriptLoad AttributeLoad NameLoad attr Index Num Num While BoolOpAnd CompareGtE NameLoad Num CompareGtE NameLoad Num body Expr Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr SubscriptLoad NameLoad Index NameLoad If CompareEq SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Num body AugAssignSub NameStore Num AugAssignSub NameStore Num orelse If CompareEq SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Num body AugAssignSub NameStore Num orelse If CompareEq SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Num body AugAssignSub NameStore Num orelse Break For TupleStore NameStore NameStore Call NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad Call AttributeLoad NameLoad attr keyword Num Return NameLoad decorator_list decorator_list If CompareEq NameLoad Str body Assign NameStore Num Assign NameStore Num Assign NameStore BinOpSub BinOpAdd Num BinOpMult Num Call AttributeLoad AttributeLoad NameLoad attr attr Num Num NameLoad Num Assign NameStore BinOpAdd BinOpDiv AttributeLoad NameLoad attr Num BinOpMult BinOpDiv AttributeLoad NameLoad attr Num Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore BinOpSub BinOpAdd BinOpDiv AttributeLoad NameLoad attr Num BinOpMult Num Call AttributeLoad AttributeLoad NameLoad attr attr Num Num NameLoad Num Assign NameStore BinOpAdd BinOpDiv AttributeLoad NameLoad attr Num BinOpMult BinOpDiv AttributeLoad NameLoad attr Num Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Num Assign NameStore ListLoad Assign NameStore ListLoad For NameStore Call NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMult NameLoad Num BinOpMult NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr Num Num NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad Num Assign SubscriptStore NameLoad ExtSlice Slice Index Num BinOpAdd Call AttributeLoad NameLoad attr BinOpAdd BinOpDiv NameLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad BinOpMult NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign SubscriptStore NameLoad ExtSlice Slice Index Num BinOpAdd Call AttributeLoad NameLoad attr BinOpAdd BinOpDiv NameLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad BinOpMult NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Num Assign NameStore Call NameLoad NameLoad keyword NameLoad keyword Num Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num keyword Num Assign NameStore Call AttributeLoad NameLoad attr Print Str BinOpSub NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr Num For NameStore Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad ExtSlice Slice Index Num Str keyword Num Assign NameStore Call AttributeLoad NameLoad attr Num Num Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad ExtSlice Slice Index Num Str Expr Call AttributeLoad NameLoad attr Num For NameStore Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad ExtSlice Slice Index Num Str keyword Num Assign NameStore Call AttributeLoad NameLoad attr Num Num Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad ExtSlice Slice Index Num Str Expr Call AttributeLoad NameLoad attr Num For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num SubscriptLoad NameLoad ExtSlice Slice Index Num Str keyword Num Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num SubscriptLoad NameLoad ExtSlice Slice Index Num Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num Expr Call AttributeLoad NameLoad attr Num Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore SubscriptLoad NameLoad Index Num For TupleStore NameStore NameStore Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad Num Str keyword Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad Num Str Expr Call AttributeLoad NameLoad attr Num For TupleStore NameStore NameStore Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad Num Str keyword Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad Num Str Expr Call AttributeLoad NameLoad attr Num For TupleStore NameStore NameStore Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index TupleLoad NameLoad Num SubscriptLoad NameLoad Index TupleLoad NameLoad Num Str keyword Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index TupleLoad NameLoad Num SubscriptLoad NameLoad Index TupleLoad NameLoad Num Str Expr Call AttributeLoad NameLoad attr
N/A N/A __author__ brandonkelly N/A numpy np numba jit N/A matplotlib.pyplot plt scipy.interpolate interp1d N/A time dynamic_time_warping N/A N/A tseries1 tseries2 N/A N/A N/A 
    Compute the dynamic time warping (DTW) distance between two time series. It is assumed that the time series are
    evenly sampled, but they can have different lengths. Numba is used to speed up the computation, so you must have
    Numba installed. Note that the time series can be multivariate.

    :param tseries1: The first time series, a 1-D or 2-D numpy array.
    :param tseries2: The second time series, a 1-D or 2-D numpy array.
    :return: A tuple containing the DTW distance, the DTW matrix, and the path matrix taken by the algorithm.
     N/A N/A ntime1 nfeatures N/A tseries1 shape N/A ntime2 N/A N/A tseries2 shape N/A 0 N/A dtw N/A N/A np zeros N/A ntime1 ntime2 dtype N/A np float N/A path N/A N/A np zeros N/A ntime1 ntime2 dtype N/A np int N/A k N/A range nfeatures N/A N/A N/A dtw N/A N/A 0 0 N/A N/A N/A tseries1 N/A N/A 0 k N/A tseries2 N/A N/A 0 k 2 N/A N/A path N/A N/A 0 0 -1 N/A i N/A range 1 ntime1 N/A N/A dist 0.0 N/A k N/A range nfeatures N/A N/A dist N/A N/A N/A tseries1 N/A N/A i k N/A tseries2 N/A N/A 0 k 2 N/A N/A dtw N/A N/A i 0 N/A N/A dtw N/A N/A N/A i 1 0 dist N/A N/A path N/A N/A i 0 2 N/A j N/A range 1 ntime2 N/A N/A dist 0.0 N/A k N/A range nfeatures N/A N/A dist N/A N/A N/A tseries1 N/A N/A 0 k N/A tseries2 N/A N/A j k 2 N/A N/A dtw N/A N/A 0 j N/A N/A dtw N/A N/A 0 N/A j 1 dist N/A N/A path N/A N/A 0 j 1 N/A i N/A range 1 N/A len tseries1 N/A N/A j N/A range 1 N/A len tseries2 N/A N/A a N/A dtw N/A N/A N/A i 1 N/A j 1 N/A b N/A dtw N/A N/A i N/A j 1 N/A c N/A dtw N/A N/A N/A i 1 j N/A N/A a b N/A N/A N/A a c N/A N/A idx 0 N/A delta a N/A N/A idx 2 N/A delta c N/A N/A N/A b c N/A N/A idx 1 N/A delta b N/A N/A idx 2 N/A delta c N/A dist 0.0 N/A k N/A range nfeatures N/A N/A dist N/A N/A N/A tseries1 N/A N/A i k N/A tseries2 N/A N/A j k 2 N/A N/A dtw N/A N/A i j N/A dist delta N/A N/A path N/A N/A i j idx N/A N/A N/A dtw N/A N/A -1 -1 dtw path N/A jit DBA N/A object N/A __init__ N/A N/A self max_iter tol verbose N/A 0.0001 False N/A N/A 
        Constructor for the DBA class. This class computes the dynamic time warping (DTW) barycenter averaging (DBA)
        strategy for averaging a set of time series. The method is described in

        "A global averaging method for dynamic time warping, with applications to clustering." Petitjean, F.,
            Ketterlin, A., & Gancarski, P. 2011, Pattern Recognition, 44, 678-693.

        :param max_iter: The maximum number of iterations for the DBA algorithm.
        :param tol: The tolerance level for the algorithm. The algorithm terminates once the fractional difference in
            the within-group sum of squares between successive iterations is less than tol. The algorithm will also
            terminate if the maximum number of iterations is exceeded, or if the sum of squares increases.
        :param verbose: If true, then provide helpful output.
         N/A N/A self max_iter max_iter N/A N/A self tol tol N/A N/A self average N/A N/A np zeros 1 N/A N/A self wgss 0.0 N/A N/A self verbose verbose N/A compute_average N/A N/A self tseries nstarts initial_value dba_length N/A 1 None None N/A N/A 
        Perform the DBA algorithm to compute the average for a set of time series. The algorithm is a local optimization
        strategy and thus depends on the initial guess for the average. Improved results can be obtained by using
        multiple random initial starts.

        :param tseries: The list of time series, a list of numpy arrays. Can be multivariate time series.
        :param nstarts: The number of random starts to use for the DBA algorithm. The average time series that minimizes
            the within-group sum of squares over the random starts is returned and saved.
        :param initial_value: The initial value for the DBA algorithm, a numpy array. If None, then the initial values
             will be drawn randomly from the set of input time series (recommended). Note that is an initial guess is
             supplied, then the nstarts parameter is ignored.
        :param dba_length: The length of the DBA average time series. If None, this will be set to the length of the
            initial_value array. Otherwise, the initial value array will be linearly interpolated to this length.
        :return: The estimated average of the time series, defined to minimize the within-group sum of squares of the
            input set of time series.
         N/A N/A initial_value None N/A N/A nstarts 1 N/A N/A initial_value None N/A N/A start_idx N/A N/A N/A N/A np random permutation N/A len tseries N/A nstarts N/A best_wgss 1e+300 N/A N/A self verbose N/A N/A Doing initialization iteration: N/A i N/A range nstarts N/A N/A i ... N/A N/A initial_value None N/A N/A iseries N/A tseries N/A N/A start_idx N/A i N/A N/A iseries initial_value N/A N/A dba_length None N/A N/A iseries0 N/A N/A np atleast_2d iseries N/A N/A N/A N/A iseries0 shape N/A 0 1 N/A N/A iseries0 N/A iseries0 T N/A nfeatures N/A N/A iseries0 shape N/A 1 N/A iseries N/A N/A np zeros N/A dba_length nfeatures N/A k N/A range nfeatures N/A N/A lininterp N/A interp1d N/A N/A np arange N/A N/A iseries0 shape N/A 0 N/A iseries0 N/A N/A N/A k N/A N/A iseries N/A N/A N/A k N/A lininterp N/A N/A np linspace 0.0 N/A N/A N/A iseries0 shape N/A 0 1.01 num dba_length N/A N/A N/A self _run_dba tseries iseries N/A N/A N/A self wgss best_wgss N/A N/A N/A self verbose N/A N/A New best estimate found for random start i N/A best_wgss N/A self wgss N/A best_average N/A self average N/A N/A self wgss best_wgss N/A N/A self average best_average N/A best_average N/A associate_segments N/A N/A self tseries N/A N/A N/A 
        Identify the indices of the inputs time series that are associated with each element of the average time series.

        :param tseries: The times series for which the indices associated with the average are desired. A numpy array.
        :return: A list-of-lists containing the indices of the input time series that are associated with the elements
            of the DBA average. Call this assoc_table. Then assoc_table[i] will return a list of the indices of the
            input time series that are associated with the element i of the DBA average (i.e., self.average[i]).
         N/A N/A dtw_dist dtw path N/A dynamic_time_warping N/A self average tseries N/A assoc_table N/A N/A i N/A range N/A N/A N/A self average shape N/A 0 N/A N/A N/A N/A assoc_table append N/A N/A i N/A N/A N/A N/A self average shape N/A 0 1 N/A j N/A N/A N/A tseries shape N/A 0 1 N/A N/A N/A i 0 N/A j 0 N/A N/A N/A N/A N/A assoc_table N/A i append j N/A N/A N/A path N/A N/A i j 0 N/A N/A i 1 N/A j 1 N/A N/A N/A N/A path N/A N/A i j 1 N/A N/A j 1 N/A N/A N/A N/A path N/A N/A i j 2 N/A N/A i 1 N/A N/A N/A assoc_table N/A _run_dba N/A N/A self tseries initial_value N/A N/A N/A  Perform the DBA algorithm.  N/A nseries N/A len tseries N/A N/A self average initial_value N/A N/A self verbose N/A N/A Doing iteration N/A 0 ... N/A wgss N/A N/A self _dba_iteration tseries N/A i N/A range 1 N/A self max_iter N/A N/A N/A self verbose N/A N/A i ... WGSS: wgss N/A wgss_old wgss N/A wgss N/A N/A self _dba_iteration tseries N/A N/A wgss wgss_old N/A N/A Warning! Within-group sum of squares increased at iteration i terminating algorithm. N/A N/A N/A N/A N/A N/A N/A np abs N/A wgss wgss_old wgss_old N/A self tol N/A N/A N/A wgss 0.0 N/A k N/A range nseries N/A N/A wgss N/A N/A dynamic_time_warping N/A tseries N/A k N/A self average N/A 0 N/A N/A self wgss wgss N/A _dba_iteration N/A N/A self tseries N/A N/A N/A  Perform a single iteration of the DBA algorithm.  N/A ntime N/A N/A N/A self average shape N/A 0 N/A assoc_table N/A N/A i N/A range ntime N/A N/A N/A N/A assoc_table append N/A N/A wgss 0.0 N/A series tseries N/A N/A N/A N/A N/A N/A self average shape N/A 1 1 N/A N/A series N/A series N/A N/A N/A N/A np newaxis N/A N/A dtw_dist dtw path N/A dynamic_time_warping N/A self average series N/A wgss dtw_dist N/A i N/A ntime 1 N/A j N/A N/A N/A series shape N/A 0 1 N/A N/A N/A i 0 N/A j 0 N/A N/A N/A N/A N/A assoc_table N/A i append N/A series N/A j N/A N/A N/A path N/A N/A i j 0 N/A N/A i 1 N/A j 1 N/A N/A N/A N/A path N/A N/A i j 1 N/A N/A j 1 N/A N/A N/A N/A path N/A N/A i j 2 N/A N/A i 1 N/A N/A N/A N/A i cell N/A enumerate assoc_table N/A N/A cell_array N/A N/A np array cell N/A N/A N/A self average N/A i N/A N/A cell_array mean axis 0 N/A wgss N/A N/A N/A N/A __name__ __main__ N/A N/A nseries 40 N/A ntime0 1000 N/A phase1 N/A N/A 0.1 N/A 0.2 N/A N/A N/A np random uniform 0.0 1.0 nseries 0.1 N/A period1 N/A N/A N/A np pi 4.0 N/A N/A N/A np pi 100.0 N/A N/A N/A np random standard_normal nseries N/A phase2 N/A N/A N/A N/A np pi 2 N/A 0.2 N/A N/A N/A np random uniform 0.0 1.0 nseries 0.1 N/A period2 N/A N/A N/A np pi 2.0 N/A N/A N/A np pi 100.0 N/A N/A N/A np random standard_normal nseries N/A noise_amplitude 0.0 N/A t_list N/A N/A ts_list N/A N/A i N/A range nseries N/A N/A ntime N/A N/A N/A np random random_integers N/A ntime0 0.9 N/A ntime0 1.1 N/A t N/A N/A np linspace 0.0 10.0 ntime N/A N/A N/A t_list append t N/A tseries N/A N/A np zeros N/A ntime 2 N/A N/A tseries N/A N/A N/A 0 N/A N/A N/A np sin N/A N/A t N/A period1 N/A i N/A phase1 N/A i N/A noise_amplitude N/A N/A N/A np random standard_normal ntime N/A N/A tseries N/A N/A N/A 1 N/A N/A N/A np sin N/A N/A t N/A period2 N/A i N/A phase2 N/A i N/A noise_amplitude N/A N/A N/A np random standard_normal ntime N/A N/A N/A ts_list append tseries N/A niter 30 N/A dba N/A DBA niter verbose True tol 0.0001 N/A t1 N/A N/A time clock N/A dba_avg N/A N/A dba compute_average ts_list nstarts 5 dba_length 10 N/A t2 N/A N/A time clock N/A DBA algorithm took N/A t2 t1 seconds. N/A N/A N/A plt subplot 221 N/A i N/A range nseries N/A N/A N/A N/A plt plot N/A t_list N/A i N/A N/A ts_list N/A i N/A N/A N/A 0 . ms 2 N/A t N/A N/A np linspace 0.0 10.0 N/A len dba_avg N/A N/A N/A plt plot t N/A dba_avg N/A N/A N/A 0 ko N/A N/A N/A plt subplot 222 N/A i N/A range nseries N/A N/A N/A N/A plt plot N/A t_list N/A i N/A N/A ts_list N/A i N/A N/A N/A 1 . ms 2 N/A t N/A N/A np linspace 0.0 10.0 N/A len dba_avg N/A N/A N/A plt plot t N/A dba_avg N/A N/A N/A 1 ko N/A N/A N/A plt subplot 223 N/A ts ts_list N/A N/A N/A N/A plt plot N/A ts N/A N/A N/A 0 N/A ts N/A N/A N/A 1 . ms 2 N/A N/A N/A plt plot N/A dba_avg N/A N/A N/A 0 N/A dba_avg N/A N/A N/A 1 ko N/A N/A N/A plt show N/A N/A N/A plt close N/A assoc N/A N/A dba associate_segments N/A ts_list N/A 0 N/A N/A N/A plt subplot 221 N/A t N/A t_list N/A 0 N/A ts N/A ts_list N/A 0 N/A N/A i a N/A enumerate assoc N/A N/A N/A N/A plt plot N/A t N/A a N/A ts N/A N/A a 0 . label N/A str i N/A N/A N/A plt plot N/A N/A np median N/A t N/A a N/A dba_avg N/A N/A i 0 ko N/A N/A N/A plt subplot 222 N/A N/A i a N/A enumerate assoc N/A N/A N/A N/A plt plot N/A t N/A a N/A ts N/A N/A a 1 . label N/A str i N/A N/A N/A plt plot N/A N/A np median N/A t N/A a N/A dba_avg N/A N/A i 1 ko N/A N/A N/A plt subplot 223 N/A N/A i a N/A enumerate assoc N/A N/A N/A N/A plt plot N/A ts N/A N/A a 0 N/A ts N/A N/A a 1 . label N/A str i N/A N/A N/A plt plot N/A dba_avg N/A N/A i 0 N/A dba_avg N/A N/A i 1 ko N/A N/A N/A plt show