Skip to main content
Log in

Quantile hidden semi-Markov models for multivariate time series

  • Published:
Statistics and Computing Aims and scope Submit manuscript

Abstract

This paper develops a quantile hidden semi-Markov regression to jointly estimate multiple quantiles for the analysis of multivariate time series. The approach is based upon the Multivariate Asymmetric Laplace (MAL) distribution, which allows to model the quantiles of all univariate conditional distributions of a multivariate response simultaneously, incorporating the correlation structure among the outcomes. Unobserved serial heterogeneity across observations is modeled by introducing regime-dependent parameters that evolve according to a latent finite-state semi-Markov chain. Exploiting the hierarchical representation of the MAL, inference is carried out using an efficient Expectation-Maximization algorithm based on closed form updates for all model parameters, without parametric assumptions about the states’ sojourn distributions. The validity of the proposed methodology is analyzed both by a simulation study and through the empirical analysis of air pollutant concentrations in a small Italian city.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Subscribe and save

Springer+
from $39.99 /Month
  • Starting from 10 chapters or articles per month
  • Access and download chapters and articles from more than 300k books and 2,500 journals
  • Cancel anytime
View plans

Buy Now

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6

Similar content being viewed by others

Notes

  1. The pdf of a GIG(pab) distribution is defined as \(f_{GIG}(x; p,a,b)= \frac{\left( \frac{a}{b}\right) ^{p/2}}{2K_{p}(\sqrt{ab})} x^{p-1} e^{-\frac{1}{2}\left( ax +bx^{-1} \right) }\), with \(a>0\), \(b>0\) and \(p \in {{{\mathcal {R}}}}\).

