1. A computer-implemented method for estimating a sequence of action labels given an observation sequence, the method comprising: given a linear dynamic system state space model that is capable of being represented as a unified probabilistic graphical model comprising duration-of-actions layer (D) consisting of a series of time duration values, an action label layer (S), a first hidden state layer comprising a latent state layer (X), a second hidden state layer comprising a substructure transition layer (Z), and an observation layer (Y): maximizing a joint posterior of action label at each of a set of time instances given a set of observations; approximating the joint posterior using sampling, wherein a number of samples are drawn to approximate the posterior; and calculating the posterior by weighted combination of the samples; wherein determination of a new action label in the action label layer (S) and new substructure transition in the substructure transition layer (Z) are triggered by the ending of a time period defined by a time duration value in the duration-of-action layer (D).