Title Science and Technology Indonesia e-ISSN:2580-4391 p-ISSN:2580-4405 Vol. 5, No. 2, April 2020 Research Paper A Hidden Markov Model for Forecasting Rainfall Data Availability at the Weather Station in West Sumatra Rahmawati Ramadhan1, Dodi Devianto1* 1Department of Mathematics, Andalas University, Limau Manis Campus, Padang 25163, Indonesia *Corresponding author: ddevianto@sci.unand.ac.id Abstract Indonesia is a maritime continent in Southeast Asian, laying between Indian Ocean and Pacific Ocean. This position intensely a�ects the level of rainfall in Indonesia, especially West Sumatra. The availability of rainfall data can form a Markov chain which its state is not able to be observed directly (hidden), is called the Hidden Markov Model (HMM). The purposes of this research are to predict the hidden state of the availability of rainfall data using decoding problems and to find the best state sequence (optimal) by using Viterbi Algorithm, and also to predict probability for the availability of rainfall data in the future by using the Baum Welch Algorithm in the Hidden Markov Model. This research uses secondary data with a period of one day from the availability of rainfall data at the Minangkabau Meteorological Station, Padang Pariaman Climatology Station, and Silaing Bawah Geophysics Station from January 2018 to July 2019. The results of the prediction show that the Hidden Markov Model can be used to predict the probability of rainfall data availability. The results for the availability of the highest rainfall data for one day ahead is at the Padang Pariaman Climatology Station, with a probability of 0.36, followed by Minangkabau Meteorological Station is 0.35, and Silaing Bawah Geophysics station is 0.29. The result has shown for the next one day period the probability of rainfall data available from the three stations will be available following the Viterbi algorithm. Keywords Hidden Markov Model, Rainfall, Decoding Problem Received: 12 February 2020, Accepted: 03 April 2020 https://doi.org/10.26554/sti.2020.5.2.34-40 1. INTRODUCTION A water particle that falls to the earth’s surface through a series of hydrological processes is the occurrence of rain. Meanwhile, rainfall is the height of the rainwater that falls to the earth’s surface to a �at within a certain period. Many say the least precipitation in an area in�uenced by several factors, including factors latitude, altitude, and distance from the source of the water, the wind, the mountain areas, the temperature di�erence, and the total land area. In analyzing the availability of rainfall in the future maybe associated with a stochastic process, where the problem is related to the chance of future events that they cannot be predicted directly on the availability of rainfall data. States of availability of rainfall data are uncertain and subject to change, and it is assumed there are some unobserved circumstances; it can be modeled by Hidden Markov Model (HMM). HMM is a broadening of the Markov chain in which the state cannot be observed directly (hidden), but can only be ob- served through a set of other observations. In HMM, there are three fundamental problems to be solved that problem evalu- ation, decoding problems, and learning problems. Based on research by Thyer and Kuczera (2003), they have discussed a calibration model with Bayesian approach on rainfall data by using HMM, the same thing was done by Sansom (1998) for the data breakpoint. Some research that uses inhomogeneous HMM and nonparametric model reduction of rainfall events has been carried out also by Mehrotra and Sharma (2005); Robertson et al. (2004); Greene et al. (2011); Pineda and Willems (2016). Furthermore, there are some HMM models introduced by previous researchers, the abundance of species in the river with HMM with negative binomial model approach discussed by Spezia et al. (2014). According to research conducted in Xia and Tang (2019); Li et al. (2018); Bathaee and Sheikhzadeh (2016), HMM also associated with Bayesian analysis. Meanwhile, in the case of time series, there is a lot of research that studies the hidden Markov models, one of which discusses the most reliable classi�cation of multivariate time series as described Antonucci et al. (2015), and categories with HMM multiple time series by Colombi and Giordano (2015). Also besides, HMM also is used in the �nancial case is to predict trends in the time series as discussed in Zhang et al. (2019) and to predict the probability https://doi.org/10.26554/sti.2020.5.2.34-40 Ramadhan et. al. Science and Technology Indonesia, 5 (2020) 34-40 of the changes of the exchange rate as discussed in Ramadhan et al. (2020). Based on the research of Devianto et al. (2015b), the techniques to build models using �nancial data can be used au- toregressive fractionally integrated moving average (ARFIMA). Furthermore, the enumeration models have been developed with an exponential distribution characterization approach described in Devianto (2016); Devianto et al. (2015a,c). According to research conducted in Stoner and Economou (2019), it is illustrated how the hidden Markov framework could be adapted to construct a compelling model for sub-daily rainfall, which is capable of capturing all of these essential characteristics well. Several homogenous Hidden Markov Models (HMMs) were developed to forecast droughts using the Standardized Precipi- tation Index, SPI, at short-medium term, as discussed in Khadr (2016). The hidden Markov sequence was assigned to represent the recurrence of mast years, as described in Tseng et al. (2020). Model availability of rainfall data can be formed into a hid- den state HMM with attention. In this study, there are three fundamental problems to be solved that are evaluations prob- lem, decoding problems, and learning problems. The results can provide information about the availability of rainfall data in particular areas of West Sumatra in the future. Historical information about the availability and the accuracy of rainfall data will be very helpful in predicting climate change and irregu- larities. In addition, by obtaining an overview of future weather conditions, the speci�c policy considering water supply, plant performance and yield can be estimated for better preventive of resources for community. 2. EXPERIMENTAL SECTION 2.1 Materials A sequence of events that ful�ll the legal requirement of prob- ability, where every value randomly changed against time. A Stochastic process predicted the properties of the future depend on the properties of the current conditions based on their charac- teristics in the past called a Markov chain (Ross, 1996). Stochastic process Xn(t) is a series of random variables that change with the time of observation t�T, and a stochastic process Xn is said to have Markov properties if, P(Xn+1 = j|Xn = i,Xn−1 = in−1, ....,X0 = i0) (1) = P(Xn+1 = j|Xn = i) for time and for every n = 0, 1, 2, ... and for every j, i, in−1, ..., i1, i0 HMM is a stochastic model where the system is assumed to be a Markov Process with hidden states. If X = (X1,X2, . . .) is a Markov process and O = (O1,O2, . . .) is a function of X , then is a Hidden Markov Model which can be observed through O, or can be written to a function f . The parameter X represents the state process that is hidden, while parameter O states an observation room that can be observed. The elements of the Hidden Markov Model are: 1. The number of hidden state elements (hidden state) repre- sented by N as the number of states which the probability of a denoted state space S = (S1,S2, . . . ,SN ) and the state at the time t denoted by Xt, t = 1, 2, . . . ,T 2. The number of observations (observation) of each state represented by M, where probability every state repre- sented by v = v1,v2, . . . ,vM and space observation repre- sented by O = (O1,O2, . . . ,OT ), which T is the length of the observation data. 3. The transition probability matrix A = [aij] where aij is an element of A which is the conditional probability of the state at the time , given the state at the time , that is aij = P(Xn+1 = j|Xn = i) (2) for 1 ≤ i, j ≤ N 4. Observation probability distribution at the time t, at state j, commonly known as emission matrix B = [bik] (3) where bik = P(Ot = vk|Xt = i) (4) for 1 ≤ j ≤ N , 1 ≤ t ≤ T and 1 ≤ k ≤ M 5. The initial state distribution represented by �(i) where �(i) = P(X1 = i, 1 ≤ i ≤ N) (5) So HMM can be written in the notation �=(A,B,�) where A is expressed by the matrix of transition probability, B a chance observation matrix known as emission matrix, and � is the dis- tribution of the initial state. There are three special algorithms that can be solved by HMM method, namely: a) Evaluation Problem To calculate the probability of the observation sequence P(O|�) requires forward algorithms and backward algorithms (Bain and Engelhardt, 1992). Steps to resolve with the advanced algorithm are as follows: i. Initial Step In this initial step, we determined the initial observation probability �1(i) which ends at state at the time if it is known a sequence of preliminary observations O1 is as follows: �(i) = �(i)bi(Oi) (6) for 1 ≤ i ≤ N ii. Induction step In this induction step, we determined the total observation probability �t+1(j) which end in state i at the time i = 2, 3, 4, ..., if known a sequence of observations O1,O2, ...,Or is as follows: �t+1(j) = { N ∑ i−1 �t(i)aij}bj(Ot+1) (7) for j = 1, 2, .....N , t = 1, 2, ...,T iii. Termination step On termination of this step, we deter- mined the total combined odds of observation and the hidden © 2020 The Authors. Page 35 of 40 Ramadhan et. al. Science and Technology Indonesia, 5 (2020) 34-40 state when known a model so that it is known probability obser- vation sequence P(O|�), as follows: P(O|�) = N ∑ i−1 �T (i) (8) Next, calculate the probability of observation by using a backward algorithm �t(i), namely with as following steps : i. Initial step In this initial step, the initial observation prob- abilities otherwise equal to one, this is because it is assumed i is the �nal state, and zero for the other can be expressed as �t(i) = 1 (9) for 1 ≤ i ≤ N ii. Induction step In this induction step, we determined the total observation probabilities for t < 1 , as follows: �t(i) = N ∑ j−1 aijbj(Ot+1)�t+1(j) (10) for t = T − 1,T − 2, ...1 and i = 1, 2, ...,N iii. Termination step In this step, the total odds will be deter- mined combination of observation and the hidden state when known a model so that it is known probabilities observation sequence P(O|�), as follows P(O|�) = N ∑ i−1 bi(1)�(1)�1(i) (11) b) Decoding Problem Decoding problem, this decoding step is to �nd the best state sequence (optimal) associated with the observation of O and a model of �, which has also been known. This problem can be solved by the Viterbi Algorithm. Steps in the Viterbi algorithm to determine the best state sequence are as folows i. Initial step In this initial step, it will be determined the greatest proba- bilities throughout t the �rst observation and ends in state i to t = 1, as follows: �1(j) = bi(O1)�(i) 't(i) = 0, 1 ≤ i ≤ N (12) ii. Recursion Step In this recursion step, it will be determined greatest proba- bilities throughout t the �rst observation and ends in state i for t > 2 , as follows �t(j) = max1≤i≤N[�t−1(i),aij]bj(Ot) 't(j) = arg max1≤i≤N[�t−1(i),aij] (13) for 2 ≤ t ≤ T and 1 ≤ j ≤ N iii. Termination Step On termination of this step, it will be determined the greatest probabilities throughout t the �rst observation and ends in state i, as follow P+ = max 1≤i≤N [�T (i)] X+T = arg max1≤i≤N[�T (i)] (14) iv. Backtracking Step In this last step, it will be determined the best state sequen ce, as follow X+t = 't+1(X+t+1), t = T − 1,T − 2, ..., 1 (15) c) Learning Problem This problem estimates the best model to explain a sequence of observations, where the changing parameters of HMM, � = (A,B,�) so that P(O|�) becomes the maximum. In the Baum- Welch algorithm, also de�ned four variables, namely: variable forward (forward), variable backward (backward), variable �t(i, j), and the variable t(i). Forward variable and backward variable will be used in the calculation of the variable �t(i, j) and the variable t(i), so the estimation formula learning problem is as follows: �̂(i) = t(i), 1 ≤ i ≤ N âij = ∑T−1t=i �t(i, j) ∑T−1t=1 t(i) , 1 ≤ i ≤ N, 1 ≤ j ≤ N b̂ij = ∑t=1t=1,O=j t(i) ∑T=1t=1 t(i) , 1 ≤ j ≤ N, 1 ≤ k ≤ M (16) where �̄(i) is the estimated value of initial state, âij is the matrix of the estimated value of transition probabilities, and b̂ij is the matrix of the estimated value of emission matrix. 2.2 Methods In this study, the data to be used only calculates rainfall data for 17 months on January 1, 2018, to July 31, 2019, with a period of one day, from the contribution of rainfall data at the Minangk- abau Meteorological Station (MM station), Padang Pariaman Cli- matology Station (PPC station), and Silaing Bawah Geophysics Station (SBG station), it is obtained at the website address dataon- line.bmkg.go.id with the amount of data used in one station is 570. Presentation of rainfall data in diagram form can be seen from the Figure 1 as follows Based on Figure 1, it can be seen that the highest availability of rainfall data is at the MM station at 287 data, followed by the PPC station at 231 data and the SBG station at 219 data. The highest number of unavailable data of rainfall during the period © 2020 The Authors. Page 36 of 40 Ramadhan et. al. Science and Technology Indonesia, 5 (2020) 34-40 Figure 1. Rainfall data availability of research is at SBG station with 134 data, followed by PPC station with 122 data, and MM station with 66 data. From the three stations, each has 7 data that were not measured. This research uses HMM for forecasting the availability of rainfall data. That will be analyzed is rainfall data with predic- tions of probability rainfall on the next period, as follows: 1. Take rainfall data by a period of one day. The numbers of data have been observed in the range of time of 570 days. 2. Determine the transition probability matrix needed ex- change rate by using the following formula as a probability. P(A) = n(A)n(S) (17) where n(A) is the number of elements in A and n(S) is the total number of elements in S [22]. 3. Determine elements of HMM. 4. Analyze the elements of HMM that have been able to use where the HMM is calculated the probability of availability of an observation by using Forward-Backward algorithm, then it is followed by determining the sequences of hidden state by using the Viterbi algorithm, and it is predicting the HMM parameters by using the Baum-Welch algorithm. 5. Make the interpretations or conclusions from the results that have been obtained. 3. RESULT AND DISCUSSION 3.1 The Importance of Rainfall Data Availability by Con- troller Graph of Exponentially Weighted Moving Av- erage (EWMA) In this study, the EWMA control chart is used to see whether there is extreme rainfall or non-controlled data, such that the availability of rainfall data will be very crucial to observe. Rain- fall data had been taken from the weather stations in West Su- matera in 2018. The following chart is EWMA control of rainfall data. Based on Figure 2. This shows that there is extreme rainfall on the day of observation to-88, 89, 90, 91, 102, 103, 107, 108, 144, 145, 146, 147, 148, 238.239, 240, 241, 252, 271, 316, 336, 337, 338, 339, 340, 341, 364, 365, and 366. This means that there are 28 days with rainfall that is not controlled or extreme. This condition Figure 2. Rainfall EWMA Control Charts have indication there are changes in rainfall throughout the day, where there is a condition of very high rainfall or otherwise. The availability of rainfall data in these circumstances is very important in order to be taken to minimize losses related to changes in precipitation. Therefore, it is necessary to build a model of the availability of rainfall data in every weather station is West Sumatera by using HMM. 3.2 Elements of the Hidden Markov Model The elements that must be determined to solve the case of fore- casting the availability of rainfall data with HMM, as follows: 1. Suppose N , is the number of hidden states, with state space A = (S1,S2, . . . ,SN ) and the state at time t is expressed by Xt . In this case of rainfall data availability in MM station, PPC station, and SBG station. The hidden state is available, unavailable, and not measurement. So in this case study N = 3 or can be written as s1 = P(available), s2 = P(unavailable), s3 = P (no measurement). For example , Xt = 1, it states that the state is in a state of rainfall data available. 2. Let M, is the number of observations of each state, the observation space O = (O1,O2, . . . ,OT ) and the probability every observations expressed by v = (v1,v2, . . .vM), in this study M = 3, the MM station as v1, PPC station as v2, and SBG station as v3. 3. Let A = aij = P(Xt+1 = j|Xt = i) where A is the probability of availability of rainfall data over a range of values to j on day t +1 if it is known on day t is in the range value to i thus formed matrix probability are: A = [aij] = ⎡ ⎢ ⎢ ⎣ a11 a12 a13 a21 a22 a23 a31 a32 a33 ⎤ ⎥ ⎥ ⎦ a) Transition probability matrix MM station Data A = [aij] = ⎡ ⎢ ⎢ ⎣ 0.79 0.19 0.02 0.58 0.41 0.01 0.46 0.18 0.36 ⎤ ⎥ ⎥ ⎦ © 2020 The Authors. Page 37 of 40 Ramadhan et. al. Science and Technology Indonesia, 5 (2020) 34-40 b) Transition probability matrix PPC station Data A = [aij] = ⎡ ⎢ ⎢ ⎣ 0.74 0.25 0.01 0.46 0.52 0.02 0.42 0.25 0.33 ⎤ ⎥ ⎥ ⎦ c) Transition probability matrix SBG station Data A = [aij] = ⎡ ⎢ ⎢ ⎣ 0.64 0.35 0.01 0.47 0.50 0.03 0.33 0.42 0.25 ⎤ ⎥ ⎥ ⎦ 4. Emission matrix B = [bik], the conditional probability matrix observation vk if the process is in state j, matrix emissions observations MM station, PPC station, and SBG station are as follows: A = [aij] = ⎡ ⎢ ⎢ ⎣ 0.74 0.64 0.56 0.24 0.34 0.42 0.02 0.02 0.02 ⎤ ⎥ ⎥ ⎦ 5. Suppose �(i) is the initial state distribution, in case of the availability of rainfall data are assumed: �(1) = P(available), �(2) = P(unavailable), �(1) = P(no measurement). Initial matrix for MM station, PPC station, and SBG station are as follows: a) Initial matrix for MM station: � = ⎡ ⎢ ⎢ ⎣ 0.70 0.27 0.03 ⎤ ⎥ ⎥ ⎦ b) Initial matrix for PPC station: � = ⎡ ⎢ ⎢ ⎣ 0.62 0.36 0.02 ⎤ ⎥ ⎥ ⎦ c) Initial matrix for SBG station: � = ⎡ ⎢ ⎢ ⎣ 0.64 0.34 0.02 ⎤ ⎥ ⎥ ⎦ 3.2.1 Evaluation Problem with Forward and Backward Al- gorithm For the �rst problem on HMM, will be calculated the probability models � = (A,B,�) that represented by P(O|�) or probabilities of observation sequence O = (O1, O2, O3). This probability can be determined using the Forward and Backward algorithm. P(O = MKG|�) = N ∑ i=N at(i) = a4(1) + a4(2) + a3(3) = 0.091 P(O = MKG|�) = N ∑ i=N �1(i)�(i)bi(O1) = �1(1)�(i)b1(O1)+�1(2)�(2)b2(O1)+�1(3)�(3)b3(O1) = 0.091 Based on the results of the backward algorithm obtained are consistent with the obtained solution of the forward algorithms, namely the observation probabilities at 0.091. 3.2.2 Decoding Problem with Viterbi Algorithm For this problem decoding problem is how to determine the opti- mal sequence hidden state, in this case is available, not available, or no measurement with the sequence of observations that have been assumed. The Viterbi algorithm consists of three steps, including the following: X∗1 = 1,X∗2 = 1,X∗3 = 1 It means the most suitable sequence of available, unavailable, or no measurement rainfall data sequence for August 2019 is more widely available. 3.2.3 Learning Problem with Baum Welch Algorithm To calculate the parameters of HMM prediction using Baum Welch algorithm, it can be de�ned a new variable �t(i, j), that probability process in state i at the time t + 1. It follows �̂ = ⎡ ⎢ ⎢ ⎣ 1(1) 1(2) 1(3) ⎤ ⎥ ⎥ ⎦ = ⎡ ⎢ ⎢ ⎣ 0.9765 0.1078 7.201x10−4 ⎤ ⎥ ⎥ ⎦ The value at t(i) for t = 1 is an estimated of early chance. That means the value of P(O|�̂) > P(O|�) has completed, then the probability process in a state of rainfall data availability will be available by 0.9765, it will not be available is equal to 0.1078, and the estimation of the initial probability that no measurements is equal to 7.201 x 10-4. Meanwhile, for a prediction of the transition matrix aij that was written with âij is the ratio between the amount of displace- ment of state probability to state the amount of displacement in the state probability in the state i , as follows: âij = ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ ∑Tt−1 �t(1, 1) ∑Tt−1 t(1) ∑Tt−1 �t(1, 2) ∑Tt−1 t(1) ∑Tt−1 �t(1, 3) ∑Tt−1 t(1) ∑Tt−1 �t(2, 1) ∑Tt−1 t(2) ∑Tt−1 �t(2, 2) ∑Tt−1 t(2) ∑Tt−1 �t(2, 3) ∑Tt−1 t(2) ∑Tt−1 �t(3, 1) ∑Tt−1 t(3) ∑Tt−1 �t(3, 2) ∑Tt−1 t(3) ∑Tt−1 �t(3, 3) ∑Tt−1 t(3) ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ âij = ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ 2.3702 2.7670 0.3957 2.7670 1.013x10−3 2.7670 0.3064 0.4399 0.1331 0.4399 3.621x10−4 0.4399 1.157x10−3 2.273x10−3 10−3 2.273x10−3 10−5 2.273x10−3 ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ âij = ⎡ ⎢ ⎢ ⎣ 0.85 0.14 0.01 0.69 0.3 0.01 0.51 0.14 0.35 ⎤ ⎥ ⎥ ⎦ The matrix â(ij) is an estimator for the transition matrix aij . The matrix â(ij) describes to reach a value P(O | �̂) > © 2020 The Authors. Page 38 of 40 Ramadhan et. al. Science and Technology Indonesia, 5 (2020) 34-40 P(O | �) , then the transition probabilities of rainfall data at the state of availability will be the probability of the change conditions of "available" to "available" is 0.85, from "available" to "unavailable" is 0.14, from "available" to "no measurement" is 0.01. The probability of "unavailable" to "available" is 0.69, from "unavailable" to "unavailable" is 0.3, from "unavailable" to "no measurement" is 0.01. The probability for conditions as well as of "no measurement" to "available" is 0.51, "no measurement" to "unavailable" is 0.14, "no measurement" to "no measurement" is 0.35. Likewise with predictions emission matrix bik , which is denoted by b̂ik obtained from a comparison of the number of states that produce k observations when the process is in state i with the number of the entire process is in state i so that the emission matrix estimators obtained as follows âij = ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ ∑Tt−1,Ot−1 t(1) ∑Tt−1 t(1) ∑Tt−1,Ot−2 t(1) ∑Tt−1 t(1) ∑Tt−1,Ot−3 t(1) ∑Tt−1 t(1) ∑Tt−1,Ot−1 t(2) ∑Tt−1 t(2) ∑Tt−1,Ot−2 t(2) ∑Tt−1 t(2) ∑Tt−1,Ot−3 t(2) ∑Tt−1 t(2) ∑Tt−1,Ot−1 t(3) ∑Tt−1 t(3) ∑Tt−1,Ot−2 t(3) ∑Tt−1 t(3) ∑Tt−1,Ot−3 t(3) ∑Tt−1 t(3) ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ âij = ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ 0.9765 2.7670 0.9961 2.7670 0.7944 2.76700.1078 0.4399 0.1298 0.4399 0.2023 0.4399 7.201x10−3 2.273x10−3 5.074x10−4 2.273x10−3 1.045x10−5 2.273x10−3 ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ âij = ⎡ ⎢ ⎢ ⎣ 0.35 0.36 0.29 0.25 0.29 0.46 0.32 0.22 0.46 ⎤ ⎥ ⎥ ⎦ The matrix âik is an estimator for the conditional probability of matrix b̂ik. The matrix describes that to achieve value P(O | �̂) > P(O | �) , then the chances of availability of rainfall data for the period one day ahead for MM station is 0.35, for PPC station is 0.36, for SBG station is 0.29. Probabilities unavailability of rainfall data for the period of one day ahead for MM station is 0.25, for PPC station is 0.29, for SBG station is 0.46. Probabilities no measurement on rainfall data for the period of one day ahead for MM station is 0.32, for PPC station is 0.22, for SBG station 0.46. Based on the value of the probability of the rainfall data, SBG station has the greatest probability of unavailability and no measurements of rainfall data. It also impacts to sectors that have direct relation to the weather with rainfall conditions; one of them is in the agriculture sector that requires weather information to estimate an increase of output product. Hence, it is necessary to improve human resources and also a good device to do measurements of rainfall data. 4. CONCLUSIONS A stochastic process that meets the properties of probability in which the properties of future events depend on the properties of events in the present and the past and assumed there are properties of events that cannot be observed is called the Hidden Markov Model (HMM). Hidden Markov model by the learning problems with Baum-Welch algorithm might be the probabil- ity for available data the highest rainfall in the period of the day to come in PPC station is 0.36. It is followed by probability available data is 0.35 in MM station and 0.29 in SBG station. As for decoding problem on HMM using the Viterbi algorithm can be concluded that for the period of one day ahead might be probabilities rainfall data availability in MM station, PPC station, and SBG station will be more widely available. The results of probability rainfall data availability can available. For the future, the results of probability rainfall availability in agriculture are to help anticipate extreme climate change, and can provide infor- mation and early warning to farm communities about drought or �ooding. In addition, this information is also needed in disaster mitigation as a basis for determining the policy to be taken. REFERENCES Antonucci, A., R. De Rosa, A. Giusti, and F. Cuzzolin (2015). Robust classi�cation of multivariate time series by imprecise hidden Markov models. International Journal of Approximate Reasoning, 56; 249–263 Bain, L. and M. Engelhardt (1992). Introduction to Probability and Mathematical Statistics. Duxbury Press: California Bathaee, N. and H. Sheikhzadeh (2016). Non-parametric Bayesian inference for continuous density hidden Markov mixture model. Statistical Methodology, 33; 256–275 Colombi, R. and S. Giordano (2015). Multiple hidden Markov models for categorical time series. Journal of Multivariate Analysis, 140; 19–30 Devianto, D. (2016). The uniform continuity of characteristic function from convoluted exponential distribution with stabi- lizer constant. In AIP Conference Proceedings. AIP Publishing LLC Devianto, D., Maiyastri, L. Oktasari, and M. Anas (2015a). Convo- lution of generated random variable from exponential distri- bution with stabilizer constant. Applied Mathematical Sciences, 9; 4781–4789 Devianto, D., M. Maiyastri, and S. Damayanti (2015b). Forecast- ing Long memory Time Series for Stock Price with Autoregres- sive Fractionally Integrated Moving Average. International Journal of Applied Mathematics and Statistics, 53(5); 86–95 Devianto, D., L. Oktasari, and Maiyastri (2015c). Some proper- ties of hypoexponential distribution with stabilizer constant. Applied Mathematical Sciences, 9; 7063–7070 Greene, A. M., A. W. Robertson, P. Smyth, and S. Triglia (2011). Downscaling projections of Indian monsoon rainfall using a non-homogeneous hidden Markov model. Quarterly Journal of the Royal Meteorological Society, 137(655); 347–359 Khadr, M. (2016). Forecasting of meteorological drought using Hidden Markov Model (case study: The upper Blue Nile river basin, Ethiopia). Ain Shams Engineering Journal, 7(1); 47–56 Li, X., V. Makis, H. Zuo, and J. Cai (2018). Optimal Bayesian control policy for gear shaft fault detection using hidden semi- © 2020 The Authors. Page 39 of 40 Ramadhan et. al. Science and Technology Indonesia, 5 (2020) 34-40 Markov model. Computers & Industrial Engineering, 119; 21– 35 Mehrotra, R. and A. Sharma (2005). A nonparametric nonhomo- geneous hidden Markov model for downscaling of multisite daily rainfall occurrences. Journal of Geophysical Research: Atmospheres, 110(D16) Pineda, L. E. and P. Willems (2016). Multisite downscaling of sea- sonal predictions to daily rainfall characteristics over Paci�c– Andean River Basins in Ecuador and Peru Using a nonhomo- geneous Hidden Markov model. Journal of Hydrometeorology, 17(2); 481–498 Ramadhan, R., D. Devianto, and M. Maiyastri (2020). Hidden Markov Model for Exchange Rate with EWMA Control Chart. In Proceedings of the Proceedings of the 1st International Con- ference on Statistics and Analytics, ICSA 2019, 2-3 August 2019, Bogor, Indonesia. EAI Robertson, A. W., S. Kirshner, and P. Smyth (2004). Downscal- ing of daily rainfall occurrence over northeast Brazil using a hidden Markov model. Journal of climate, 17(22); 4407–4424 Ross, S. M. (1996). Stochastic Processes P. John Wiley & Sons Sansom, J. (1998). A hidden Markov model for rainfall using breakpoint data. Journal of Climate, 11(1); 42–53 Spezia, L., S. Cooksley, M. Brewer, D. Donnelly, and A. Tree (2014). Modelling species abundance in a river by Negative Binomial hidden Markov models. Computational Statistics & Data Analysis, 71; 599–614 Stoner, O. and T. Economou (2019). An Advanced Hidden Markov Model for Hourly Rainfall Time Series. Cornell University Report: UK, arXiv: 1906.03846 Thyer, M. and G. Kuczera (2003). A hidden Markov model for modelling long-term persistence in multi-site rainfall time series 1. Model calibration using a Bayesian approach. Journal of Hydrology, 275(1-2); 12–26 Tseng, Y.-T., S. Kawashima, S. Kobayashi, S. Takeuchi, and K. Nakamura (2020). Forecasting the seasonal pollen index by using a hidden Markov model combining meteorological and biological factors. Science of The Total Environment, 698; 134246 Xia, Y.-M. and N.-S. Tang (2019). Bayesian analysis for mixture of latent variable hidden Markov models with multivariate longitudinal data. Computational Statistics & Data Analysis, 132; 190–211 Zhang, M., X. Jiang, Z. Fang, Y. Zeng, and K. Xu (2019). High- order Hidden Markov Model for trend prediction in �nancial time series. Physica A: Statistical Mechanics and its Applica- tions, 517; 1–12 © 2020 The Authors. Page 40 of 40 INTRODUCTION EXPERIMENTAL SECTION Materials Methods RESULT AND DISCUSSION The Importance of Rainfall Data Availability by Controller Graph of Exponentially Weighted Moving Average (EWMA) Elements of the Hidden Markov Model Evaluation Problem with Forward and Backward Algorithm Decoding Problem with Viterbi Algorithm Learning Problem with Baum Welch Algorithm CONCLUSIONS