Latent variable models for characterizing the dynamic structure underlying complex behaviors