<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.3 20210610//EN" "https://jats.nlm.nih.gov/publishing/1.3/JATS-journalpublishing1-3.dtd"><article xml:lang="en" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ali="http://www.niso.org/schemas/ali/1.0/" dtd-version="1.3" article-type="research-article"><front><journal-meta><journal-id journal-id-type="issn">2460-0245</journal-id><journal-title-group><journal-title>Journal of the Indonesian Mathematical Society</journal-title><abbrev-journal-title>JIMS</abbrev-journal-title></journal-title-group><issn pub-type="epub">2460-0245</issn><issn pub-type="ppub">2086-8952</issn><publisher><publisher-name>IndoMS</publisher-name><publisher-loc>Indonesia</publisher-loc></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.22342/jims.v32i3.1986</article-id><article-categories><subj-group><subject>Mathematics Subject Classification</subject></subj-group></article-categories><title-group><article-title>Modelling The US Dollar Index Using Continuous Hidden Markov</article-title><subtitle>Pemodelan Indeks  Dolar Amerika AS Menggunakan Metode Markov Tersembunyi Kontinu</subtitle></title-group><contrib-group><contrib contrib-type="author"><name><surname>Martal</surname><given-names>David Vijanarco</given-names></name><address><country country="ID">Indonesia</country><email>davidvijanarcomartal@apps.ipb.ac.id</email></address><xref ref-type="aff" rid="AFF-1"></xref></contrib><contrib contrib-type="author"><contrib-id contrib-id-type="orcid">https://orcid.org/0009-0002-1334-6652</contrib-id><name><surname>Setiawaty</surname><given-names>Berlian</given-names></name><address><country country="ID">Indonesia</country><email>berlianse@apps.ipb.ac.id</email></address><xref ref-type="aff" rid="AFF-1"></xref><xref ref-type="corresp" rid="cor-0"></xref></contrib><contrib contrib-type="author"><name><surname>Budiarti</surname><given-names>Retno</given-names></name><address><country country="ID">Indonesia</country><email>retnobu@apps.ipb.ac.id</email></address><xref ref-type="aff" rid="AFF-1"></xref></contrib></contrib-group><contrib-group><contrib contrib-type="editor"><name><surname>Wijayanti</surname><given-names>Indah Emilia</given-names></name><address><country country="ID">Indonesia</country><email>ind_wijayanti@ugm.ac.id</email></address><xref ref-type="aff" rid="EDITOR-AFF-1"></xref></contrib></contrib-group><aff id="AFF-1"><institution content-type="dept">School of Data Science, Mathematics and Informatics</institution><institution-wrap><institution>IPB University</institution><institution-id institution-id-type="ror">https://ror.org/05smgpd89</institution-id></institution-wrap><country country="ID">Indonesia</country></aff><aff id="EDITOR-AFF-1"><institution-wrap><institution>Universitas Gadjah Mada</institution><institution-id institution-id-type="ror">https://ror.org/03ke6d638</institution-id></institution-wrap><country country="ID">Indonesia</country></aff><author-notes><fn fn-type="coi-statement"><label>Conflicts of Interest.</label><p>The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.</p></fn><corresp id="cor-0">Corresponding author: Berlian Setiawaty. Email: <email>berlianse@apps.ipb.ac.id</email></corresp></author-notes><pub-date date-type="pub" iso-8601-date="2026-09-01" publication-format="electronic"><day>01</day><month>09</month><year>2026</year></pub-date><pub-date date-type="collection" iso-8601-date="2026-09-01" publication-format="electronic"><day>01</day><month>09</month><year>2026</year></pub-date><volume>32</volume><issue>3</issue><issue-title>SEPTEMBER</issue-title><fpage>1</fpage><lpage>18</lpage><elocation-id> 60J20, 62P05, 91G15.</elocation-id><history><date date-type="received" iso-8601-date="2025-03-22"><day>22</day><month>03</month><year>2025</year></date><date date-type="accepted" iso-8601-date="2026-02-14"><day>14</day><month>02</month><year>2026</year></date></history><permissions><copyright-statement>Copyright (c) 2026 Journal of the Indonesian Mathematical Society</copyright-statement><copyright-year>2026</copyright-year><copyright-holder>Journal of the Indonesian Mathematical Society</copyright-holder><license license-type="open-access" xlink:href="https://creativecommons.org/licenses/by-nc-nd/4.0/"><ali:license_ref xmlns:ali="http://www.niso.org/schemas/ali/1.0/">https://creativecommons.org/licenses/by-nc-nd/4.0/</ali:license_ref><license-p>This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.</license-p></license></permissions><self-uri xlink:href="https://jims-a.org/index.php/jimsa/article/view/1986" xlink:title="1986"></self-uri><abstract><p>This study employs the continuous hidden Markov model (HMM) to model the index data of the US Dollar index from 2018 to 2024. HMM is used to predict and analyze hidden patterns that generated the data. The data is modelled using a continuous HMM with 11 hidden states and lognormal distributions with different parameters for each hidden state. The accuracy of the continuous HMM is measured by MAPE. The MAPE value for both training and testing data is very low, less than 4%. This means that the continuous HMM can be used to model the data accurately. The plot shows accurate predictions between simulated data and real data, and furthermore, the model can capture the fluctuations of the data.</p></abstract><kwd-group><kwd>US Dollar index</kwd><kwd>Continuous hidden Markov model</kwd><kwd>price prediction</kwd></kwd-group><funding-group><funding-statement>This research was funded by School of Data Science, Mathematics, and Informatics, IPB University.</funding-statement></funding-group><custom-meta-group><custom-meta><meta-name>File created by JATS Editor</meta-name><meta-value>https://jatseditor.com</meta-value></custom-meta><custom-meta><meta-name>issue-created-year</meta-name><meta-value>2026</meta-value></custom-meta></custom-meta-group></article-meta></front><body><sec id="sec-1"><title>1. INTRODUCTION</title><p>The US Dollar index (USDX) is an indicator that reflects the price of US Dollar futures contracts against several major world currencies, such as the Euro (EUR), Japanese Yen (JPY), British Pound Sterling (GBP), Canadian Dollar (CAD), Swedish Krona (SEK), and Swiss Franc (CHF). The fluctuations in the value of the US Dollar index can provide clues about the strength of the US economy, Federal Reserve monetary policy, and market sentiment towards the currency. As a crucial variable in international finance, exchange rates have a significant impact on decision-making in international financial markets. For example, the crude oil trade is denominated in the US Dollar. The changes in the US Dollar index have a direct impact on crude oil prices <xref ref-type="bibr" rid="BIBR-1">[1]</xref>.  Initially, futures contracts were commonlyused by hedgers or traders to hedge against the commodities they traded.  However,over time, the high volatility in commodity futures markets has been exploited byspeculators, also known as traders, to gain financial profits.  Futures contracts in futures exchanges are alternative investment instruments that investors can use togain profits and minimize risks when they receive new information <xref ref-type="bibr" rid="BIBR-2">[2]</xref>.  Informationfrom currency futures markets, including the US Dollar index, can be used to fore-cast exchange rate movements and their implications in economic decision-making <xref ref-type="bibr" rid="BIBR-3">[3]</xref>.</p><p>Research on this index is important because exchange rate fluctuations couldinfluence economic activity on global financial markets and international trade ac-tivities <xref ref-type="bibr" rid="BIBR-4">[4]</xref>.  Modelling the US Dollar index is crucial for the financial market,  asit  provides  valuable  insights  for  stakeholders  in  managing  currency  risk,  makinginformed investment decisions, and planning effective business strategies.  By un-derstanding the dynamics and predicting the movement of the US Dollar, marketparticipants can anticipate currency volatility, manage currency risk exposure, andmake  smarter  asset  allocation  decisions.   The  US  Dollar  index  was  recently  re-searched to see its impact during the Covid-19 crisis <xref ref-type="bibr" rid="BIBR-5">[5]</xref>.  Previous research has alsoshown a relationship between the US Dollar Index and other financial factors, suchas the S&amp;P 500 index <xref ref-type="bibr" rid="BIBR-6">[6]</xref>.  The US Dollar index can be modelled using historicaldata by examining the factors influencing it.  One model that can be used is thehidden Markov model (HMM). This model uses hidden states to represent marketconditions.  In this model, a sequence of observations is inferred using sequences ofhidden states.</p><p>Besides HMM-based approaches, several other statistical and machine learn-ing methods have been applied to model or forecast the US Dollar index.  Timeseries models, such as autoregressive integrated moving average (ARIMA) and ge-neralized autoregressive conditional heteroskedasticity (GARCH), have been usedto study future trends formed by the Dollar Index <xref ref-type="bibr" rid="BIBR-7">[7]</xref>.  In addition, various machinelearning methods,  such as random forest,  support vector machines,  and artificialneural networks, have been utilized and compared in predicting the US Dollar Index <xref ref-type="bibr" rid="BIBR-8">[8]</xref>.  Moreover, hybrid models that combine statistical and deep learning methodshave shown improved predictive performance in modelling complex financial indi-cators, such as the US Dollar index <xref ref-type="bibr" rid="BIBR-9">[9]</xref>.  These diverse approaches demonstrate thatvarious  modelling  frameworks  can  be  utilized  to  understand  and  forecast  USDXdynamics, depending on the research objective and data characteristics.  However,the  utilization  of  trend  changes  based  on  probabilistic  approaches  has  not  beenextensively explored.</p><p>The hidden Markov model has been widely used in the past, such as in mea-suring earning quality <xref ref-type="bibr" rid="BIBR-10">[10]</xref>,  sleep monitoring for physical conditions <xref ref-type="bibr" rid="BIBR-11">[11]</xref>,  electro-cardiogram (ECG) analysis <xref ref-type="bibr" rid="BIBR-12">[12]</xref>, and seismic analysis <xref ref-type="bibr" rid="BIBR-13">[13]</xref>.  In biochemistry, HMMhas been used to model diploid plant crossing <xref ref-type="bibr" rid="BIBR-14">[14]</xref>.  Another application of HMMincludes researching the progression of dementia <xref ref-type="bibr" rid="BIBR-15">[15]</xref>.  In finance, HMM has beenused to construct portfolios and asset allocation <xref ref-type="bibr" rid="BIBR-16">[16]</xref>.  In <xref ref-type="bibr" rid="BIBR-17">[17]</xref>, HMM has been sys-tematically reviewed in terms of its applications and development in various fields.This approach can also be applied to other historical data, such as US dollar indexdata.</p><p>A hidden Markov model is based on a set of unobserved (hidden) states which form a Markov chain and each state is associated with a set of possible observations. Hidden Markov models are categorised into two types: discrete HMMs, which are used for discrete observation sequences, and continuous HMMs, which are used for continuous observation sequences. This study models the data of the US Dollar index using a continuous HMM. This choice is made because the USDX data are continuous-valued time series, making the continuous HMM framework more appropriate for capturing the probabilistic structure of such data. The data used consists of the closing index of the US Dollar index from January 1, 2018, to February 29, 2024.</p><p>This paper presents the development of a continuous hidden Markov model (HMM) in detail. The modelling process involves several algorithms whose formulations and implementation steps are also described. The analysis focuses on how the resulting model captures the movement patterns derived from the data and how the best-performing continuous HMM is identified for specific test data ranges. Furthermore, the results and discussion sections provide an in-depth examination of the model's performance and behaviour based on the simulated data. Finally, the paper concludes with a summary of the main findings, an overview of the study's limitations, and potential directions for future research and improvement.</p></sec><sec id="sec-2"><title>2. CONTINUOUS HIDDEN MARKOV MODELS</title><p>According to <xref ref-type="bibr" rid="BIBR-18">[18]</xref>, a hidden Markov model (HMM) consist of a pair of discrete-time stochastic processes <inline-formula><tex-math id="math-1"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \{(X_{t}, O_{t}) : t \in \mathbb{N}\} \end{document} ]]></tex-math></inline-formula> . <inline-formula><tex-math id="math-2"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \{X_{t}\} \end{document} ]]></tex-math></inline-formula> which has a state space <inline-formula><tex-math id="math-3"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle S_{X} = \{1, 2, \ldots, N\} \end{document} ]]></tex-math></inline-formula> , represents a collection of unobserved states that form a Markov chain. So <inline-formula><tex-math id="math-4"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \{X_{t}\} \end{document} ]]></tex-math></inline-formula> is hidden behind an observation process <inline-formula><tex-math id="math-5"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \{O_{t}\} \end{document} ]]></tex-math></inline-formula> . Based on the type of the observations, hidden Markov models are divided into two types, discrete HMMs and continuous HMMs.</p><p>For a continuous hidden Markov model, <inline-formula><tex-math id="math-6"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle O_{t} \end{document} ]]></tex-math></inline-formula> is a continuous random variable and conditional distributions of <inline-formula><tex-math id="math-7"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle O_{t} \mid X_{t} = i \end{document} ]]></tex-math></inline-formula> , for <inline-formula><tex-math id="math-8"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle i = 1, 2, \ldots, N \end{document} ]]></tex-math></inline-formula> come from a certain family of parametric distributions. A continuous hidden Markov model is characterized by the parameter <inline-formula><tex-math id="math-9"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \lambda = (A, \theta, \pi) \end{document} ]]></tex-math></inline-formula><xref ref-type="bibr" rid="BIBR-14">[14]</xref> which has the following properties.</p><p>(a) <inline-formula><tex-math id="math-10"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle A = [a_{ij}]_{N \times N} \end{document} ]]></tex-math></inline-formula> is a transition probability matrix, with <inline-formula><tex-math id="math-11"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle a_{ij} = P(X_{t+1} = j \mid X_t = i) \end{document} ]]></tex-math></inline-formula> , for <inline-formula><tex-math id="math-12"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle i, j = 1, 2, \ldots, N \end{document} ]]></tex-math></inline-formula> and <inline-formula><tex-math id="math-13"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \sum_{j=1}^{N} a_{ij} = 1 \end{document} ]]></tex-math></inline-formula> , for <inline-formula><tex-math id="math-14"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle i = 1, 2, \ldots, N \end{document} ]]></tex-math></inline-formula> .</p><p>(b) <inline-formula><tex-math id="math-15"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \theta = [f(o_t \mid \theta_i)]_{N \times 1} \end{document} ]]></tex-math></inline-formula> is a probability density function matrix, with <inline-formula><tex-math id="math-16"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle f(o_t \mid \theta_i) \end{document} ]]></tex-math></inline-formula> is the conditional probability density function of <inline-formula><tex-math id="math-17"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle O_t \mid X_t = i \end{document} ]]></tex-math></inline-formula> , for <inline-formula><tex-math id="math-18"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle i = 1, 2, \ldots, N \end{document} ]]></tex-math></inline-formula> .</p><p>(c) <inline-formula><tex-math id="math-19"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \pi = [\pi_i]_{N\times 1} \end{document} ]]></tex-math></inline-formula> is an initial probability matrix, with <inline-formula><tex-math id="math-20"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \pi_i = P(X_1 = i) \end{document} ]]></tex-math></inline-formula> for <inline-formula><tex-math id="math-21"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle i = 1,2,\ldots ,N \end{document} ]]></tex-math></inline-formula> and <inline-formula><tex-math id="math-22"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \sum_{i = 1}^{N}\pi_{i} = 1 \end{document} ]]></tex-math></inline-formula> .</p><p>To estimate the parameters <inline-formula><tex-math id="math-23"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \lambda = (A, \theta, \pi) \end{document} ]]></tex-math></inline-formula> from observations <inline-formula><tex-math id="math-24"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle o_{1}, o_{2}, \ldots, o_{T} \end{document} ]]></tex-math></inline-formula> , the forward-backward algorithm, the Viterbi algorithm, and the Baum-Welch algorithm are used <xref ref-type="bibr" rid="BIBR-18">[18]</xref>.</p><sec id="sec-3"><title>2.1. The Forward-Backward Algorithm.</title><p>Based on the characteristic of hidden Markov model, the joint probability density function of <inline-formula><tex-math id="math-25"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle o_{1}, o_{2}, \ldots, o_{T} \end{document} ]]></tex-math></inline-formula> given <inline-formula><tex-math id="math-26"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \lambda = (A, \theta, \pi) \end{document} ]]></tex-math></inline-formula> is</p><disp-formula id="equation-1"><tex-math id="math-27"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle p \left(o _ {1}, o _ {2}, \dots , o _ {T} \mid \lambda\right) = \sum_ {x _ {1}, x _ {2}, \dots , x _ {T} = 1} ^ {N} \left[ \prod_ {i = 2} ^ {T} f \left(o _ {i} \mid \theta_ {x _ {i}}\right) a _ {x _ {i - 1} x _ {i}} \right] f \left(o _ {1} \mid \theta_ {x _ {1}}\right) \pi_ {x _ {1}}.\tag{1} \end{document} ]]></tex-math></disp-formula><p>For calculating this joint probability, <xref ref-type="bibr" rid="BIBR-19">[19]</xref> defines a forward variable for <inline-formula><tex-math id="math-28"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle t = 1,2,\ldots ,T \end{document} ]]></tex-math></inline-formula> ,</p><disp-formula id="equation-2"><tex-math id="math-29"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \alpha_ {t} (x _ {t}) = p \left(o _ {1}, o _ {2}, \dots , o _ {T}, x _ {t} \mid \lambda\right), \quad x _ {t} = 1, 2, \dots , N.\tag{2} \end{document} ]]></tex-math></disp-formula><p>According to <xref ref-type="bibr" rid="BIBR-19">[19]</xref>, these are the steps of the forward-backward algorithm.</p><p>(1) Initialization</p><disp-formula id="equation-3"><tex-math id="math-30"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \alpha_ {1} (x _ {1}) = p \left(o _ {1}, x _ {1} \mid \lambda\right) = \pi_ {x _ {1}} f \left(o _ {1} \mid \theta_ {x _ {1}}\right), \quad x _ {1} = 1, 2, \dots , N. \end{document} ]]></tex-math></disp-formula><p>(2) Induction for <inline-formula><tex-math id="math-31"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle t = 1,2,\ldots ,T - 1 \end{document} ]]></tex-math></inline-formula> ,</p><disp-formula id="equation-4"><tex-math id="math-32"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \alpha_ {t + 1} (x _ {t + 1}) = \left[ \sum_ {x _ {t} = 1} ^ {N} \alpha_ {t} (x _ {t}) a _ {x _ {t} x _ {t + 1}} \right] f (o _ {t + 1} \mid \theta_ {x _ {t + 1}}), \quad x _ {t + 1} = 1, 2, \dots , N. \end{document} ]]></tex-math></disp-formula><p>(3) Termination</p><disp-formula id="equation-5"><tex-math id="math-33"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \alpha_ {T} (x _ {T}) = p (o _ {1}, o _ {2}, \ldots , o _ {T}, x _ {T} \mid \lambda), \quad x _ {T} = 1, 2, \ldots , N, \end{document} ]]></tex-math></disp-formula><p>so that</p><disp-formula id="equation-6"><tex-math id="math-34"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle p (o _ {1}, o _ {2}, \dots , o _ {T} \mid \lambda) = \sum_ {x _ {T} = 1} ^ {N} \alpha_ {T} (x _ {T}). \end{document} ]]></tex-math></disp-formula><p>To calculate the joint probability in equation 1, we can also use a backward algorithm. According to <xref ref-type="bibr" rid="BIBR-20">[20]</xref>, for <inline-formula><tex-math id="math-35"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle t = T - 1, T - 2, \ldots, 0 \end{document} ]]></tex-math></inline-formula> , define a backward variable</p><disp-formula id="equation-7"><tex-math id="math-36"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \beta_ {t} (x _ {t}) = p (o _ {t + 1}, o _ {t + 2}, \ldots , o _ {T} \mid x _ {t}, \lambda), \quad x _ {t} = 1, 2, \ldots , N.\tag{3} \end{document} ]]></tex-math></disp-formula><p>From <xref ref-type="bibr" rid="BIBR-21">[21]</xref>, these are the steps that need to be taken in using backward algorithm.</p><p>(1) Initialization</p><disp-formula id="equation-8"><tex-math id="math-37"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \beta_ {T} (x _ {T}) = 1, \quad x _ {T} = 1, 2, \dots , N. \end{document} ]]></tex-math></disp-formula><p>(2) induction</p><disp-formula id="equation-9"><tex-math id="math-38"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \beta_ {t} (x _ {t}) = \sum_ {x _ {t + 1} = 1} ^ {N} a _ {x _ {t} x _ {t + 1}} f (o _ {t + 1} \mid \theta_ {x _ {t + 1}}) \beta_ {t + 1} (x _ {t + 1}), \quad t = T - 1, T - 2, \dots , 1. \end{document} ]]></tex-math></disp-formula><p>(3) Termination</p><disp-formula id="equation-10"><tex-math id="math-39"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle p (o _ {1}, o _ {2}, \dots , o _ {T} \mid \lambda) = \sum_ {x _ {1} = 1} ^ {N} f (o _ {1} \mid \theta_ {x _ {1}}) \pi_ {x _ {1}} \beta_ {1} (x _ {1}). \end{document} ]]></tex-math></disp-formula><p>Using the forward-backward variables in equation <xref ref-type="disp-formula" rid="equation-2">(2)</xref> and <xref ref-type="disp-formula" rid="equation-7">(3)</xref>, the joint probability of <inline-formula><tex-math id="math-40"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle o_{1}, o_{2}, \ldots, o_{T} \end{document} ]]></tex-math></inline-formula> given <inline-formula><tex-math id="math-41"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \lambda \end{document} ]]></tex-math></inline-formula> can be calculated as</p><disp-formula id="equation-11"><tex-math id="math-42"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \begin{array}{r c l} p \left(o _ {1}, o _ {2}, \dots , o _ {T} \mid \lambda\right) & = & \sum_ {x _ {t} = 1} ^ {N} p \left(o _ {1}, o _ {2}, \dots , o _ {t}, x _ {t}, o _ {t + 1}, o _ {t + 2}, \dots , o _ {T} \mid \lambda\right) \\ & = & \sum_ {x _ {t} = 1} ^ {N} p \left(o _ {1}, o _ {2}, \dots , o _ {t} \mid x _ {t}, \lambda\right) p \left(o _ {t + 1}, o _ {t + 2}, \dots , o _ {T} \mid x _ {t}, \lambda\right) p \left(x _ {t} \mid \lambda\right) \\ & = & \sum_ {x _ {t} = 1} ^ {N} p \left(o _ {1}, o _ {2}, \dots , o _ {t}, x _ {t} \mid \lambda\right) p \left(o _ {t + 1}, o _ {t + 2}, \dots , o _ {T} \mid x _ {t}, \lambda\right) \\ & = & \sum_ {x _ {t} = 1} ^ {N} \alpha_ {t} \left(x _ {t}\right) \beta_ {t} \left(x _ {t}\right). \end{array} \tag {4} \end{document} ]]></tex-math></disp-formula></sec><sec id="sec-4"><title>2.2. The Viterbi Algorithm.</title><p>The Viterbi algorithm is used to determine the most optimal hidden state sequence <inline-formula><tex-math id="math-43"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle x_{1}^{*}, x_{2}^{*}, \ldots, x_{T}^{*} \end{document} ]]></tex-math></inline-formula> with generated observations <inline-formula><tex-math id="math-44"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle o_{1}, o_{2}, \ldots, o_{T} \end{document} ]]></tex-math></inline-formula> . In other words</p><disp-formula id="equation-12"><tex-math id="math-45"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle p (o _ {1}, o _ {2}, \dots , o _ {T}, x _ {1} ^ {*}, x _ {2} ^ {*}, \dots , x _ {T} ^ {*} \mid \lambda) = \max _ {x _ {1}, x _ {2}, \dots , x _ {T}} p (o _ {1}, o _ {2}, \dots , o _ {T}, x _ {1}, x _ {2}, \dots , x _ {T} \mid \lambda). \end{document} ]]></tex-math></disp-formula><p>The Viterbi algorithm keeps track of states in every step to predict most probable state sequence. The algorithm is as follows.</p><p>According to <xref ref-type="bibr" rid="BIBR-22">[22]</xref>, defined <inline-formula><tex-math id="math-46"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \delta_t(x_t) \end{document} ]]></tex-math></inline-formula> for <inline-formula><tex-math id="math-47"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle t = 1,2,\ldots,T \end{document} ]]></tex-math></inline-formula> as</p><disp-formula id="equation-13"><tex-math id="math-48"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \delta_ {t} (x _ {t}) = \max _ {x _ {1}, x _ {2}, \dots , x _ {t - 1}} p (o _ {1}, o _ {2}, \dots , o _ {t}, x _ {1}, x _ {2}, \dots , x _ {t} \mid \lambda), \quad x _ {t} = 1, 2, \dots , N.\tag{5} \end{document} ]]></tex-math></disp-formula><p>Using induction, <inline-formula><tex-math id="math-49"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \delta_{t+1}(x_{t}) \end{document} ]]></tex-math></inline-formula> will be follow equation below.</p><disp-formula id="equation-14"><tex-math id="math-50"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \delta_ {t + 1} (x _ {t + 1}) = \max _ {x _ {1}, x _ {2}, \dots , x _ {t}} [ \delta_ {t} (x _ {t}) a _ {x _ {t} x _ {t + 1}} ] f (o _ {t + 1} \mid \theta_ {x _ {t + 1}}), \quad x _ {t + 1} = 1, 2, \dots , N.\tag{6} \end{document} ]]></tex-math></disp-formula><p>Below are the steps that need to be taken <xref ref-type="bibr" rid="BIBR-22">[22]</xref>.</p><p>(1) Initialization</p><disp-formula id="equation-15"><tex-math id="math-51"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \begin{array}{c} \delta_ {1} (x _ {1}) = \pi_ {x _ {1}} f (o _ {1} \mid \theta_ {x _ {1}}), \quad x _ {1} = 1, 2, \ldots , N. \\ \psi_ {1} (x _ {1}) = 0, \quad x _ {1} = 1, 2, \ldots , N. \end{array} \end{document} ]]></tex-math></disp-formula><p>(2) Recursion for <inline-formula><tex-math id="math-52"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle t = 1,2,\ldots ,T - 1 \end{document} ]]></tex-math></inline-formula> with</p><disp-formula id="equation-16"><tex-math id="math-53"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \delta_ {t + 1} (x _ {t + 1}) = \max _ {x _ {t} = 1, 2, \dots , N} [ \delta_ {t} (x _ {t}) a _ {x _ {t} x _ {t + 1}} ] f (o _ {t + 1} \mid \theta_ {x _ {t + 1}}), \quad x _ {t + 1} = 1, 2, \dots , N. \end{document} ]]></tex-math></disp-formula><disp-formula id="equation-17"><tex-math id="math-54"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \psi_ {t + 1} (x _ {t + 1}) = \arg \max _ {x _ {t} = 1, 2, \ldots , N} \delta_ {t} (x _ {t}) a _ {x _ {t} x _ {t + 1}}, \quad x _ {t + 1} = 1, 2, \ldots , N. \end{document} ]]></tex-math></disp-formula><p>(3) Termination</p><disp-formula id="equation-18"><tex-math id="math-55"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle p ^ {*} = \max _ {x _ {T} = 1, 2, \dots , N} [ \delta_ {T} (x _ {T}) ]. \end{document} ]]></tex-math></disp-formula><disp-formula id="equation-19"><tex-math id="math-56"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle x _ {T} ^ {*} = \arg \max _ {x _ {T} = 1, 2, \dots , N} [ \delta_ {T} (x _ {T}) ]. \end{document} ]]></tex-math></disp-formula><p>(4) Backtracking for <inline-formula><tex-math id="math-57"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle t = T, T - 1, \ldots, 2 \end{document} ]]></tex-math></inline-formula> ,</p><disp-formula id="equation-20"><tex-math id="math-58"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle x _ {t - 1} ^ {*} = \psi_ {t} (x _ {t} ^ {*}). \end{document} ]]></tex-math></disp-formula><p>From backtracing <inline-formula><tex-math id="math-59"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \{x_T^*, x_{T-1}^*, \ldots, x_1^*\} \end{document} ]]></tex-math></inline-formula> is obtained</p></sec><sec id="sec-5"><title>2.3. The Baum-Welch Algorithm.</title><p>The last algorithm is the Baum-Welch algorithm. For the sequence of observation <inline-formula><tex-math id="math-60"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle o_{1}, o_{2}, \ldots, o_{T} \end{document} ]]></tex-math></inline-formula> and <inline-formula><tex-math id="math-61"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \lambda = (A, \theta, \pi) \end{document} ]]></tex-math></inline-formula> , we will find <inline-formula><tex-math id="math-62"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \hat{\lambda} = (\hat{A}, \hat{\theta}, \hat{\pi}) \end{document} ]]></tex-math></inline-formula> such that</p><disp-formula id="equation-21"><tex-math id="math-63"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle p (o _ {1}, o _ {2}, \dots , o _ {T} \mid \hat {\lambda}) \geq p (o _ {1}, o _ {2}, \dots , o _ {T} \mid \lambda). \end{document} ]]></tex-math></disp-formula><p>To estimate <inline-formula><tex-math id="math-64"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \hat{\lambda} \end{document} ]]></tex-math></inline-formula> using the Baum-Welch algorithm, the expectation maximization (EM) approach is used <xref ref-type="bibr" rid="BIBR-23">[23]</xref>.</p><p>(1) E step</p><p>On this stage, define two functions <inline-formula><tex-math id="math-65"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle G \end{document} ]]></tex-math></inline-formula> and <inline-formula><tex-math id="math-66"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle H \end{document} ]]></tex-math></inline-formula> in <inline-formula><tex-math id="math-67"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \Lambda \end{document} ]]></tex-math></inline-formula> which is a set of all possible parameter for HMM. For all <inline-formula><tex-math id="math-68"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \lambda' = (A', \theta', \pi') \in \Lambda \end{document} ]]></tex-math></inline-formula> , define <inline-formula><tex-math id="math-69"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle G(\lambda, \lambda') \end{document} ]]></tex-math></inline-formula> , <inline-formula><tex-math id="math-70"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle H(\lambda, \lambda') \end{document} ]]></tex-math></inline-formula> , and <inline-formula><tex-math id="math-71"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle l(\lambda') \end{document} ]]></tex-math></inline-formula> as follow.</p><disp-formula id="equation-22"><tex-math id="math-72"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \begin{array}{r c l} G (\lambda , \lambda^ {\prime}) & = & \sum_ {x _ {T}, x _ {T - 1}, \ldots , x _ {1} = 1} ^ {N} p (x _ {1}, x _ {2}, \ldots , x _ {T} \mid o _ {1}, o _ {2}, \ldots , o _ {T}, \lambda) \\ & & \times \log \left[ p (o _ {1}, o _ {2}, \ldots , o _ {T}, x _ {1}, x _ {2}, \ldots , x _ {T} \mid \lambda^ {\prime}) \right]. \end{array}\tag{7} \end{document} ]]></tex-math></disp-formula><disp-formula id="equation-23"><tex-math id="math-73"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle H (\lambda , \lambda^ {\prime}) = \sum_ {x _ {T}, x _ {T - 1}, \ldots , x _ {1} = 1} ^ {N} p (x _ {1}, x _ {2}, \ldots , x _ {T} | o _ {1}, o _ {2}, \ldots , o _ {T}, \lambda)\tag{8} \end{document} ]]></tex-math></disp-formula><disp-formula id="equation-24"><tex-math id="math-74"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle l (\lambda^ {\prime}) = \log [ p (o _ {1}, o _ {2}, \dots , o _ {T} \mid \lambda^ {\prime}) ] = G (\lambda , \lambda^ {\prime}) - H (\lambda , \lambda^ {\prime}).\tag{9} \end{document} ]]></tex-math></disp-formula><p>(2) M step</p><p>On this stage, we will find <inline-formula><tex-math id="math-75"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \hat{\lambda} \in \Lambda \end{document} ]]></tex-math></inline-formula> such that</p><disp-formula id="equation-25"><tex-math id="math-76"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle G (\lambda , \hat {\lambda}) = \max _ {\lambda^ {\prime} \in \Lambda} G (\lambda , \lambda^ {\prime}). \end{document} ]]></tex-math></disp-formula><p><xref ref-type="bibr" rid="BIBR-22">[22]</xref> showed that</p><disp-formula id="equation-26"><tex-math id="math-77"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \begin{array}{r c l} l (\hat {\lambda}) - l (\lambda) & = & G (\lambda , \hat {\lambda}) - H (\lambda , \hat {\lambda}) - (G (\lambda , \lambda) - H (\lambda , \lambda)) \\ & = & (G (\lambda , \hat {\lambda}) - G (\lambda , \lambda)) + (H (\lambda , \lambda) - H (\lambda , \hat {\lambda})) \end{array} \end{document} ]]></tex-math></disp-formula><p><xref ref-type="bibr" rid="BIBR-24">[24]</xref> proved that</p><disp-formula id="equation-27"><tex-math id="math-78"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle H (\lambda , \lambda) \geq H (\lambda , \hat {\lambda}) \quad \hat {\lambda} \in \Lambda . \end{document} ]]></tex-math></disp-formula><p>So that</p><disp-formula id="equation-28"><tex-math id="math-79"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle l (\hat {\lambda}) - l (\lambda) \geq G (\lambda , \hat {\lambda}) - G (\lambda , \lambda) \geq 0. \end{document} ]]></tex-math></disp-formula><p>This result prove that</p><disp-formula id="equation-29"><tex-math id="math-80"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle l (\hat {\lambda}) \geq l (\lambda). \end{document} ]]></tex-math></disp-formula><p>Because logarithmic is an increasing function, it can be concluded that</p><disp-formula id="equation-30"><tex-math id="math-81"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle p (o _ {1}, o _ {2}, \dots , o _ {T} \mid \hat {\lambda}) \geq p (o _ {1}, o _ {2}, \dots , o _ {T} \mid \lambda). \end{document} ]]></tex-math></disp-formula><p>Now, the optimization problem becomes finding the parameter <inline-formula><tex-math id="math-82"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \hat{\lambda} = (\hat{A},\hat{\theta},\hat{\pi}) \end{document} ]]></tex-math></inline-formula> that maximize <inline-formula><tex-math id="math-83"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle G \end{document} ]]></tex-math></inline-formula> with two constrains. The problem is <inline-formula><tex-math id="math-84"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \max _ {\lambda^ {\prime} \in \Lambda} G (\lambda , \lambda^ {\prime}) \end{document} ]]></tex-math></inline-formula> with <inline-formula><tex-math id="math-85"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle G(\lambda, \lambda') \end{document} ]]></tex-math></inline-formula> in equation <xref ref-type="disp-formula" rid="equation-22">(7)</xref> satisfies the following equation.</p><disp-formula id="equation-31"><tex-math id="math-86"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \begin{array}{l} G (\lambda , \lambda^ {\prime}) = \sum_ {x _ {t} = 1} ^ {N} p (x _ {t} \mid o _ {1}, o _ {2}, \dots , o _ {T}, \lambda) \log \pi_ {x _ {t}} ^ {\prime} \\ \qquad + \sum_ {x _ {t} = 1} ^ {N} \sum_ {x _ {t + 1} = 1} ^ {N} \sum_ {t = 1} ^ {T - 1} p (x _ {t} \mid o _ {1}, o _ {2}, \dots , o _ {T}, \lambda) \log a _ {x _ {t} x _ {t + 1}} ^ {\prime} \\ \qquad + \sum_ {x _ {t} = 1} ^ {N} \sum_ {t = 1} ^ {T} p (x _ {t} \mid o _ {1}, o _ {2}, \dots , o _ {T}, \lambda) \log f ^ {\prime} (o _ {t} \mid \theta_ {x _ {t}}) \end{array}\tag{10} \end{document} ]]></tex-math></disp-formula><p>with constrains</p><disp-formula id="equation-32"><tex-math id="math-87"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \begin{array}{c} \sum_ {x _ {t} = 1} ^ {N} \pi_ {x _ {t}} ^ {\prime} = 1 \\ \sum_ {x _ {t + 1} = 1} ^ {N} a _ {x _ {t} x _ {t + 1}} ^ {\prime} = 1, \quad x _ {t} = 1, 2, \ldots , N. \end{array} \end{document} ]]></tex-math></disp-formula><p>This problem can be solved using the multiplier Lagrange. From <xref ref-type="disp-formula" rid="equation-31">(10)</xref>, define the Lagrange equation for <inline-formula><tex-math id="math-88"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \lambda' \in \Lambda \end{document} ]]></tex-math></inline-formula> as</p><disp-formula id="equation-33"><tex-math id="math-89"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \begin{array}{l} L (\lambda^ {\prime}) = G (\lambda , \lambda^ {\prime}) + \eta_ {1} \left(\sum_ {x _ {t} = 1} ^ {N} \pi_ {x _ {t}} ^ {\prime} - 1\right) \\ \qquad + \sum_ {x _ {t} = 1} ^ {N} \eta_ {2} \left(\sum_ {x _ {t + 1} = 1} ^ {N} a _ {x _ {t} x _ {t + 1}} ^ {\prime} - 1\right) \end{array}\tag{11} \end{document} ]]></tex-math></disp-formula><p>with <inline-formula><tex-math id="math-90"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \eta_{1} \end{document} ]]></tex-math></inline-formula> and <inline-formula><tex-math id="math-91"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \eta_{2} \end{document} ]]></tex-math></inline-formula> , are Lagrange multiplier variables. By solving three equations below</p><disp-formula id="equation-34"><tex-math id="math-92"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \frac {\partial L}{\partial \pi_ {x _ {t}} ^ {\prime}} = 0, \quad \frac {\partial L}{\partial a _ {x _ {t} x _ {t + 1}} ^ {\prime}} = 0, \quad \frac {\partial L}{\partial \theta_ {x _ {t}} ^ {\prime}} = 0 \end{document} ]]></tex-math></disp-formula><p><xref ref-type="bibr" rid="BIBR-20">[20]</xref> obtained the estimate parameter <inline-formula><tex-math id="math-93"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \hat{A} \end{document} ]]></tex-math></inline-formula> and <inline-formula><tex-math id="math-94"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \hat{\pi} \end{document} ]]></tex-math></inline-formula> as follows.</p><disp-formula id="equation-35"><tex-math id="math-95"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \hat {a} _ {x _ {t} x _ {t + 1}} = \frac {\sum_ {t = 1} ^ {T - 1} \xi_ {t} (x _ {t} , x _ {t + 1})}{\sum_ {t = 1} ^ {T - 1} \gamma_ {t} (x _ {t})}, \quad \hat {\pi} = \gamma_ {1} (x _ {t}). \end{document} ]]></tex-math></disp-formula><p>where</p><disp-formula id="equation-36"><tex-math id="math-96"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \xi_ {t} (x _ {t}, x _ {t + 1}) = p (x _ {t}, x _ {t + 1} \mid o _ {1}, o _ {2}, \ldots , o _ {T}, \lambda).\tag{12} \end{document} ]]></tex-math></disp-formula><p>and</p><disp-formula id="equation-37"><tex-math id="math-97"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \gamma_ {t} (x _ {t}) = p (x _ {t} \mid o _ {1}, o _ {2}, \ldots , o _ {T}, \lambda).\tag{13} \end{document} ]]></tex-math></disp-formula><p>7</p><p>These probabilities can be calculated using the forward and backward variables in equation <xref ref-type="disp-formula" rid="equation-2">(2)</xref>, <xref ref-type="disp-formula" rid="equation-7">(3)</xref>, and <xref ref-type="disp-formula" rid="equation-11">(4)</xref> as follow.</p><disp-formula id="equation-38"><tex-math id="math-98"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \xi_ {t} (x _ {t}, x _ {t + 1}) = \frac {\alpha_ {t} (x _ {t}) a _ {x _ {t} x _ {t + 1}} f (o _ {t + 1} \mid \theta_ {x _ {t + 1}}) \beta_ {t + 1} (x _ {t + 1})}{\sum_ {x _ {t} = 1} ^ {N} \alpha_ {t} (x _ {t}) \beta_ {t} (x _ {t})}, \quad t = 1, 2, \ldots , T.\tag{14} \end{document} ]]></tex-math></disp-formula><p>and</p><disp-formula id="equation-39"><tex-math id="math-99"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \gamma_ {t} (x _ {t}) = \frac {\alpha_ {t} (x _ {t}) \beta_ {t + 1} (x _ {t + 1})}{\sum_ {x _ {t} = 1} ^ {N} \alpha_ {t} (x _ {t}) \beta_ {t} (x _ {t})}, t = 1, 2, \ldots , T.\tag{15} \end{document} ]]></tex-math></disp-formula><p>Based on equation <xref ref-type="disp-formula" rid="equation-38">(14)</xref> and <xref ref-type="disp-formula" rid="equation-39">(15)</xref>, both variable has relationship as follow <xref ref-type="bibr" rid="BIBR-25">[25]</xref>.</p><disp-formula id="equation-40"><tex-math id="math-100"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \gamma_ {t} (x _ {t}) = \sum_ {x _ {t + 1} = 1} ^ {N} \xi_ {t} (x _ {t}, x _ {t + 1}), t = 1, 2, \ldots , T.\tag{16} \end{document} ]]></tex-math></disp-formula><p>For parameter <inline-formula><tex-math id="math-101"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \hat{\theta} \end{document} ]]></tex-math></inline-formula> , the result depends on distribution of <inline-formula><tex-math id="math-102"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle f(o_{t} \mid \theta_{x_{t}}) \end{document} ]]></tex-math></inline-formula> . In this research, the distributions used was selected from family continuous distribution such as Weibull, gamma and lognormal distributions.</p></sec></sec><sec id="sec-6"><title>3. MODELLING THE US DOLLAR INDEX</title><p>This research uses data obtained from <ext-link ext-link-type="uri" xlink:href="https://investing.com" xlink:title="investing.com">investing.com</ext-link> sites. The data used are daily closing data for the US Dollar index for the period from January 1, 2018, to February 29, 2024. The number of data is 1593. The data is divided into training and testing sets, with 1274 (80%) training data and 319 (20%) testing data. This division is used to compare the accuracy of prediction results over the modelling and testing time range. A graph of the daily closing price can be seen in Figure <xref ref-type="fig" rid="figure-1">1</xref>.</p><fig id="figure-1"><label>FIGURE 1</label><caption><p>Daily closing index of US Dollar index</p></caption><graphic xlink:href="https://jims-a.org/index.php/jimsa/article/download/1986/581/14313" mime-subtype="jpeg" mimetype="image"><alt-text>FIGURE 1</alt-text></graphic></fig><p>Figure <xref ref-type="fig" rid="figure-1">1</xref> shows that daily closing data for the US Dollar index moves fluctuatingly and does not have a tendency to form a particular pattern. The data has a range of 88.170 to 114.047, with a mean of 97.638. The first step in data modelling is to determine the optimal number of hidden states and their corresponding distribution. One method for determining model selection is to utilise the Akaike information criterion (AIC).</p><p>The Akaike information criterion can be calculated using the following equation.</p><disp-formula id="equation-41"><tex-math id="math-103"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle A I C = - 2 \log L + 2 k\tag{17} \end{document} ]]></tex-math></disp-formula><p>where L is the likelihood value of the data and k is called the penalty term <xref ref-type="bibr" rid="BIBR-26">[26]</xref>. In this research, the penalty term is calculated using the following formula.</p><disp-formula id="equation-42"><tex-math id="math-104"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle k = N ^ {2} + p N - 1\tag{18} \end{document} ]]></tex-math></disp-formula><p>with N is the number of states in the Markov chain and p is the number of parameters from the distribution used to create the model. The likelihood of the HMM can be calculated using equation <xref ref-type="disp-formula" rid="equation-24">(9)</xref>. Using equation <xref ref-type="disp-formula" rid="equation-41">(17)</xref> and <xref ref-type="disp-formula" rid="equation-42">(18)</xref>, the results of the AIC values for several types of continuous distribution and different numbers of states can be seen in Table <xref ref-type="table" rid="table-1">1 </xref>below.</p><table-wrap id="table-1"><label>TABLE 1</label><caption><p>AIC value for several types of distribution and different number of states</p></caption><table><colgroup><col></col><col></col><col></col><col></col></colgroup><thead><tr><th scope="col">Number of states (N)</th><th scope="col">Weibull</th><th scope="col">Gamma</th><th scope="col">Lognormal</th></tr></thead><tbody><tr><td>2</td><td>6366.78</td><td>7706.04</td><td>6431.47</td></tr><tr><td>3</td><td>5079.10</td><td>7720.04</td><td>4974.31</td></tr><tr><td>4</td><td>4443.11</td><td>6568.98</td><td>4261.26</td></tr><tr><td>5</td><td>4054.90</td><td>7760.04</td><td>3911.06</td></tr><tr><td>6</td><td>3742.01</td><td>7786.04</td><td>3646.61</td></tr><tr><td>7</td><td>3424.81</td><td>7816.04</td><td>3321.88</td></tr><tr><td>8</td><td>3311.56</td><td>5524.89</td><td>3196.90</td></tr><tr><td>9</td><td>2994.28</td><td>5086.25</td><td>2906.07</td></tr><tr><td>10</td><td>2918.02</td><td>5128.14</td><td>2766.96</td></tr><tr><td>11</td><td>2833.39</td><td>5172.04</td><td>2647.12</td></tr><tr><td>12</td><td>2749.49</td><td>5228.27</td><td>2559.63</td></tr><tr><td>13</td><td>2590.39</td><td>5262.23</td><td>2452.02</td></tr><tr><td>14</td><td>2540.32</td><td>5079.10</td><td>2425.92</td></tr><tr><td>15</td><td>2485.60</td><td>4805.12</td><td>2376.33</td></tr><tr><td>16</td><td>2462.89</td><td>4834.50</td><td>2347.56</td></tr><tr><td>17</td><td>2431.35</td><td>3668.91</td><td>2314.54</td></tr><tr><td>18</td><td>2467.47</td><td>3304.49</td><td>2348.06</td></tr><tr><td>19</td><td>2481.36</td><td>3332.27</td><td>2372.03</td></tr><tr><td>20</td><td>2515.42</td><td>3399.94</td><td>2406.39</td></tr></tbody></table></table-wrap><p>From Table <xref ref-type="table" rid="table-1">1</xref> above, it can be seen that the AIC value get smaller as N increases. We find that minimum AIC value for each state always reached by lognormal distribution. To determine the optimal value for N, we define</p><disp-formula id="equation-43"><tex-math id="math-105"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \Delta A I C _ {N} = \frac {\mid A I C _ {N + 1} - A I C _ {N} \mid}{A I C _ {N}}, \quad N = 2, \dots 1 9\tag{19} \end{document} ]]></tex-math></disp-formula><p>where <inline-formula><tex-math id="math-106"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle AIC_{N} \end{document} ]]></tex-math></inline-formula> is the AIC value of N-state HMM. The plot of <inline-formula><tex-math id="math-107"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \Delta AIC_{N} \end{document} ]]></tex-math></inline-formula> for lognormal distributionscan be seen in Figure <xref ref-type="fig" rid="figure-2">2</xref>.</p><fig id="figure-2"><label>FIGURE 2</label><caption><p>Plot of ∆AICN for lognormal distribution</p></caption><graphic xlink:href="https://jims-a.org/index.php/jimsa/article/download/1986/581/14314" mime-subtype="jpeg" mimetype="image"><alt-text>FIGURE 2</alt-text></graphic></fig><p>In this research, ∆AICN&lt; 0.03 is set as a benchmark for the optimal valueof N .  The Figure <xref ref-type="fig" rid="figure-2">2</xref> shows that ∆AICNtend to decrease as N increase.  ∆AICN≤0.03  occurs  in  state  11  and  12.   The  AIC  value  difference  in  state  11  and  12  is0.033052 or almost zero, so 11 is chosen to be best number of state for HMM withlognormal distribution.</p><p>Using  the  Baum-Welch  algorithm  for N  =  11  and  lognormal  distribution,the estimated parameters of the hidden Markov model consisting of the transitionprobability matrix between statesˆA are obtained , the probability density function matrix<italic>ˆθ</italic>, and the initial probability vector ˆπ can be calculated.  Using Mathematica12.3 software, we obtain the estimated parameterˆλ = (ˆA,ˆθ, ˆπ) as follows.</p><p><inline-formula><tex-math id="math-108"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \hat{A} = \begin{bmatrix}0.90 & 0.03 & 0. & 0.07 & 0. & 0. & 0. & 0. & 0. & 0. & 0. \\0.03 & 0.96 & 0.01 & 0. & 0. & 0. & 0. & 0. & 0. & 0. & 0. \\0. & 0.02 & 0.98 & 0. & 0. & 0. & 0. & 0. & 0. & 0. & 0. \\0.04 & 0. & 0. & 0.90 & 0.05 & 0. & 0. & 0. & 0. & 0. & 0. \\0. & 0. & 0. & 0.05 & 0.90 & 0.04 & 0. & 0. & 0. & 0. & 0. \\0. & 0. & 0. & 0. & 0.04 & 0.85 & 0.10 & 0. & 0. & 0. & 0. \\0. & 0. & 0. & 0. & 0. & 0.06 & 0.89 & 0.05 & 0. & 0. & 0. \\0. & 0. & 0. & 0. & 0. & 0. & 0.05 & 0.92 & 0.03 & 0. & 0. \\0. & 0. & 0. & 0. & 0. & 0. & 0. & 0.03 & 0.95 & 0.02 & 0. \\0. & 0. & 0. & 0. & 0. & 0. & 0. & 0. & 0.01 & 0.98 & 0.01 \\0. & 0. & 0. & 0. & 0. & 0. & 0. & 0. & 0. & 0.02 & 0.98\end{bmatrix} \end{document} ]]></tex-math></inline-formula></p><disp-formula id="equation-44"><tex-math id="math-109"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \hat {\theta} = \left[ \begin{array}{l} \mathrm{lognormal} [ 4. 5 2 2, 0. 0 0 4 ] \\ \mathrm{lognormal} [ 4. 5 0 5, 0. 0 0 5 ] \\ \mathrm{lognormal} [ 4. 4 9 1, 0. 0 0 5 ] \\ \mathrm{lognormal} [ 4. 5 3 3, 0. 0 0 3 ] \\ \mathrm{lognormal} [ 4. 5 4 3, 0. 0 0 3 ] \\ \mathrm{lognormal} [ 4. 5 5 6, 0. 0 0 4 ] \\ \mathrm{lognormal} [ 4. 5 6 6, 0. 0 0 3 ] \\ \mathrm{lognormal} [ 4. 5 7 6, 0. 0 0 4 ] \\ \mathrm{lognormal} [ 4. 5 9 6, 0. 0 0 9 ] \\ \mathrm{lognormal} [ 4. 6 5 0, 0. 0 1 8 ] \\ \mathrm{lognormal} [ 4. 7 0 6, 0. 0 1 6 ] \end{array} \right] \quad \hat {\pi} = \left[ \begin{array}{l} 1. \\ 0. \\ 0. \\ 0. \\ 0. \\ 0. \\ 0. \\ 0. \\ 0. \\ 0. \\ 0. \\ 0. \end{array} \right] \end{document} ]]></tex-math></disp-formula><p>The matrix <inline-formula><tex-math id="math-110"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \hat{A} \end{document} ]]></tex-math></inline-formula> shows the transition probability between hidden states. Each state tends to remain in its current state, with a slight chance of moving to a nearby state. Matrix <inline-formula><tex-math id="math-111"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \hat{\theta} \end{document} ]]></tex-math></inline-formula> shows the parameter of the lognormal distribution for data generated by each state. The matrix <inline-formula><tex-math id="math-112"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \hat{\pi} \end{document} ]]></tex-math></inline-formula> shows that the model started with hidden state 1.</p><p>Using the Viterbi algorithm, we can estimate the parameter <inline-formula><tex-math id="math-113"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \hat{\lambda} = (\hat{A}, \hat{\theta}, \hat{\pi}) \end{document} ]]></tex-math></inline-formula> and determine the sequence of hidden states that generated the data. These hidden states are visualized in 11 different colors. The data and the estimated hidden states are shown in Figure <xref ref-type="fig" rid="figure-3">3</xref> as follows. </p><fig id="figure-3"><label>FIGURE 3</label><caption><p>Visualization of the data and its hidden state</p></caption><graphic xlink:href="https://jims-a.org/index.php/jimsa/article/download/1986/581/14315" mime-subtype="jpeg" mimetype="image"><alt-text>FIGURE 3</alt-text></graphic></fig><p>Figure <xref ref-type="fig" rid="figure-3">3</xref> shows how hidden state moves from one state to another. This figure also shows range of the values of the data generated by each hidden state. From Figure 3, a certain amount of data is generated a hidden state. To make sure that the data for each hidden state is generated by lognormal distribution, we do the Kolmogorov-Smirnov test with the hypothesis:</p><p><inline-formula><tex-math id="math-114"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle H_{0} \end{document} ]]></tex-math></inline-formula> : that the data distributed lognormally.</p><p><inline-formula><tex-math id="math-115"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle H_{1} \end{document} ]]></tex-math></inline-formula> : that the data does not distributed lognormally. For each state, the amount of data, distribution parameters that describes the data, and the p-value result for KS-test can be seen in Table <xref ref-type="table" rid="table-2">2</xref> below.</p><table-wrap id="table-2"><label>TABLE 2</label><caption><p>A summary of the data for each continuous HMM hidden state with lognormal distribution</p></caption><table><colgroup><col></col><col></col><col></col><col></col></colgroup><thead><tr><th scope="col">Hidden states</th><th scope="col">Number of data generated</th><th scope="col">Distribution</th><th scope="col">p-value</th></tr></thead><tbody><tr><td>1</td><td>85</td><td>lognormal[4.522, 0.004]</td><td>0.813</td></tr><tr><td>2</td><td>122</td><td>lognormal[4.505, 0.005]</td><td>0.106</td></tr><tr><td>3</td><td>63</td><td>lognormal[4.491, 0.005]</td><td>0.627</td></tr><tr><td>4</td><td>128</td><td>lognormal[4.533, 0.003]</td><td>0.183</td></tr><tr><td>5</td><td>111</td><td>lognormal[4.543, 0.003]</td><td>0.281</td></tr><tr><td>6</td><td>111</td><td>lognormal[4.556, 0.004]</td><td>0.460</td></tr><tr><td>7</td><td>186</td><td>lognormal[4.566, 0.003]</td><td>0.384</td></tr><tr><td>8</td><td>176</td><td>lognormal[4.576, 0.004]</td><td>0.107</td></tr><tr><td>9</td><td>125</td><td>lognormal[4.596, 0.009]</td><td>0.421</td></tr><tr><td>10</td><td>107</td><td>lognormal[4.650, 0.018]</td><td>0.050</td></tr><tr><td>11</td><td>60</td><td>lognormal[4.706, 0.016]</td><td>0.300</td></tr></tbody></table></table-wrap><p>Based on Table <xref ref-type="table" rid="table-2">2</xref>, it can be seen that the 1274 data is divided into 11 states. The amount of data for each state formed varies. The p-value for each data point for each state is greater than 0.05, so it can be concluded that there is not enough evidence to reject <inline-formula><tex-math id="math-116"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle H_{0} \end{document} ]]></tex-math></inline-formula> , meaning that all data points for each state come from a lognormal distribution with the parameters that have been obtained. A comparison of the mean and variance between theoretical and actual data is presented in Table <xref ref-type="table" rid="table-3">3</xref> below.</p><table-wrap id="table-3"><label>TABLE 3</label><caption><p>Comparison between theoretical and actual data</p></caption><table><colgroup><col></col><col></col><col></col><col></col><col></col></colgroup><thead><tr><th scope="col">States</th><th scope="col">Actual Mean</th><th scope="col">Theoretical Mean</th><th scope="col">Actual Variance</th><th scope="col">Theoretical Variance</th></tr></thead><tbody><tr><td>1</td><td>92.0291</td><td>92.0202</td><td>0.1053</td><td>0.1355</td></tr><tr><td>2</td><td>90.4289</td><td>90.4695</td><td>0.2190</td><td>0.2046</td></tr><tr><td>3</td><td>89.1938</td><td>89.2117</td><td>0.2152</td><td>0.1989</td></tr><tr><td>4</td><td>93.0088</td><td>93.0377</td><td>0.1013</td><td>0.0779</td></tr><tr><td>5</td><td>93.9839</td><td>93.9727</td><td>0.0958</td><td>0.0795</td></tr><tr><td>6</td><td>95.1452</td><td>95.2027</td><td>0.1508</td><td>0.1450</td></tr><tr><td>7</td><td>96.1421</td><td>96.1591</td><td>0.0664</td><td>0.0832</td></tr><tr><td>8</td><td>96.9906</td><td>97.1259</td><td>0.0878</td><td>0.1509</td></tr><tr><td>9</td><td>97.9837</td><td>99.0912</td><td>0.1577</td><td>0.7954</td></tr><tr><td>10</td><td>99.6662</td><td>104.6020</td><td>0.3754</td><td>3.5456</td></tr><tr><td>11</td><td>103.1150</td><td>110.6230</td><td>1.1329</td><td>3.1332</td></tr></tbody></table></table-wrap><p>Based on Table <xref ref-type="table" rid="table-3">3</xref>, it can be concluded that the actual data and the estimated distribution have almost the same mean and variance. This also suggests that the distribution can effectively represent the original data. Even though there are differences in mean and variances values in the data range that are too high.</p><p>The HMM <inline-formula><tex-math id="math-117"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \hat{\lambda} = (\hat{A},\hat{\theta},\hat{\pi}) \end{document} ]]></tex-math></inline-formula> that has been obtained is then used to generate 1274 simulation data as much as the training data used. Data is generated to find the best seeds to make predictions on daily closing data for the US Dollar index. Simulations to identify the optimal seeds were conducted using Mathematica 12.3 software. To determine the accuracy of the model, this research utilises the mean absolute percentage error (MAPE) to calculate it. The MAPE can be calculated using the formula <xref ref-type="bibr" rid="BIBR-27">[27]</xref> as follows.</p><disp-formula id="equation-45"><tex-math id="math-118"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle M A P E = \frac {1}{n} \sum_ {t = 1} ^ {n} \frac {\mid X _ {t} - \hat {X} _ {t} \mid}{X _ {t}} \times 100 \%,\tag{20} \end{document} ]]></tex-math></disp-formula><p>where <inline-formula><tex-math id="math-119"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle X_{t} \end{document} ]]></tex-math></inline-formula> is actual data at time t, <inline-formula><tex-math id="math-120"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \dot{X}_{t} \end{document} ]]></tex-math></inline-formula> is prediction data at time t, and n is the number of data.</p><p>Based on the simulation results, the continuous HMM training yielded a MAPE of 1.39819%. Visualization of the training data and the results of continuous HMM training, with a MAPE of 1.39819% can be seen in Figure <xref ref-type="fig" rid="figure-4">4</xref> below. Figure <xref ref-type="fig" rid="figure-4">4</xref> shows that the model simulation results closely follow the ups and downs of the original data.</p><fig id="figure-4"><label>FIGURE 4</label><caption><p>Plot training data simulation results with MAPE 1.39819%</p></caption><graphic xlink:href="https://jims-a.org/index.php/jimsa/article/download/1986/581/14316" mime-subtype="jpeg" mimetype="image"><alt-text>FIGURE 4</alt-text></graphic></fig><p>Predictions are made on testing data using the HMM <inline-formula><tex-math id="math-121"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \hat{\lambda} = (\hat{A}, \hat{\theta}, \hat{\pi}) \end{document} ]]></tex-math></inline-formula> that has been estimated from training data. Simulations were carried out using Mathematica 12.3 software. MAPE summary results for various testing data ranges can be seen in Table <xref ref-type="table" rid="table-4">4</xref> below.</p><table-wrap id="table-4"><label>TABLE 4</label><caption><p>MAPE values for simulated testing data</p></caption><table><colgroup><col></col><col></col></colgroup><thead><tr><th scope="col">Prediction time (days)</th><th scope="col">MAPE (%)</th></tr></thead><tbody><tr><td>20</td><td>2.63494</td></tr><tr><td>40</td><td>2.82689</td></tr><tr><td>60</td><td>3.46179</td></tr><tr><td>80</td><td>3.94428</td></tr><tr><td>100</td><td>4.19032</td></tr><tr><td>120</td><td>4.38700</td></tr><tr><td>140</td><td>4.26673</td></tr><tr><td>160</td><td>4.52996</td></tr><tr><td>180</td><td>4.61455</td></tr><tr><td>200</td><td>4.29501</td></tr><tr><td>220</td><td>4.17964</td></tr><tr><td>240</td><td>4.15056</td></tr><tr><td>260</td><td>3.90854</td></tr><tr><td>280</td><td>3.79830</td></tr><tr><td>300</td><td>3.71390</td></tr><tr><td>319</td><td>3.66477</td></tr></tbody></table></table-wrap><p>From Table <xref ref-type="table" rid="table-4">4</xref>, the MAPE results of simulated test data for data all range prediction times are smaller than <inline-formula><tex-math id="math-122"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle 4\% \end{document} ]]></tex-math></inline-formula> . This means that the HMM <inline-formula><tex-math id="math-123"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle \hat{\lambda} = (\hat{A}, \hat{\theta}, \hat{\pi}) \end{document} ]]></tex-math></inline-formula> provides very accurate forecasts. Table <xref ref-type="table" rid="table-4">4</xref> also shows that the MAPE gets bigger if the prediction time span longer. Plot of simulated data (prediction) and actual data from continuous HMM with MAPE <inline-formula><tex-math id="math-124"><![CDATA[ \documentclass{article} \usepackage{amsmath} \begin{document} \displaystyle 3.66477\% \end{document} ]]></tex-math></inline-formula> can be seen in Figure <xref ref-type="fig" rid="figure-5">5</xref> below.</p><fig id="figure-5"><label>FIGURE 5</label><caption><p>Prediction results on testing data with MAPE 3.66477%</p></caption><graphic xlink:href="https://jims-a.org/index.php/jimsa/article/download/1986/581/14317" mime-subtype="jpeg" mimetype="image"><alt-text>FIGURE 5</alt-text></graphic></fig><p>From the Figure <xref ref-type="fig" rid="figure-5">5</xref>, it can be seen that the prediction results of the testing data are accurate. There is still error in this prediction, but the difference is not very significant. So we come to the cclusion that the continuous HMM can well predict the up and down of data. In Figure <xref ref-type="fig" rid="figure-6">6</xref>, the visualisation of the combined training and testing data is shown,  illustrating the movement of the simulated data across both datasets as generated by the continuous HMM model.</p><fig id="figure-6"><label>FIGURE 6</label><caption><p>Visualization of the combined training and testing data</p></caption><graphic xlink:href="https://jims-a.org/index.php/jimsa/article/download/1986/581/14318" mime-subtype="jpeg" mimetype="image"><alt-text>FIGURE 6</alt-text></graphic></fig><p>Figure <xref ref-type="fig" rid="figure-6">6</xref> illustrates that the continuous Hidden Markov Model effectively captures the primary dynamics of the time series, including both short-term fluctuations and longer-term trends, in both the training and testing datasets. The simulated values closely follow the actual data, indicating good generalisation. However, the model still struggles to detect sudden or extreme price changes caused by rapid market shifts. Overall, these results suggest that the continuous HMM can model complex time-series patterns and provide useful forecasts for financial indicators such as the US Dollar index.</p></sec><sec id="sec-7"><title>4. CONCLUDING REMARKS</title><p>Daily closing data on the US Dollar index from 2018 to 2024 can be modelled using a continuous HMM with 11 hidden states and lognormal distributions with different parameters for each hidden state. MAPE measures the accuracy of the model. The MAPE value for both training and testing data is very low, which is smaller than 4%. This indicates that the continuous HMM can model the data very accurately. The plot shows strong agreement between the simulated and actual data, and the model effectively captures the upward and downward fluctuations of the US Dollar index.</p><p>However, this study has several limitations. The model utilises only univariate USDX time-series data and does not incorporate external factors, such as interest rates, inflation, or commodity prices, that may influence index movements. Although the use of 11 hidden states performs well empirically, it may not fully represent actual market regimes and could be improved with a more systematic selection process. Additionally, the assumption of constant parameters within each state may not accurately capture structural changes in global financial conditions.</p><p>Future research can address these limitations by incorporating multivariate inputs or relevant macroeconomic indicators. Hybrid models that combine HMM with deep learning methods, such as LSTM, may help capture more complex temporal patterns. Additionally, using dynamic HMMs or regime-switching models with time-varying parameters could better reflect changes in currency market behaviour. These improvements may enhance both the interpretability and predictive accuracy of the model for the US Dollar index and other financial time series.</p></sec></body><back><sec sec-type="data-availability"><title>Data Availability Statement.</title><p>The dataset analyzed during the current study is publicly available in the investing website, accessible at: https://www.investing.com/currencies/us-dollar-index.</p></sec><sec sec-type="author-contributions"><title>Author Contributions.</title><p>David Vijanarco Martal: Conceptualization, methodology, software development, formal analysis, data curation, writing original draft preparation, and visualization. Berlian Setiawaty: Validation, investigation, writing, review, editing, and supervision. Retno Budiarti: Methodology support, statistical analysis, interpretation of results, project administration, and final manuscript review. All authors contributed to refining the manuscript, discussed the results, and approved the final version.</p></sec><ack><title>Acknowledgement.</title><p>Thanks for the support of School of Data Science, Mathematics and Informatics, IPB University, in financing the publication of this article.</p></ack><ref-list><title>References</title><ref id="BIBR-1"><element-citation publication-type="journal"><article-title>Analysis of oil price fluctuation under the influence of crude oil stocks and us dollar index-based on time series network model</article-title><source>Physica A: Statistical mechanics and its applications</source><volume>582</volume><person-group person-group-type="author"><name><surname>Zhou</surname><given-names>J.</given-names></name><name><surname>Sun</surname><given-names>M.</given-names></name><name><surname>Han</surname><given-names>D.</given-names></name><name><surname>Gao</surname><given-names>C.</given-names></name></person-group><year>2021</year><page-range>126218,</page-range><pub-id pub-id-type="doi">10.1016/j.physa.2021.126218</pub-id></element-citation></ref><ref id="BIBR-2"><element-citation publication-type="journal"><article-title>The influence of crude oil derivative instruments, us dollar index, leading stock index, us fed interest rates and inflation on gold futures prices: Analysis of the 2012-2021 period</article-title><source>Contemporary Studies in Economic, Finance, and Banking</source><volume>4</volume><issue>1</issue><person-group person-group-type="author"><name><surname>Laduni</surname><given-names>I.I.</given-names></name></person-group><year>2022</year><page-range>710-724,</page-range><pub-id pub-id-type="doi">10.21776/csefb.2022.01.4.14</pub-id></element-citation></ref><ref id="BIBR-3"><element-citation publication-type="journal"><article-title>Exchange rates, interest rates, and the risk premium</article-title><source>American Economic Review</source><volume>106</volume><issue>2</issue><person-group person-group-type="author"><name><surname>Engel</surname><given-names>C.</given-names></name></person-group><year>2016</year><page-range>436-474,</page-range><pub-id pub-id-type="doi">10.1257/aer.20121365</pub-id></element-citation></ref><ref id="BIBR-4"><element-citation publication-type="journal"><article-title>The dollar exchange rate as a global risk factor: Evidence from investment</article-title><source>IMF Economic Review</source><volume>67</volume><person-group person-group-type="author"><name><surname>Avdjiev</surname><given-names>S.</given-names></name><name><surname>Bruno</surname><given-names>V.</given-names></name><name><surname>Koch</surname><given-names>C.</given-names></name><name><surname>Shin</surname><given-names>H.S.</given-names></name></person-group><year>2019</year><page-range>151-173,</page-range><pub-id pub-id-type="doi">10.1057/s41308-019-00074-4</pub-id></element-citation></ref><ref id="BIBR-5"><element-citation publication-type="journal"><article-title>The impact of gold price and us dollar index: The volatile case of shanghai stock exchange and bombay stock exchange during the crisis of covid-19</article-title><source>Journal of Finance and Banking</source><volume>25</volume><issue>3</issue><person-group person-group-type="author"><name><surname>Kumar</surname><given-names>J.J.A.</given-names></name><name><surname>Robiyanto</surname><given-names>R.</given-names></name></person-group><year>2021</year><page-range>508-531,</page-range><pub-id pub-id-type="doi">10.26905/jkdp.v25i3.5142</pub-id></element-citation></ref><ref id="BIBR-6"><element-citation publication-type="journal"><article-title>The impact of the us dollar value and interest rates on the s&amp;p 500 returns</article-title><source>Scientific Journal of Economics and Management Research</source><volume>6</volume><issue>2</issue><person-group person-group-type="author"><name><surname>Hau</surname><given-names>S.D.G.F.</given-names></name></person-group><year>2024</year><page-range>1-7,</page-range><ext-link xlink:href="https://www.sjemr.org/download/SJEMR-6-2-1-7.pdf" ext-link-type="uri" xlink:title="Download">Download</ext-link></element-citation></ref><ref id="BIBR-7"><element-citation publication-type="conf-paper"><article-title>A study of the usdx predication based on arima and garch models</article-title><source>2011 Fourth International Conference on Business Intelligence and Financial Engineering</source><person-group person-group-type="author"><name><surname>Liu</surname><given-names>Z.</given-names></name><name><surname>Lv</surname><given-names>Y.</given-names></name></person-group><year>2011</year><page-range>82-85,</page-range><publisher-name>Institute of Electrical and Electronics Engineers</publisher-name><pub-id pub-id-type="doi">10.1109/BIFE.2011.9</pub-id></element-citation></ref><ref id="BIBR-8"><element-citation publication-type="book"><article-title>Machine learning-based a comparative analysis for usa dollar index prediction</article-title><source>Finansal Piyasaların Evrimi-II</source><person-group person-group-type="author"><name><surname>Yürük</surname><given-names>M.F.</given-names></name></person-group><year>2023</year><page-range>33-52,</page-range><publisher-name>Özgür Yayın Dağıtım Ltd. Şti</publisher-name><pub-id pub-id-type="doi">10.58830/ozgur.pub105.c739</pub-id></element-citation></ref><ref id="BIBR-9"><element-citation publication-type="journal"><article-title>Comparison of the two hybrid models, wavelet-arima and wavelet-es, to predict the prices of the us dollar index</article-title><source>Periodicals of Engineering and Natural Sciences</source><volume>10</volume><issue>2</issue><person-group person-group-type="author"><name><surname>Tahir</surname><given-names>A.S.M.</given-names></name><name><surname>Jassim</surname><given-names>F.M.</given-names></name></person-group><year>2022</year><page-range>219-230,</page-range><pub-id pub-id-type="doi">10.21533/pen.v10.i2.600</pub-id></element-citation></ref><ref id="BIBR-10"><element-citation publication-type="journal"><article-title>Using a hidden markov model to measure earnings quality</article-title><source>Journal of Accounting and Economics</source><volume>69</volume><issue>2</issue><person-group person-group-type="author"><name><surname>Du</surname><given-names>K.</given-names></name><name><surname>Huddart</surname><given-names>S.</given-names></name><name><surname>Xue</surname><given-names>L.</given-names></name><name><surname>Zhang</surname><given-names>Y.</given-names></name></person-group><year>2020</year><page-range>101281,</page-range><pub-id pub-id-type="doi">10.1016/j.jacceco.2019.101281</pub-id></element-citation></ref><ref id="BIBR-11"><element-citation publication-type="journal"><article-title>Sleep monitoring with hidden markov model for physical conditions tracking</article-title><source>IEEE Sensors Journal</source><volume>21</volume><issue>13</issue><person-group person-group-type="author"><name><surname>Peng</surname><given-names>L.</given-names></name><name><surname>Yin</surname><given-names>A.</given-names></name><name><surname>Song</surname><given-names>W.</given-names></name><name><surname>Yao</surname><given-names>W.</given-names></name><name><surname>Ren</surname><given-names>H.</given-names></name><name><surname>Yang</surname><given-names>L.</given-names></name></person-group><year>2021</year><page-range>14232-14239,</page-range><pub-id pub-id-type="doi">10.1109/JSEN.2020.3007153</pub-id></element-citation></ref><ref id="BIBR-12"><element-citation publication-type="journal"><article-title>Hmm-based supervised machine learning framework for the detection of fecg r-r peak locations</article-title><source>IRBM</source><volume>40</volume><issue>3</issue><person-group person-group-type="author"><name><surname>Huque</surname><given-names>A.S.A.</given-names></name><name><surname>Ahmed</surname><given-names>K.I.</given-names></name><name><surname>Mukit</surname><given-names>M.A.</given-names></name><name><surname>Mostafa</surname><given-names>R.</given-names></name></person-group><year>2019</year><page-range>157-166,</page-range><pub-id pub-id-type="doi">10.1016/j.irbm.2019.04.004</pub-id></element-citation></ref><ref id="BIBR-13"><element-citation publication-type="journal"><article-title>Inference of the transition matrix in convolved hidden markov models and the generalized baum-welch algorithm</article-title><source>IEEE Transactions on Geoscience and Remote Sensing</source><volume>53</volume><issue>12</issue><person-group person-group-type="author"><name><surname>Lindberg</surname><given-names>D.V.</given-names></name><name><surname>Omre</surname><given-names>H.</given-names></name></person-group><year>2015</year><page-range>6443-6456,</page-range><pub-id pub-id-type="doi">10.1109/TGRS.2015.2440415</pub-id></element-citation></ref><ref id="BIBR-14"><element-citation publication-type="journal"><article-title>The application of discrete hidden markov model on crosses of diploid plant</article-title><source>Barekeng: Journal of Mathematics and Its Applications</source><volume>17</volume><issue>3</issue><person-group person-group-type="author"><name><surname>Hayati</surname><given-names>N.</given-names></name><name><surname>Setiawaty</surname><given-names>B.</given-names></name><name><surname>Purnaba</surname><given-names>I.G.P.</given-names></name></person-group><year>2023</year><page-range>1449-1462,</page-range><pub-id pub-id-type="doi">10.30598/barekengvol17iss3pp1449-1462</pub-id></element-citation></ref><ref id="BIBR-15"><element-citation publication-type="journal"><article-title>A bayesian approach to multistate hidden markov models: Application to dementia progression</article-title><source>Journal of the American Statistical Association</source><volume>115</volume><issue>529</issue><person-group person-group-type="author"><name><surname>Williams</surname><given-names>J.P.</given-names></name><name><surname>Storlie</surname><given-names>C.B.</given-names></name><name><surname>Therneau</surname><given-names>T.M.</given-names></name><name><surname>J.</surname><given-names>C.R.</given-names></name><name><surname>Hannig</surname><given-names>J.</given-names></name></person-group><year>2020</year><page-range>16-31,</page-range><pub-id pub-id-type="doi">10.1080/01621459.2019.1594831</pub-id></element-citation></ref><ref id="BIBR-16"><element-citation publication-type="journal"><article-title>A novel dynamic asset allocation system using feature saliency hidden markov models for smart beta investing</article-title><source>Expert Systems with Applications</source><volume>163</volume><person-group person-group-type="author"><name><surname>Fons</surname><given-names>E.</given-names></name><name><surname>Dawson</surname><given-names>P.</given-names></name><name><surname>Yau</surname><given-names>J.</given-names></name><name><surname>Zeng</surname><given-names>X.-j</given-names></name><name><surname>Keane</surname><given-names>J.</given-names></name></person-group><year>2021</year><page-range>113720,</page-range><pub-id pub-id-type="doi">10.1016/j.eswa.2020.113720</pub-id></element-citation></ref><ref id="BIBR-17"><element-citation publication-type="book"><article-title>A systematic review of hidden markov models and their applications</article-title><source>Archives of Computational Methods in Engineering</source><volume>28</volume><person-group person-group-type="author"><name><surname>Mor</surname><given-names>B.</given-names></name><name><surname>Garhwal</surname><given-names>S.</given-names></name><name><surname>Kumar</surname><given-names>A.</given-names></name></person-group><year>2020</year><page-range>1429-1448,</page-range><pub-id pub-id-type="doi">10.1007/s11831-020-09422-4</pub-id></element-citation></ref><ref id="BIBR-18"><element-citation publication-type="journal"><article-title>A tutorial on hidden markov models and selected applications in speech recognition</article-title><source>Proceedings of the IEEE</source><volume>77</volume><issue>2</issue><person-group person-group-type="author"><name><surname>Rabiner</surname><given-names>L.</given-names></name></person-group><year>1989</year><page-range>257-286,</page-range><pub-id pub-id-type="doi">10.1109/5.18626</pub-id></element-citation></ref><ref id="BIBR-19"><element-citation publication-type="journal"><article-title>Optimisation of hidden markov model using baum-welch algorithm for prediction of maximum and minimum temperature over indian himalaya</article-title><source>Journal of Earth System Science</source><volume>126</volume><issue>1</issue><person-group person-group-type="author"><name><surname>Joshi</surname><given-names>J.C.</given-names></name><name><surname>Kumar</surname><given-names>T.</given-names></name><name><surname>Srivastava</surname><given-names>S.</given-names></name><name><surname>Sachdeva</surname><given-names>D.</given-names></name></person-group><year>2017</year><page-range>1-9,</page-range><pub-id pub-id-type="doi">10.1007/s12040-016-0780-0</pub-id></element-citation></ref><ref id="BIBR-20"><element-citation publication-type="journal"><article-title>A new algorithm to train hidden markov models for biological sequences with partial labels</article-title><source>BMC Bioinformatics</source><volume>22</volume><issue>162</issue><person-group person-group-type="author"><name><surname>Li</surname><given-names>J.</given-names></name><name><surname>Lee</surname><given-names>J.-Y.</given-names></name><name><surname>Liao</surname><given-names>L.</given-names></name></person-group><year>2021</year><page-range>1-12,</page-range><pub-id pub-id-type="doi">10.1186/s12859-021-04080-0</pub-id></element-citation></ref><ref id="BIBR-21"><element-citation publication-type="journal"><article-title>Markov models - training and evaluation of hidden markov models</article-title><source>Nature Methods</source><volume>17</volume><person-group person-group-type="author"><name><surname>Firmasyah</surname><given-names>M.</given-names></name><name><surname>Setiawaty</surname><given-names>B.</given-names></name><name><surname>Purnaba</surname><given-names>I.G.P.</given-names></name></person-group><year>2020</year><page-range>121-122,</page-range><pub-id pub-id-type="doi">10.1038/s41592-019-0702-6</pub-id></element-citation></ref><ref id="BIBR-22"><element-citation publication-type="book"><article-title>Predicting the conditions of stock market using hidden markov models</article-title><volume>3201</volume><person-group person-group-type="author"><name><surname>Setiawaty</surname><given-names>B.</given-names></name><name><surname>Lestari</surname><given-names>A.Y.</given-names></name><name><surname>Lesmana</surname><given-names>D.C.</given-names></name><name><surname>Ardana</surname><given-names>N.K.K.</given-names></name></person-group><year>2024</year><page-range>020013,</page-range><publisher-name>AIP Publishing</publisher-name><pub-id pub-id-type="doi">10.1063/5.0230595</pub-id></element-citation></ref><ref id="BIBR-23"><element-citation publication-type="journal"><article-title>An expectation-maximization algorithm for continuous-time hidden markov models</article-title><source>arXiv</source><issue>2103.16810</issue><person-group person-group-type="author"><name><surname>Wang</surname><given-names>Q.</given-names></name><name><surname>B</surname><given-names>W.</given-names></name></person-group><year>2021</year><page-range>1-34,</page-range><pub-id pub-id-type="doi">10.48550/arXiv.2103.16810</pub-id></element-citation></ref><ref id="BIBR-24"><element-citation publication-type="journal"><article-title>Parameter estimation of exponential hidden markov model and convergence of its parameter estimator sequence</article-title><source>International Journal of Applied Mathematics</source><volume>31</volume><issue>1</issue><person-group person-group-type="author"><name><surname>Firmasyah</surname><given-names>M.</given-names></name><name><surname>Setiawaty</surname><given-names>B.</given-names></name><name><surname>Purnaba</surname><given-names>I.G.P.</given-names></name></person-group><year>2018</year><page-range>53-62,</page-range><pub-id pub-id-type="doi">10.12732/ijam.v31i1.5</pub-id></element-citation></ref><ref id="BIBR-25"><element-citation publication-type="journal"><article-title>Semi-supervised adapted hmms for p2p credit scoring systems with reject inference</article-title><source>Computational Statistics</source><volume>38</volume><issue>1</issue><person-group person-group-type="author"><name><surname>Annas</surname><given-names>M.El</given-names></name><name><surname>Benyacoub</surname><given-names>B.</given-names></name><name><surname>Ouzineb</surname><given-names>M.</given-names></name></person-group><year>2023</year><page-range>149-169,</page-range><pub-id pub-id-type="doi">10.1007/s00180-022-01220-9</pub-id></element-citation></ref><ref id="BIBR-26"><element-citation publication-type="journal"><article-title>The akaike information criterion: Background, derivation, properties, application, interpretation, and refinements</article-title><source>WIREs Computational Statistics</source><volume>11</volume><issue>3</issue><person-group person-group-type="author"><name><surname>Cavanaugh</surname><given-names>J.E.</given-names></name><name><surname>Neath</surname><given-names>A.A.</given-names></name></person-group><year>2019</year><page-range>1-12,</page-range><pub-id pub-id-type="doi">10.1002/wics.1460</pub-id></element-citation></ref><ref id="BIBR-27"><element-citation publication-type="journal"><article-title>Forecasting heating and cooling loads of buildings: a comparative performance analysis</article-title><source>Journal of Ambient Intelligence and Humanized Computing</source><volume>11</volume><person-group person-group-type="author"><name><surname>Roy</surname><given-names>S.S.</given-names></name><name><surname>Samui</surname><given-names>P.</given-names></name><name><surname>Nagtode</surname><given-names>I.</given-names></name><name><surname>Jain</surname><given-names>H.</given-names></name><name><surname>Shivaramakrishnan</surname><given-names>V.</given-names></name><name><surname>Mohammadi-ivatloo</surname><given-names>B.</given-names></name></person-group><year>2020</year><page-range>1253-1264,</page-range><pub-id pub-id-type="doi">10.1007/s12652-019-01317-y</pub-id></element-citation></ref></ref-list></back></article>