References

  • Adam, T., Langrock, R., Weiß, C.H.: Penalized estimation of flexible hidden Markov models for time series of counts. Metron 77(2), 87–104 (2019)

    Article  MathSciNet  Google Scholar 

  • Akaike, H.: Information theory and an extension of the maximum likelihood principle, in ‘Selected papers of Hirotugu Akaike’, Springer, pp. 199–213, (1998)

  • Barbu, V. S. and Limnios, N.: Semi-Markov chains and hidden semi-Markov models toward applications: their use in reliability and DNA analysis, Vol. 191, Springer Science & Business Media (2009)

  • Bartolucci, F., Farcomeni, A. and Pennoni, F.: Latent Markov models for longitudinal data, CRC Press, (2012)

  • Bassani, C., Vichi, F., Esposito, G., Montagnoli, M., Giusto, M., Ianniello, A.: Nitrogen dioxide reductions from satellite and surface observations during COVID-19 mitigation in Rome (Italy). Environmental Science and Pollution Research 28(18), 22981–23004 (2021)

    Article  Google Scholar 

  • Bernardi, M., Gayraud, G., Petrella, L., et al.: Bayesian tail risk interdependence using quantile regression. Bayesian Analysis 10(3), 553–603 (2015)

    Article  MathSciNet  Google Scholar 

  • Biernacki, C., Celeux, G., Govaert, G.: Assessing a mixture model for clustering with the integrated completed likelihood. IEEE Transactions on Pattern Analysis and Machine Intelligence 22(7), 719–725 (2000)

    Article  Google Scholar 

  • Browne, R.P., McNicholas, P.D.: A mixture of generalized hyperbolic distributions. Canadian Journal of Statistics 43(2), 176–198 (2015)

    Article  MathSciNet  Google Scholar 

  • Bulla, J., Bulla, I.: Stylized facts of financial time series and hidden semi-Markov models. Computational Statistics & Data Analysis 51(4), 2192–2209 (2006)

    Article  MathSciNet  Google Scholar 

  • Bulla, J., Bulla, I., Nenadić, O.: hsmm-an R package for analyzing hidden semi-Markov models. Computational Statistics & Data Analysis 54(3), 611–619 (2010)

    Article  MathSciNet  Google Scholar 

  • Cappé, O., Moulines, E. and Rydén, T. (2006), Inference in hidden Markov models, Springer Science & Business Media

  • Charlier, I., Paindaveine, D., Saracco, J.: Multiple-output quantile regression through optimal quantization. Scandinavian Journal of Statistics 47(1), 250–278 (2020)

    Article  MathSciNet  Google Scholar 

  • Chavas, J.-P.: On multivariate quantile regression analysis. Statistical Methods & Applications 27(3), 365–384 (2018)

    Article  MathSciNet  Google Scholar 

  • Dannemann, J., Holzmann, H., Leister, A.: Semiparametric hidden Markov models: identifiability and estimation. Wiley Interdisciplinary Reviews: Computational Statistics 6(6), 418–425 (2014)

    Article  Google Scholar 

  • Dempster, A. P., Laird, NM and Rubin, DB.: ‘Maximum likelihood from incomplete data via the EM algorithm’, Journal of the Royal Statistical Society Series B (Methodological) pp. 1–38 (1977)

  • El Ghouch, A., Genton, M.G.: Local polynomial quantile regression with parametric features. J.Am. Stat. Assoc. 104(488), 1416–1429 (2009)

    Article  MathSciNet  Google Scholar 

  • Engle, R.F., Manganelli, S.: CAViaR: conditional autoregressive value at risk by regression quantiles. J. Bus. Econ. Stat. 22(4), 367–381 (2004)

    Article  MathSciNet  Google Scholar 

  • Ephraim, Y., Merhav, N.: Hidden Markov processes. IEEE Trans. Inf. Theor. 48(6), 1518–1569 (2002)

    Article  MathSciNet  Google Scholar 

  • Farcomeni, A.: Quantile regression for longitudinal data based on latent Markov subject-specific parameters. Stat. Comput. 22(1), 141–152 (2012)

    Article  MathSciNet  Google Scholar 

  • Geraci, M.: Modelling and estimation of nonlinear quantile regression with clustered data. Comput. Stat. Data Anal. 136, 30–46 (2019)

    Article  MathSciNet  Google Scholar 

  • Guédon, Y.: Estimating hidden semi-Markov chains from discrete sequences. J. Comput. Graph. Stat. 12(3), 604–639 (2003)

    Article  MathSciNet  Google Scholar 

  • Hamilton, J. D.:‘A new approach to the economic analysis of nonstationary time series and the business cycle’, Econometrica: Journal of the Econometric Society pp. 357–384, (1989)

  • Holzmann, H., Munk, A., Gneiting, T.: Identifiability of finite mixtures of elliptical distributions. Scandinav. J. Stat. 33(4), 753–763 (2006)

    Article  MathSciNet  Google Scholar 

  • Hubert, L., Arabie, P.: Comparing partitions. J. Classif. 2(1), 193–218 (1985)

    Article  Google Scholar 

  • Koenker, R.: Quantile regression. Cambridge University Press (2005)

  • Koenker, R. and Bassett, G.:‘Regression Quantiles’, Econometrica: Journal of the Econometric Society 46(1), 33–50, (1978)

  • Koenker, R., Chernozhukov, V., He, X. and Peng, L.: Handbook of quantile regression, CRC press, (2017)

  • Kong, L. and Mizera, I.: ‘Quantile tomography: using quantiles with multivariate data’, Statistica Sinica pp. 1589–1610, (2012)

  • Kotz, S., Kozubowski, T. and Podgorski, K.:The Laplace distribution and generalizations: a revisit with applications to communications, economics, engineering, and finance, Springer Science & Business Media, (2012)

  • Langrock, R., Kneib, T., Sohn, A., DeRuiter, S.L.: Nonparametric inference in hidden Markov models using P-splines. Biometrics 71(2), 520–528 (2015)

    Article  MathSciNet  Google Scholar 

  • Langrock, R., Zucchini, W.: Hidden Markov models with arbitrary state dwell-time distributions. Comput. Stat. Data Anal. 55(1), 715–724 (2011)

    Article  MathSciNet  Google Scholar 

  • Leroux, B.G.: Maximum-likelihood estimation for hidden Markov models. Stochastic Process. Appl. 40(1), 127–143 (1992)

    Article  MathSciNet  Google Scholar 

  • Levinson, S.E., Rabiner, L.R., Sondhi, M.M.: An introduction to the application of the theory of probabilistic functions of a Markov process to automatic speech recognition. Bell Syst. Tech. J. 62(4), 1035–1074 (1983)

    Article  MathSciNet  Google Scholar 

  • Luo, Y., Lian, H., Tian, M.: Bayesian quantile regression for longitudinal data models. J. Stat. Comput. Simul. 82(11), 1635–1649 (2012)

    Article  MathSciNet  Google Scholar 

  • MacDonald, I. L. and Zucchini, W.:Hidden Markov and other models for discrete-valued time series, Vol. 110, CRC Press (1997)

  • Marino, M.F., Tzavidis, N., Alfò, M.: Mixed hidden Markov quantile regression models for longitudinal data with possibly incomplete sequences. Stat. Methods Med. Res 27(7), 2231–2246 (2018)

    Article  MathSciNet  Google Scholar 

  • Maruotti, A.: Mixed hidden Markov models for longitudinal data: an overview. Int. Stat. Rev. 79(3), 427–454 (2011)

    Article  Google Scholar 

  • Maruotti, A., Bulla, J., Lagona, F., Picone, M. and Martella, F.:‘Dynamic mixtures of factor analyzers to characterize multivariate air pollutant exposures’, The Annals of Applied Statistics pp. 1617–1648,(2017)

  • Maruotti, A., Petrella, L., Sposito, L.: Hidden semi-Markov-switching quantile regression for time series. Compu. Stati. Data Anal. 159, 107208 (2021)

    Article  MathSciNet  Google Scholar 

  • Maruotti, A., Punzo, A.: Initialization of hidden Markov and semi-Markov models: a critical evaluation of several strategies. Int. Stat. Rev. 89(3), 447–480 (2021)

    Article  MathSciNet  Google Scholar 

  • Maruotti, A., Punzo, A., Bagnato, L.: Hidden Markov and semi-Markov models with multivariate leptokurtic-normal components for robust modeling of daily returns series. J. Financ. Econom. 17(1), 91–117 (2019)

    Google Scholar 

  • Merlo, L., Petrella, L., Raponi, V.: Forecasting VaR and ES using a joint quantile regression and its implications in portfolio allocation. J. Bank. Finan. 133, 106248 (2021)

    Article  Google Scholar 

  • Merlo, L., Petrella, L., Salvati, N., Tzavidis, N.: Marginal M-quantile regression for multivariate dependent data. Comput. Stat. Data Anal. 173, 107500 (2022)

    Article  MathSciNet  Google Scholar 

  • Merlo, L., Petrella, L., Tzavidis, N.: ‘Quantile mixed hidden Markov models for multivariate longitudinal data: an application to children’s Strengths and Difficulties Questionnaire scores’, Journal of the Royal Statistical Society. Ser. C Appl. Stat. 71(2), 417–448 (2022)

    Article  MathSciNet  Google Scholar 

  • O’Connell, J., Højsgaard, S., et al.: Hidden semi Markov models for multiple observation sequences: the mhsmm package for R. J. Stat. Softw. 39(4), 1–22 (2011)

    Google Scholar 

  • Petrella, L., Raponi, V.: Joint estimation of conditional quantiles in multivariate linear regression models with an application to financial distress. J. Multivar. Anal. 173, 70–84 (2019)

    Article  MathSciNet  Google Scholar 

  • Pohle, J., Adam, T., Beumer, L.T.: Flexible estimation of the state dwell-time distribution in hidden semi-Markov models. Comput. Stat. Data Anal. 172, 107479 (2022)

    Article  MathSciNet  Google Scholar 

  • Pohle, J., Langrock, R., van Beest, F.M., Schmidt, N.M.: Selecting the number of states in hidden Markov models: pragmatic solutions illustrated using animal movement. J. Agric Biol. Environ. Stat. 22(3), 270–293 (2017)

    Article  MathSciNet  Google Scholar 

  • Putaud, J.-P., Pozzoli, L., Pisoni, E., Martins Dos Santos, S., Lagler, F., Lanzani, G., Dal Santo, U., Colette, A.: Impacts of the COVID-19 lockdown on air pollution at regional and urban background sites in northern Italy. Atmosp. Chem. Phys. 21(10), 7597–7609 (2021)

    Article  Google Scholar 

  • Sansom, J. and Thomson, P. (2001), ‘Fitting hidden semi-Markov models to breakpoint rainfall data’, Journal of Applied Probability 38(A), 142–157

  • Schwarz, G., et al.: Estimating the dimension of a model. Anna. Stat. 6(2), 461–464 (1978)

  • Serfling, R.: Quantile functions for multivariate analysis: approaches and applications. Statist. Neerlandica 56(2), 214–232 (2002)

    Article  MathSciNet  Google Scholar 

  • Stolfi, P., Bernardi, M. and Petrella, L.: ‘The sparse method of simulated quantiles: An application to portfolio optimization’, Statistica Neerlandica (2018),

  • Visser, I., Raijmakers, M.E., Molenaar, P.C.: Confidence intervals for hidden Markov model parameters. Br. J. Math. Statist. Psychol. 53(2), 317–327 (2000)

    Article  Google Scholar 

  • Ye, W., Zhu, Y., Wu, Y. and Miao, B.: ‘Markov regime-switching quantile regression models and financial contagion detection’, Insurance: Mathematics and Economics 67, 21–26,(2016)

  • Yu, K., Moyeed, R.A.: Bayesian quantile regression. Stat. Probab. Lett. 54(4), 437–447 (2001)

    Article  MathSciNet  Google Scholar 

  • Yu, K., Zhang, J.: A three-parameter asymmetric Laplace distribution and its extension. Commun. Statist. Theory Methods 34(9–10), 1867–1879 (2005)

    Article  MathSciNet  Google Scholar 

  • Yu, S.-Z.: Hidden Semi-Markov models: theory, algorithms and applications. Morgan Kaufmann (2015)

  • Zucchini, W., MacDonald, I. L. and Langrock, R.: Hidden Markov models for time series: an introduction using R, Chapman and Hall CRC (2016)

