{'fraction_non_alphanumeric': 0.03693058903516905, 'fraction_numerical': 0.010661969219358428, 'mean_word_length': 4.485506017969147, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Multiple Hidden Markov Models for Categorical Time Series

We introduce multiple hidden Markov models (MHMMs) where an observed multivariate categorical time series depends on an unobservable multivariate Mar- kov chain. MHMMs provide an elegant framework for specifying various independence relationships between multiple discrete time processes. These independencies are interpreted as Markov properties of a mixed graph and a chain graph associated to the latent and observable components of the MHMM, respectively. These Markov properties are also translated into zero restrictions on the parameters of marginal models for the transition probabilities and the distributions of the observable variables given the latent states.


Introduction
In several applications involving time series, it is of interest to describe how the evolution of variables over time depends on latent characteristics or the focus may be on the dynamics of unobservable characteristics measured by variables observed at consecutive time occasions. These issues are addressed by hidden Markov models and a widespread application of them has occurred in several fields such as speech recognition, signal processing, digital communication, biology, reliability etc., standard references are MacDonald and Zucchini, 1997, Cappé et al., 2005, among others.
Basically, an hidden Markov model assumes that an observable time series depends on an unobservable Markov chain in such a way that the joint process is also Markovian. In this work, we focus on discrete hidden Markov models with a multivariate categorical observable process depending on a multivariate latent chain, so we observe more variables at each time and assume that their distribution can be affected by one or more latent variables. We will refer to these extensions of the traditional hidden Markov process as multiple hidden Markov models (MHMMs).
MHMMs can be well suited to applications where all the observable time series are affected by one common unobservable factor (general effect) and each observable variable is also governed by its specific latent variable. MHMMs may also handle time series data where an unobservable aspect influences the marginal dynamics of each observable variable while another latent factor influences the association among them. In the framework of MHMMs, different sets of observable categorical time series are allowed to depend on different sets of unobservable processes and the observable variables are not required to be independent given the latent states (local independence assumption), but the association between them is also modeled. Moreover, in MHMMs, the multivariate latent process can satisfy the hypotheses of Granger noncausality and contemporaneous independence described by  for multivariate Markov chains. Therefore, MHMMs widen the opportunities of applications of the classical hidden Markov models. This approach, for example, responds to the shortcomings highlighted in Zucchini and Guttorp, 1991, who proposed a model for describing the sequence of wet and dry days at 5 sites without taking into account the spatial dependence among sites situated in closed locations and without allowing for a multivariate state process with sites in different regions responding to different components of the latent process. Other examples illustrated in the literature can be enriched of more flexible and realistic hypotheses using MHMMs.
In MHMMs, the state space E is the cartesian product of the state spaces of the single latent variables. These models, without restrictions on the transition probabilities of the latent chain are useless as they are equivalent to the conventional hidden Markov model (HMM) with a number of states equal to the cardinality of E. However, the conventional HMM has an extremely large number of parameters and cannot be easily used to discover interesting independence structures in the transition matrix of the latent chain and in the distributions of observable variables given the latent states, while MHMMs enable us to formulate meaningful constraints offering advantages of parsimony and interpretability.
In the sequel, to make easier the interpretability of the proposed models, we will associate graphical Markov models to MHMMs whose probabilities will be parameterized by marginal models. Thus, our contribution stays also in taking advantages of the use of graphical and marginal models into the framework of hidden Markov processes.
The paper is organized as follows. MHMMs are presented in Section 2. The transition probabilities of the latent model and the distributions of observable variables given the latent states are required to obey the Markov properties of a mixed and a chain graph, respectively, in Section 3. Finally, we will show in Section 4 that the independencies among the observable and latent variables of the MHMM can be easily verified by testing linear constraints on parameters of marginal parameterizations (Bergsma and Rudas, 2002) of the transition probabilities and the probabilities of the observations given the latent states.

Multiple hidden Markov models
Let E U be a r-variate process of categorical variables, .., s}. The random variables E i (t), F j (t) take values in finite sets E i and F j i ∈ U, j ∈ V. One realization of the process F V at a given time is denoted by f = (f 1 , f 2 , ..., f s ) ∈ F = × j∈V F j , and the realization of E U is e = (e 1 , e 2 , ..., e r ) in E = × i∈U E i . For every subset T ⊂ U and R ⊂ V, marginal processes are represented by The following definition states when (E U , F V ) is an MHMM.
In particular, condition c) implies that E U is a first order Markov chain (Colombi and Giordano, 2011).
The following theorem clarifies when the properties of an MHMM are preserved after marginalizing the latent and observable processes.
Theorem 1 Let E T and F R , T ⊂ U and R ⊂ V, be marginal processes of the latent and observable components of an MHMM (E U , F V ). The marginal process (E T , F R ) is still an MHMM if and only if the following conditions are satisfied for all t ∈ N \ {0} This theorem is a special case of the results presented in Colombi and Giordano (2011) where the statement (1) is proved to ensure that the marginal process E T of the latent component E U is still a Markov chain. Condition (2) states that observable variables F R (t) at time t depend only on the latent variables E T (t).

