A method for detecting complex correlation in time series