Download references

Acknowledgements

We would like to warmly thank the Associate Editor and two anonymous reviewers for their thoughtful comments and efforts towards improving our manuscript. This work was partially supported by the Finance Market Fund, Norway, project number 309218; “Statistical modelling and inference for (high-dimensional) financial data”.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Luca Merlo.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Supplementary Information

Below is the link to the electronic supplementary material.

Supplementary file 1 (pdf 1604 KB)

Appendix

Appendix

Proof of Proposition 1

Firstly, we note that to ensure identifiability of the MAL density in (5) it suffices to apply Proposition 1 of Petrella and Raponi (2019). Secondly, for a general HSMM, identifiability has been proven up to label switching (Leroux 1992). Thus, to ensure identifiability, all one needs to prove is the identifiability of the marginal mixtures (Dannemann et al. 2014), which in our case are represented by the finite mixtures of MAL distributions. Based on the work of Holzmann et al. (2006), Browne and McNicholas (2015) prove identifiability of finite mixtures of multivariate generalized hyperbolic distributions. Since the MAL in (5) is a limiting case of the multivariate generalized hyperbolic distribution (see (3) and (4) in Browne and McNicholas (2015) with \(\lambda = 1, \psi = 2\) and \(\chi \rightarrow 0\)), model identifiability follows by applying Corollary 2 of Browne and McNicholas (2015).