Special cases of MHMMs: linked and coupled MHMMs
Here, we discuss some special cases of MHMMs which generalize the linked and coupled hidden Markov models proposed in the literature in the simple version with two observable variables and two latent processes (Koski, 2001, Brand et al., 1997.
In our generalized version of linked hidden Markov models, every set of a partition of the latent variables is affected only by its own past, while in the coupled hidden Markov models, these sets are independent conditionally on the past of every latent variable. In all the mentioned models, every set of the partition of the latent variables influences one and only one set of a partition of the manifest variables and the sets of the observable variables are independent given the latent states.
A formal definition is presented below.
It is worthwhile to note that according to Theorem 1, the marginal processes (E Us , F Vs ), s ⊂ {1, 2, ..., l}, of a linked MHMM are still MHMMs, but this is not true for a coupled MHMM.
We stress that it is important to involve the unions of variables U s = i∈s T i , V s = i∈s R i in the conditions (3) and (4). In fact, if they were replaced by the .., l, it could happen, for example, that E Ti and E Tj are marginally affected only by their own past, but E Ti∪Tj is influenced by the past of all the latent variables. Similarly, it could happen that F Ri and F Rj respond marginally only to E Ti and E Tj , respectively, but their joint distribution depends on all the latent variables. Moreover in linked MHMM, it could be that the marginal processes (E Ti , F Ri ) and (E Tj , F Rj ) are hidden Markov, but (E Ti∪Tj , F Ri∪Rj ) is no longer an MHMM.

Graphical models for MHMMs
In this section, we address the use of graphical Markov models for MHMMs. Such models associate missing edges of a graph with some conditional independence restrictions imposed on the probabilities of the observable variables given the latent states and the transition probabilities of the latent process. The terminology and the notation used throughout the paper follow Colombi and Giordano, 2012. We just briefly remind that G = (V, E) is a graph with a finite set of nodes V and a set of edges E; moreover, for every non-empty subset of nodes S, pa G (S), ch G (S), nb G (S), and sp G (S) are the collection of parents, children, neighbours and spouses of nodes in the set S. In particular, here the nodes can correspond to variables or to processes. Note that every node is neighbour and spouse of itself.
Finally, B(G) indicates the family of the bi-connected sets in the graph.

MHMM Markov with respect to a mixed and a chain graph
We consider two types of graphs: a mixed graph for the latent component of the MHMM and a chain graph for the observable component. In particular, the transition probabilities of the multivariate latent Markov chain E U in the MHMM are required to obey a set of Markov properties encoded by a mixed graph G whose basic features are discussed in Colombi and Giordano, 2012, for Markov chains, while the Markov properties satisfied by the distribution of the observable variables conditioned on the latent states are read off a chain graph G * .
In a mixed graph G, a node i corresponds to the marginal process E i , for every i ∈ U, and independence restrictions are associated with missing directed and bi-directed edges, respectively. In particular, missing bi-directed edges lead to independencies of marginal processes at the same point in time; missing directed edges, instead, refer to independencies which involve marginal processes at two consecutive instants.
A chain graph G * with two chain components τ 0 and τ 1 serves the need to encode the independence relations among observable and latent variables of the MHMM at a given time point. The nodes of the chain graph G * , belonging to τ 0 correspond to the random variables E i (t * ), i ∈ U, and the nodes belonging to τ 1 , correspond to the random variables F j (t * ), j ∈ V, for any arbitrary t * ∈ N.
All the edges in the subgraph induced by a chain component are bi-directed and the graph induced by the chain component τ 0 is bi-complete. Furthermore, the directed edges in graph G * point in the same direction from τ 0 towards τ 1 .
The definition below specifies the properties for an MHMM being Markov with respect to a mixed and a chain graph.
Definition 3 (MHMM Markov wrt a mixed and a chain graph). The latent process E U of an MHMM (E U ,F V ) is Markov wrt a mixed graph G if and only if its transition probabilities satisfy the following conditional independencies for all t ∈ N \ {0} associated to missing directed and bi-directed edges of G, respectively: The observable process F V is Markov wrt a chain graph G * if and only if the distribution of the observable variables given the latent states satisfies the following conditional independencies for all t ∈ N\{0} associated to missing bi-directed and directed edges of G * , respectively: Therefore, an MHMM (E U ,F V ) is said to be Markov wrt a mixed and a chain graph when the latent component is Markov wrt a mixed graph, and the observation component given the latent states is Markov wrt a chain graph.
In the context of first order multivariate Markov chains, condition (7) corresponds to a notion of Granger noncausality and, when pa G (T ) = T , it ensures that the marginal process E T is a Markov chain Giordano, 2012, Florens et al., 1993). Henceforth, we will refer to (7) with the term Granger noncausality (Gnoncausality) condition saying that the latent process E T is not G-caused by E U \pa G (T ) with respect to E U . Condition (8) states that the transition probabilities satisfy the bidirected Markov property (Richardson, 2003) with respect to the graph obtained by removing the directed edges from the mixed graph. Here, we will refer to (8) with the term contemporaneous independence condition and say that the latent processes E T and E U \sp G (T ) are contemporaneously independent.
On the other hand, conditions (9) and (10) encoded by the chain graph G * refer to the observable component of the MHMM and are equivalent to the type IV Markov properties C2b and C3b discussed by Drton, 2009. Note that conditions (9) are bidirected Markov properties which describe a local independence assumption, the independencies (10) of a set of manifest variables from a set of latent variables, at time t, are conditioned on the remaining latent variables, but not to the remaining observable variables.
Missing edges in G * can be alternatively interpreted as the type I Markov properties C2a and C3a proposed by Drton, 2009. In such a case, bi-directed edges in G * are usually replaced by undirected edges and the Markov properties expressed by the following statements for all t ∈ N \ {0} Although this type I chain graph model is simpler since it corresponds to zero constraints on standard log-linear parameters of the observation probabilities, in our opinion the independence conditions it encodes are less meaningful than type IV Markov properties. In fact, when the independence of set of observable variables from some latent variables is of interest it seems inappropriate to condition also with respect to the remaining observable variables. As a matter of convenience, the mentioned mixed graph and the two component chain graph can be superimposed as shown in Figure 1 to form a unique graph that we will refer to as mixed-chain graph for simplicity. In all the examples throughout the paper, we implicitly assume that each node of the mixed-chain graph, corresponding to a latent variable, is parent of itself, even if the edge is not reported.

