Similar Items: Detecting directed motion and confinement in single-particle trajectories using hidden variables