Proof of Proposition 2

The E-step of the EM algorithm considers the conditional expectation of the complete log-likelihood function in (8) given the observed data and the current parameter estimates \(\hat{{\varvec{\Phi }}}^{(r-1)}_{\varvec{\tau }}\). At first, we recall that under the constraints imposed on \({\varvec{\tilde{\xi }}}\) and \(\varvec{\Lambda }\), the representation in (7) implies that:

$$\begin{aligned} \mathbf{Y}\mid {\tilde{l}} = {\tilde{c}} \sim {{{\mathcal {N}}}}_p(\varvec{\mu } + \mathbf{D}\tilde{{\varvec{\xi }}} {\tilde{c}} \, , \, {\tilde{c}} \mathbf{D}{ {\varvec{\Sigma }}} \mathbf{D}), \qquad {\tilde{C}} \sim \text {Exp} (1). \end{aligned}$$
(35)

This means that the joint density function of \(\mathbf{Y}\) and \({\tilde{C}}\) is:

$$\begin{aligned} f_{\mathbf{Y},{\tilde{C}}}(\mathbf{y},{\tilde{c}})= & {} \frac{\exp {\left\{ (\mathbf{y}- \varvec{\mu }) ' \mathbf{D}^{-1}{\varvec{\Sigma }}^{-1} \tilde{{\varvec{\xi }}} \right\} }}{(2 \pi )^{p/2} \mid \mathbf{D}{ {\varvec{\Sigma }}} \mathbf{D}\mid ^{1/2}}\nonumber \\&\left( {\tilde{c}}^{-p/2} \exp {\left\{ -\frac{1}{2} \frac{\tilde{m}}{{\tilde{c}}} - \frac{1}{2} {\tilde{c}} ({\tilde{d}} +2) \right\} }\right) . \end{aligned}$$
(36)

By substituting (36) in (8) and taking the conditional expectation of the logarithm of (8), we obtain the expected complete log-likelihood function in (13).

To compute the conditional expectation of \({\tilde{c}}_{tk}\) and \({\tilde{z}}_{tk}\) in (13), \({\tilde{C}}\) is treated as an additional latent variable. Using the joint distribution of \(\mathbf{Y}\) and \({\tilde{C}}\) derived in (36) and the MAL density of \(\mathbf{Y}\) given in (5), we have that:

$$\begin{aligned} f_{{\tilde{C}}}({\tilde{C}} \mid \mathbf{Y}= & {} \mathbf{y}) = \frac{f_{{\tilde{C}},\mathbf{Y}}({\tilde{c}},\mathbf{y})}{f_{\mathbf{Y}}(\mathbf{y})} \nonumber \\= & {} \frac{{\tilde{c}}^{-p/2} \left( \frac{2+{\tilde{d}}}{{\tilde{m}}} \right) ^{\nu /2} \exp {\left\{ -\frac{{\tilde{m}}}{2 {\tilde{c}}}- \frac{{\tilde{c}} (2+{\tilde{d}})}{2} \right\} }}{2 K_{\nu }\left( \sqrt{(2+{\tilde{d}}){\tilde{m}}} \right) }, \end{aligned}$$
(37)

which corresponds to a Generalized Inverse Gaussian (GIG) distribution with parameters \(\nu , {2+{\tilde{d}}}, \tilde{m_i}\), i.e.Footnote 1

$$\begin{aligned} f_{{\tilde{C}}}({\tilde{C}} \mid \mathbf{Y}= \mathbf{y}) \sim \text{ GIG }\left( \nu , {\tilde{d}}+2, \tilde{m}\right) . \end{aligned}$$
(38)

Then, it follows that

$$\begin{aligned} {\mathbb {E}}[{\tilde{C}} \mid \cdot ] = \left( \frac{\hat{\tilde{m}}}{2+\hat{{\tilde{d}}}} \right) ^{\frac{1}{2}} \frac{K_{\nu +1}\left( \sqrt{(2+\hat{{\tilde{d}}})\hat{\tilde{m}}} \right) }{K_{\nu }\left( \sqrt{(2+\hat{{\tilde{d}}}) \hat{\tilde{m}}}\right) } \end{aligned}$$
(39)

and

$$\begin{aligned} {\mathbb {E}}[{\tilde{C}}^{-1} \mid \cdot ] = \left( \frac{2+\hat{\tilde{d}}}{\hat{\tilde{m}}} \right) ^{\frac{1}{2}} \frac{K_{\nu +1} \left( \sqrt{(2+\hat{{\tilde{d}}})\hat{\tilde{m}}} \right) }{K_{\nu } \left( \sqrt{(2+\hat{{\tilde{d}}})\hat{\tilde{m}}} \right) } - \frac{2 \nu }{\hat{\tilde{m}}}. \end{aligned}$$
(40)

Denoting the two conditional expectations in (39) and (40) by \(\hat{{\tilde{c}}}\) and \(\hat{{\tilde{z}}}\) respectively, concludes the proof.

Proof of Proposition 3

Imposing the first order conditions on (13) with respect to each component of the set \({\varvec{\Phi }}_{\varvec{\tau }}\), gives the update estimates in (16), (17), (18) and (19). However, there is not closed formula solution to update the elements of the scale matrix \(\mathbf{D}_j\); hence, the M-step update requires using numerical optimization techniques to maximize (13). A considerable disadvantage of this procedure is the necessary high computational effort which could be very time-consuming. For this reason, we utilize a simpler estimator for the scale parameters \(\delta _{jk}, k = 1,\dots ,p\), which follows directly from the fact that all marginals of the MAL distribution are univariate AL distributions (see Yu and Zhang 2005):

$$\begin{aligned} \hat{\delta }_{jk} = \frac{1}{T} \sum _{t=1}^{T} {\hat{\gamma }}_{tj} \rho _\tau (Y_{t}^{(k)} - \hat{{\mu }}_{tjk}), \end{aligned}$$
(41)

where \(\hat{{\mu }}_{tjk}\) is the k-th element of the vector \(\hat{\varvec{\mu }}_{tj}\).

Rights and permissions

Springer Nature or its licensor holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Springer Nature or its licensor holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Merlo, L., Maruotti, A., Petrella, L. et al. Quantile hidden semi-Markov models for multivariate time series. Stat Comput 32, 61 (2022). https://doi.org/10.1007/s11222-022-10130-1

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s11222-022-10130-1

Keywords