Using PAM and DTW for time series classification