Example 1
The mixed-chain graph on the right of Figure 2 encodes that the latent variables of the three dimensional MHMM are Granger caused reciprocally but are contemporaneously independent, i.e.
; and, at every time point, the observable variables given the latent states are independent, i.e.
The mixed-chain graph on the left of Figure 2 is associated to a 3-variate MHMM where the latent variables are not contemporaneously independent, and each of them depends only on its own past, i.e. the encoded Granger noncausality conditions (7) are Example 2 (MHMMs for marketing and financial data). The mixed-chain graph on the left in Figure 3 is associated to an MHMM encoding the dynamic relations of three observable time series which depend on two latent factors. The observable time series can represent, for example, the sales levels of three products that can be interpreted as indicators of the motivational latent states of the customers behaviors. The distributions of the motivational states may be of interest more than those of the product sales. The graph underlies that the first two products belong to the same category so their sales series (F 1 , F 2 ) depend on the latent variable E 1 (i.e. F {1,2} (t) ⊥ ⊥ E 2 (t)|E 1 (t)), the sales of the third product respond to a different latent variable E 2 (i.e. F 3 (t) ⊥ ⊥ E 1 (t)|E 2 (t)); the observable sales levels are independent given the latent states (i.e. F 1 (t) ⊥ ⊥ F 2 (t) ⊥ ⊥ F 3 (t)|E {1,2} (t)); the two motivational latent processes are G-caused reciprocally, so that the past motivational states influence the actual state of each latent variable, but they are contemporaneously independent (i.e. E 1 (t) ⊥ ⊥ E 2 (t)|E {1,2} (t − 1)).
The mixed-chain graph on the right in Figure 3 can describe a model for financial series where specific and generic latent effects exist. The series F 1 , F 2 can indicate the trading patterns of two financial traded shares in two different financial sectors. The presence or the absence of trading may depend on a specific latent aspect typical of each financial sector where the trading takes place (e.g. the turbulence of the sector), so each observable variable depends on one specific latent variable: F 1 on E 1 , F 2 on E 2 , but all the trading patterns may be influenced by one common unobservable variable (E 3 ) such as the Market turbulence with states that correspond to calm or turbulent phases of the Market (i.e. Moreover, the past Market turbulence can affect the current turbulence of each financial sector (G-causality) whereas a specific latent variable of a sector does not Granger cause the other specific latent variable and the turbolence of the Market, (i.e. 1)). Finally there is no contemporaneous relation among the three turbulences (i.e. Proof. Conditions (7) and (10) for (E U , F V ) being Markov with respect to the graphs where pa G (T ) = T and pa G * (R) = T coincide with the conditions (1) and (2) ensuring that (E T , F R ),T ⊂ U, R ⊂ V, is still a hidden process.
Moreover, the restrictions which the observation and latent models obey in linked and coupled MHMMs (Definition 2) can be described by the Markov properties of mixed and chain graphs as specified in the corollary below.
The proof is omitted as similar to that of Corollary 1.
For instance, in Figure 2, the mixed-chain graph on the left corresponds to a linked MHMM with two components and the mixed-chain graph on the right to a coupled MHMM with three components.

Equivalent mixed-chain graphs
Standard hidden Markov models, and more in general mixture models, suffer from the non-identifiability problem due to the invariance with respect to relabeling of hidden states. For this reason, MHMMs are identifiable only up to switching the latent categories and the labels of the latent variables. Due to the invariance with respect to switching labels of the latent variables, there are mixed-chain graphs equivalent in the sense that they correspond to the same MHMM. We now clarify this point thoroughly.
Two mixed-chain graphs, say G 1 and G 2 , with the same sets of nodes, are equivalent if there is a bijection ν which maps the set of nodes corresponding to the latent variables onto itself assuring that: i) the nodes E i of G 1 and ν(E i ) of G 2 are associated to latent variables with the same number of states; ii) if E i , E j are connected by an edge in G 1 then ν(E i ) and ν(E j ) are connected by the same type of edge in G 2 ; iii) if E i , E j are not connected by any edges in G 1 then ν(E i ) and ν(E j ) are not connected in It is evident that two mixed-chain graphs, equivalent according to the previous conditions, encode conditional independencies that differ only for the labels assigned to the latent variables.
An example illustrates the mentioned concepts.  Figure 4 shows three equivalent mixed-chain graphs corresponding to an MHMM where a latent variable affects both the observable variables (generic latent effect) and each manifest variable is governed by its specific latent variable (specific latent effect). In the second line of Figure 4, the two equivalent mixedchain graphs identify the MHMM where two latent variables affect only the first two observable variables and another latent variable is specific for the third observable variable. Moreover, the latent variable specific for F 3 is contemporaneously independent of the other two latent variables, and there is no Granger-causality between this variable and one of the remaining unobservable variables.

