A method for classifying and comparing non-linear trajectories of ecological variables