Complete code of the first stage of the position corelation analysis.
(able to perform a multiscale analysis for position correlation).