A parameterization for MHMMs
Till now we have described the hypotheses underlying MHMMs, now we need to illustrate how to test such hypotheses. In particular, all the conditional independencies so far illustrated are related to the natural parameters of the MHMMs: the probabilities of the observable variables given the latent states and the transition probabilities of the latent process.
The time-homogeneous joint transition probabilities are denoted by φ(e|e ) for every pair of states e ∈ E, e ∈ E. Moreover, φ T (e T |e ) is the marginal transition probability from state e ∈ E to state e T with components e i : i ∈ T ⊂ U. We assume that the initial distribution of E U is the invariant one and is unique. Finally, ϕ(f|e) indicates the state-dependent distribution that is the conditional probabilities of the observable variables given the latent state e and ϕ R (f R |e) represents the marginal probability of the observable variables in the set R given the latent state e.
In this section, we propose to parameterize both the state-dependent distributions and the transition probabilities of the latent process through marginal models and verify hypotheses which make these models more parsimonious by constraining marginal parameters. In the marginal models, the parameters are called marginal interactions. For every observable or latent categorical variable, the first category is called baseline. Any observation f = (f 1 , f 2 , ..., f s ) which includes categories at the baseline level for variables j / ∈ J , J ⊂ V, is denoted by (f J , f* V\J ). A similar notation holds for the latent state e = (e 1 , e 2 , ..., e r ). For every non-empty subset P of the observable variables V and for every f P ∈ × j∈P F j , the baseline interactions η P (f P |e), P ∈ V, of the Gloneck-McCullagh marginal model for the observable variables are contrasts of logarithms of marginal state-dependent probabilities In order to model the dependence of the distribution of the observable variables on the states e, we adopt the usual factorial expansion Analogously, in the marginal model for the latent component of MHMMs, we define, for every P ⊆ U, the marginal parameters λ P (e P |e ) = K⊆P (−1) |P\K| log φ P (e P |e ). and the factorial expansion

Parametric constraints for conditional independencies
The properties of graphical models for MHMMs (Definition 3) correspond to zero restrictions on the parameters θ P,Q (f P |e Q ) and δ P,Q (e P |e Q ), introduced in (11) and (12), as illustrated in the next theorem.
Theorem 2 For a latent model with strictly positive time-homogeneous transition probabilities, the Granger noncausality condition (7) is equivalent to δ P,Q (e P |e Q ) = 0 for all P ⊆ T , Q ⊆ pa G (P), while the conditional contemporaneous independence (8) is equivalent to δ P,Q (e P |e Q ) = 0 for all P ∈ B(G), e P ∈ × i∈P E i , e Q ∈ × i∈Q E i . Moreover, if the state-dependent probabilities are strictly positive, the independence (9) is equivalent to θ P,Q (f P |e Q ) = 0 for all P ∈ B(G * ), while condition (10) corresponds to θ P,Q (f P |e Q ) = 0 for all P ⊆ R, Q ⊆ pa G * (P), f P ∈ × j∈P F j , e Q ∈ × i∈Q E i .
Proof. The equivalence between the zero restrictions on δ parameters and conditions (7) and (8)  The theorem allows a simple implementation of standard methods to fit and test MHMMs under the restrictions (7,8,9,10). The theorem enhances the use of the marginal parametrization since all the conditions (7,8,9,10) are equivalent to linear constraints on the marginal parameters, the same restrictions under the log-linear parametrization would correspond to non linear constraints on the parameters.
Moreover, since Corollary 1 proves that conditions (1) and (2) are particular cases of the independencies (7) and (10), the constraints on marginal parameters described in Theorem 2 are useful also for testing if the properties of an MHMM are preserved after marginalizing the latent and observable processes.
An example clarifies which marginal parameters are restricted to zero in order to satisfy the conditional independencies that correspond to the Markov properties of the mixed-chain graph.

Additivity hypotheses
In the framework of hidden Markov models with several latent and observable variables, other interesting hypotheses, that do not correspond to any conditional independence, can be easily formulated. These hypotheses reduce the number of parameters needed to parameterize the transition and observation probabilities. A useful restriction that considerably simplifies the observation model is the hypothesis of additivity of the effects of the latent variables on the marginal interactions of the observable variables. This marginal additive dependence allows the interactions to be expressed by the factorial expansion Note that under this hypothesis, the parameters θ P,Q (f P |e Q ) described in (11) are null if |Q| > 1. A similar additivity hypothesis can be used for the interactions of the latent model λ P (e P |e ) = δ P (e P ) + k∈U δ P,k (e P |e k ).
Another hypothesis is that of invariant association corresponding to the constraints η P (f P |e) = θ P (f P ), if |P | > 1. According to this hypothesis the interactions between observable variables do not depend on the states of the latent variables.
Similarly, the constraints for the invariant association can be also imposed to the interactions of the latent model: λ P (e P |e ) = δ P (e P ), if |P | > 1.

Examples
In this section, we fit different MHMMs on two data sets. The EM algorithm used for estimating the models is described in Colombi and Giordano, 2011, and implemented in the R-package hmmm by  The data set of a soft-drink company (Ching et al., 2002, available also in the Rpackage hmmm) consists of a one-year time series of daily sales of soft-drinks: lemon tea, orange juice and apple juice, all with categories: low, medium, high level. Changes in sale outcomes over time can depend on time-varying unobservable factors and we consider an MHMM with two dichotomous latent variables to model these data.
The marginal latent processes of the MHMM are denoted by E 1 , E 2 , and the marginal observable components by F T , F O , F A .
Among others, we tested the hypotheses that the latent components E 1 and E 2 are marginally Markov chains and that the tea sales depend on E 1 only, the orange and apple juices sales on E 2 only. That is we test for condition (7) of double Granger noncausality (in short noGranger) for the latent variables: which ensure that E 1 and E 2 are univariate Markov chains and the restriction (10) of conditional independencies for the observable variables given the latent chains: F T (t) ⊥ ⊥ E 2 (t)|E 1 (t) and F {O,A} (t) ⊥ ⊥ E 1 (t)|E 2 (t) that we will refer to as ci. These restrictions serve to assure that the marginal processes (F T , E 1 ) and (F O F A , E 2 ) are still hidden Markov models.
Additional hypotheses tested for the observable model are: the invariant association (ia) mentioned in Section 4.2 meaning that the interactions of second and higher order of the observable variables do not depend on the latent states, i.e. η P (f P |e) = θ P (f P ) for |P| > 1, and the local independence (9) (in short ind) of all the observable variables while for the latent model we consider the hypothesis that there is invariant association (ia) according to which the interactions of second order do not depend on the latent states at the past time occasions, i.e. λ P (e P |e ) = δ P (e P ), for |P| > 1. Table 1 reports the likelihood ratio tests (LRT), degrees of freedom (df) and pvalues for models restricted under the mentioned hypotheses against the unrestricted model, the number of parameters (par), the values of the log-likelihood function (loglike) and the Akaike criterion (AIC). The MHMM with the lowest AIC value is also the most parsimonious model (last row in Table 1) which corresponds to the mixed-chain graph illustrated in Figure 6. It encodes the properties of double Granger noncausality and invariant association for the latent component of the MHMM, the local independence and the specific dependence of the observable variables on the latent chains for the observable component of the MHMM.
The second data set, available at http : //archive.ics.uci.edu/ml/, reports daily measurements (from December 2006 to November 2010) of electric power consumption in one household. The energy (in watt-hour of active energy) from the sub-meter 1 corresponds to the kitchen, containing mainly a dishwasher, an oven and a microwave; the energy from the sub-meter 2 is used for the laundry room, containing a washingmachine, a tumble-drier, a refrigerator and a light; energy from sub-meter 3 corresponds to an electric water-heater and an air-conditioner. Here, the energy consumptions registered over 4 years by the sub-meters 1, 2, and 3, are categorized in low and high levels according to whether the real measurements are under or over an established threshold, and F 1 , F 2 and F 3 indicate the resulting categorical time series.
The categorized consumptions for kitchen, laundry and heater are the manifest variables used as indicators of the true need of energy for eating, cleaning and heating/cooling which is unobservable directly. The latent real request of energy, in fact, can be lower (higher) than the measured level due, for example, to waste (saving need). Therefore, we model the energy data through an MHMM involving three latent variables with two states and three observable binary variables.
Several hypotheses has been considered to describe the relations among the observable series and the latent factors, but in the sequel we will focus only on those models which better perform in terms of interpretability, parsimony and fitting.
Among the alternatives to the saturated model, a simple and intuitive linked MHMM considers that each of the three observable series of energy consumptions is an indicator of its specific latent variable and the observable variables are locally independent. Regarding the latent model, the three unobservable variables affect each others at the same time but each one depends only on the proper past (no Granger causality and no contemporaneous independence). This linked MHMM (AIC = 5621.251, loglike = −2778.626, par = 32) cannot be preferred to the saturated model. Also the coupled MHMM with every observable variable depending on its own latent variable and with contemporaneous independence and Granger causality among the three latent variables (AIC = 5615.272, loglike = −2777.636, par = 30) is outperformed by the saturated model.
Unfortunately, although combined with other different hypotheses on the latent component of the MHMM, the model restricted under the assumption of a specific effect of each latent variable on one and only one energy consumption series shows an unsatisfactory performance with an higher AIC value than that of the saturated model.
In the following models, the effects of two or more latent variables on the same observable variable will be considered additive as described in the expression (13).
An interesting model with a better fit assumes that: there is a specific effect of one latent variable on the energy consumptions for kitchen and laundry, another latent variable influences the energy consumptions for the heater, and there is a generic effect since a third latent variable affects all the manifest variables. This observation model is combined with the assumption that Granger causality and contemporaneous independence exist among all the latent variables. The model with these restrictions has AIC = 5470.029, loglike = −2702.014, par = 33. Its corresponding mixed-chain graph is reported in Figure 7 on the left.
The MHMM which seems the most suitable for representing the dynamics of the energy consumptions, among several models we fitted, assumes that: the first two latent variables are G-caused reciprocally, the third one depends only on its past, and there is contemporaneous independence among the three latent factors; moreover, there is local independence among the consumptions of the energy for eating, cleaning and airconditioning which seem to depend on all the three latent variables (AIC = 5459.77, loglike = −2707.883, par = 22). Its mixed-chain graph is reported in Figure 7 on the right. This model is nested in an MHMM which shows a similar fit but admits that there is Granger causality among all the latent variables, the other hypotheses being equal (AIC = 5467.374, loglike = −2697.687, par = 36). When the two models are compared, the LRT (LRT = 20.4, df = 14, p − value = 0.118) confirms that the most parsimonious model can be retained coherently with the AIC results.