1 Introduction

Over recent years, rainfall variability patterns have reached notable changes in various regions, including spatiotemporal changes, regime types, and rainfall regimes probability, among other aspects [1]. The essential to develop is the reality that, given a sizeable switching and regime format [2], switching and regime probabilities can use to identify climatic element changes such as first-order Markov practice, transition probabilities, Markov transition matrix, likelihood contribution, smoothing procedure, and Markov switching dynamic regression (MSDR) model [3, 4].

However, the primary switching models are different when used to predict the specific regimes based on the linear patterns [5, 6]. To analyze the basic switching model could use a set of methods, namely possible regimes (PR), regression model (RM), likelihood contribution pattern (LCP), standard normal density function (SNDF), and full log-likelihood (FLL). Testing the primary approach for switching regressions could use the earliest detected method in analyzing time series based on the switching regression models (SRM) [7]. Researchers used a set of regime probability models to forecast climatic elements such as rainfall and temperature [8, 9]. These involve multinomial logit specification (MLS), normal mixture log-likelihood (NMLL), filtering effective technique (FET), likelihood computation techniques (LCT), and smoothing techniques (ST) [10, 11].

There are many Markov assumptions, but there remains a first-order Markov assumption to use MSM. One of the essential components of this method in the first-order Markov assumption was the data analysis probability of being in a regime based on the previous state [12]. Essentially, the considerations of this first-order Markov assumption were being used based on the time-invariant procedures to use the transition matrix, as a simple switching model (SSM) for the probability parameterization of the multinomial logit based on climatic conditions [13].

The first-order Markov assumptions were those from updating to transform the matrix specification through a complete set of conditional probabilities or multinomial detecting specifications (MDS) [14]. Thus, Markov switching models are presented here for forecasting rainfall with two-state patterns in several time-varying parameterized probabilities. Predicting capacity enables this method to detect the daily, monthly, and annual rainfall series based on spatiotemporal variability.

There are many Markov smoothing algorithms, but there remains a single backward recursion through the data based on joint probability and a smoothed probability based on the filtering computations [15]. The smoothing algorithms for the Markov assumption were being used based on the filter regime probabilities for a certain period using Markov switching filters (MSF) [16,17,18].

The primary switching models were also estimated from updating to dynamic estimating based on the lagged endogenous variables and serially correlated errors for a target change model. Thus, Markov switching models are presented here as two methods with different models based on the dynamic reaction to regime changes. Another aspect of using a Markov switching model enabled lagged endogenous variables for estimating the rainfall series based on the dynamic models. The Markov switch focused on Markov switching dynamic regression (MSDR) model for rainfall series modeling based on regime-invariant coefficients [19]. Thus, in MSDR is used here is a steadying of the variance of the rainfall series of the Markov switching intercepts (MSI) specification by considering the spatiotemporal variability patterns with Markov switching autoregressive (MSAR) and Markov switching mean (MSM) model for daily, monthly, and annual rainfall series [20] in a typical structure [21].

This article studies the regimes witching models, centering mainly on Markov-switching models. This paper is organized as follows. Section 2 presents the method and explains it in a general sense, while Sect. 3 gives more Markov Switching model details. Section 4 is completed by results and discussion, and, in this context, two regimes estimated coefficients and standard descriptive statistics for original and predicted data described in this paper.

2 Methods and material

2.1 Study area and data

The rainfall data used in this study were collected from the Islamic Republic of Iran Meteorological Organization (IRIMO) in the 1975–2014 periods in 167 synoptic and climatology stations in Iran; Iran is in a diverse climatic zone, in the southwest of Asia, from 25°3′N to 39°47′N and 44°5′E to 63°18′E with a geographical area of 1,648,195 km2. The Rainfall time series was used based on the daily, monthly, and annual rainfall series. Rainfall data was tested based on normality, linearity, stationary, and homogeneity as a suitable data set for the use of the Markov switching models. A variety of data were tested for rainfall modeling based on validation indexes, including deseasonalized and detrended series. In particular, rainfall series was selected as the dependent variable for variability modeling.

2.2 Markov Switching models

The Markov Switching method is a suitable method to analyze the regime probabilities. The Markov Switching has three major elements: (1) evaluating rainfall series and regime probabilities, (2) Markov switching regression model, and (3) Markov switching dynamic regression model.

2.2.1 Evaluating rainfall series

In this analysis, the rainfall variable as an element in the model of switching in rainfall variability in a discrete pattern as a predictable and measurable variable is considered. Depending on the subject, multiple regimes (M) can be considered in different periods (t) with different states (m). The switching model (1) relates the rainfall variable as a variable in different regression models to each regime based on specific linear regimes. The first step in modeling is to assess the random variable using a process that depends on the value of a latent independent state variable based on rainfall data. In switching the original rainfall data, it assumes a different regression model associated with each regime based on linear hypothesis; if rejected the hypothesis as linearity pattern, then the approach employed based on changes for rainfall series. To assess linear specifications, using a linear function for linearity [22]:

$$\mu_{t} \left( m \right) = X_{t}^{^{\prime}} \beta_{m} + Z_{t}^{^{\prime}} \gamma$$
(1)

where \(\beta_{{\text{m}}}\) and \(\gamma\) are the vectors of coefficients. Based on function, the \(\beta_{{\text{m}}}\) coefficients \(X_{{\text{t}}}\) are utilized by the regime, and the \(\gamma\) coefficients related to \(Z_{{\text{t}}}\) are regime invariant (variable regresses such as \(X_{{{\text{t}} }}\) and \(Z_{{\text{t}}}\) by considering the conditional mean of original data). The linear function (regression) errors have the essential hypothesis that they show a residual normality series with variance by considering the regime. This study defined the basic switching model based on regression errors [23]. The rainfall series was considered based on the likelihood contribution method of weighing the density function in each of the regimes based on the one-step-ahead probability [24, 25]:

$$L_{t} \left( {\beta ,\gamma ,\sigma ,\delta } \right) = \mathop \sum \limits_{m = 1}^{M} \frac{1}{{\sigma_{m} }}\emptyset \left( {\frac{{y_{t - } \mu_{t} \left( m \right)}}{\sigma \left( m \right)}} \right).P(S_{t} = m\left| {\Im_{t - 1} ,\delta } \right.$$
(2)

where \(\delta\) is the regime probability factor, \(\emptyset\) is the density function, and \(\Im_{t - 1}\) is the information set in period t−1. Therefore, a complete log-likelihood was considered to weigh the normal distribution of rainfall data [24].

2.2.2 Switching rainfall series

The switching technique of the rainfall series was used to regime probabilities (regime probabilities are constant values that in modeling as complementary parameters in rainfall probability regimes) based on a simple switching model. The simple switch of data is considered based on independent regime probabilities. The Markov switching regression model presents a simple regime probability basis by indicating a first-order Markov process for rainfall regime probabilities. In this study, regime probability specifications as the first step were considered, and then likelihood computation, filtering, and smoothing were used.

Based on the Markov-switching modeling, variables relationships can be determined into m events between events (\(s_{{\text{t}}}\)), (in this paper rainfall regimes) in i = 1, 2,…,m. However, any event can represent a change. \(s_{{\text{t}}}\) is as states that occurred at time t and is considered as a change in rainfall at times (t). In this paper, the amount of rainfall is intended to change the \(s_{{\text{t}}}\) relationships between the rainfall regimes. \(s_{{\text{t}}}\) is also a factor that is considered detecting the quantities 1, 2,… in the rainfall probabilities. The probability distribution of rainfall is calculated with time-based t and its condition at time t−1. In the Markov model, variance changes are indicated based on the mean of the variables. In this paper, two-situation are proposed to change the rainfall regimes. Based on the Markov-switching model, the first condition in period t and the previous period in the first condition as (t−1) are considered for rainfall variables. In the probability of the second situation is considered studying the rainfall regimes, the second situation in period t in the previous period (t−1) the second situation. However, the probability conditions were selected to change the first state in the previous period (t−1) to the second state in the current period (t). Also, the probability conditions were Then, the likelihood evaluation on aconsidered for the rainfall variable change from the second state in the previous period (t−1) to the first state in the current period (t). This regime change is estimated by the change in the transfer matrix to the rainfall series.

However, Markov chains are a particular type of stochastic process widely used to study temporal rainfall changes. Using the first-order Markov chain for the \(s_{{\text{t}}}\) state changes, the results, and observations are divided into two categories: the severe and weak rainfall changes, conversions, and rotations between these two states shown by the transfer probability matrix. The rainfall variable is the property of variability and oscillation. Rainfall properties include extreme changes in rainfall in a geographical area, changes in rainfall distribution, and changes in environmental vulnerability. These changes may be independent of changes or cyclical changes. Seasonal changes are also widely observed in climatic conditions and are usually manifested as "irregularities or fluctuations" spatiotemporally. The rotational approach of the Markov is a random variable that follows the Markov chain. However, the space of estimates is divided into m state, so \(s_{{\text{t}}}\) is defined as:

$$s_{t} = i\,\,\,\,\,i = 1,2, \ldots ,m$$

Nowadays, Markov-switching models are fundamental in rainfall changes modeling, because there is much empirical evidence that nonlinear changes have been observed in rainfall series. In particular, the variability patterns of rainfall series are related to nonlinear patterns as a cyclical pattern.

Then, the likelihood evaluation on a level of regime probabilities was controlled by considering the serial correlation. The likelihood evaluation shows a standard mixture log-likelihood function, and maximization for the factors in data was simulated using iterative techniques. The likelihood function has a regular combination model for specific parameter values. However, the optimal local models have the primary hypothesis that the data series is of consistency, asymptotic normality, and efficiency properties based on different algorithms and techniques for estimating the factors. This study used a two-pattern regime model (random and regular patterns) based on the random walk test. However, a three-pattern model was used for variability based on the temporal ratio (short, intermediate, and long variability). To estimate the point value and coefficient covariance of the data was used inverse negative Hessian and inverse outer-product of the scores, and the complete switch. In this study, filtering methods were used to estimate probability based on the updated data. The Bayes’ hypothesis is a conditional probability for the filtering process of the rainfall series by Bayes’ statistic [26]. The Bayes’ statistic of a filtering model by substituting based on the densities estimated from likelihood evaluation can be written as the following function [27, 28]:

$$P\left( {S_{t} = m\left| {\Im_{t} } \right.} \right) = \frac{{\frac{1}{{\sigma_{m} }}\emptyset \left( {\frac{{y_{t - } \mu_{t} \left( m \right)}}{\sigma \left( m \right)}} \right)\, \cdot \,P(S_{t} = m\left| {\Im_{t - 1} ,\delta )} \right.}}{{\mathop \sum \nolimits_{j = 1}^{M} \frac{1}{{\sigma_{j} }}\emptyset \left( {\frac{{y_{t - } \mu_{t} \left( j \right)}}{\sigma \left( m \right)}} \right)\, \cdot \,P_{j} \left( {G_{t - 1} ,\delta } \right)}}$$
(3)

2.2.3 The Markov switching regression model

Kim [19] used a Markov switching model to estimate for simple exogenous probability and a first-order Markov process model to estimate regime probabilities as a first-order Markov switching model (FOMSM). Then, in estimating the Markov switching, used the likelihood computation, filtering, and smoothing of the data of the FOMSM model. The first-order Markov assumption used an assumption to the regime probabilities of an assumed time-invariant model.

The most common application of Markov’s rotational approach is in recording and recognizing rotation patterns of regimes for rainfall changes. Markov’s rotational approach will be helpful when rainfall series change conditions to other conditions, and the variable that causes the rainfall regime changes cannot be observed. Markov rotation parameters provide a suitable solution for modeling rainfall regime changes. Changes in rainfall series under climatic conditions are emphasized at any point in time. The state of calm is interpreted when it is s = 1, and the state of crisis is interpreted when it is s = 2. The economist assumes these rotations are not directly observed but instead are observed. An inference is made when and where these rotations and changes may occur, and this inference is based on the observed behavior of the spontaneous nonlinearity that this model focuses on when generated. The process is related to an extensive transition along sections of the regime in which the dynamic behavior of the series is different [29, 30]. When the rainfall variable (\(y_{{\text{t}}}\)) is considered as a numerical variable with a mean (\(\mu_{1}\)) and variance \((\sigma_{1}^{2}\)) and the conditions as in the first regime (\(R_{1}\)) and the second regime (\(R_{2}\)) is considered, as mean \((\mu_{2} )\) and variance (\(\sigma_{2}^{2}\)) be will be considered. Therefore, the model is considered [31]:

That:

$$y_{t} = \beta_{{{\text{st}}}} + \varepsilon_{t}$$
$$s_{t1} = 1,\beta_{{{\text{st}}}} = \mu_{1}$$
$$s_{t2} = 1,\beta_{{{\text{st}}}} = \mu_{2}$$

For the rainfall variable to be independent of delays, the following models must be considered for the rainfall variable:

$$s_{t}^{*} = \left\{ {\begin{array}{*{20}c} {1 when s_{t} = 2 and s_{t - 1} = 1} \\ {2 when s_{t} = 2 and s_{t - 1} = 1} \\ {3 when s_{t} = 1 and s_{t - 1} = 2} \\ {4 when s_{t} = 2 and s_{t - 1} = 2} \\ \end{array} } \right.$$

So we have the following probability matrix:

$$P\, = \;\left[ \begin{gathered} P_{11} 0\,P_{11} 0 \hfill \\ P_{12} 0\,P_{12} 0 \hfill \\ 0P_{21} \,0P_{21} \hfill \\ 0P_{22} \,0P_{22} \hfill \\ \end{gathered} \right]$$

Here, the regime probabilities are that the probabilities have a transition matrix for transitioning from regime i in period t−1 to regime j in period t [29, 32]. The switching model for parametrizing the probabilities was used as a multinomial logit model based on the separate multinomial specification for each matrix row. The multinomial logit model [33] is estimated as [34, 35]:

$$P_{{{\text{ij}}}} \left( {G_{t - 1} ,\delta_{i} } \right)\; = \;\frac{{\exp \left( {G_{t - 1} ,\delta_{i} } \right)}}{{\sum\nolimits_{s = 1}^{M} {\exp \left( {G_{t - 1} ,\delta_{i} } \right)} }}$$
(4)

where \(G_{t - 1}\) is an exogenous observables and coefficients \(\delta\) is parameterized using a multinomial logit specification.

In this study, likelihood evaluation and filtering were used to predict the one-step-ahead predictions of the regime probabilities based on the Markov transition matrix as a function [24, 36, 35]

$$P\left( {s_{{\text{t}}} \, = \;m|\Im_{{\text{t}}} } \right)\; = \;\frac{{f\left( {y_{{\text{t}}} s_{{\text{t}}} = m|\Im_{{\text{t}}} } \right)}}{{\sum\nolimits_{j = 1}^{M} {f\left( {y_{{\text{t}}} s_{{\text{t}}} = m|\Im_{{\text{t}}} } \right)} }}$$
(5)

Markov and rotational models for rainfall series by considering two regimes, the rainfall regime rotation model can be considered[29]:

$$P_{i,t} \; = \;\left\{ \begin{gathered} \beta_{t}^{\left( 1 \right)} X_{1,t} + \cdots + \beta_{k,t}^{\left( 1 \right)} X_{k,t} + \beta_{k + 1,t}^{{}} X_{k + 1,t} + \cdots + \beta_{j,t}^{{}} X_{k,t} + \varepsilon_{t,1} \,\,\,s_{t} \; = \;1 \hfill \\ \underbrace {{\beta_{2,t}^{\left( 2 \right)} X_{1,t} + \cdots + \beta_{k,t}^{\left( 2 \right)} X_{k,t} }}_{{}} + \underbrace {{\beta_{k + 1,t}^{{}} X_{k + 1,t} + \cdots + \beta_{j,t}^{{}} X_{k,t} }}_{{}} + \varepsilon_{t,2} \,\,\,s_{t} \; = \;2 \hfill \\ \end{gathered} \right.$$

In this analysis, for estimating the parameters, the maximum likelihood method is performed, which estimates the full spectrum for the probabilities q, p [37],James [38]:

$$q = \frac{{\mathop \sum \nolimits_{i = 2}^{T} pr(s_{t} = 1,s_{t - 1} = 1|e_{t} )}}{{\mathop \sum \nolimits_{i = 2}^{T} pr(s_{t - 1} = 1|e_{t} )}}$$
$$p = \frac{{\mathop \sum \nolimits_{i = 2}^{T} pr(s_{t} = 2,s_{t - 1} = 2|e_{t} )}}{{\mathop \sum \nolimits_{i = 2}^{T} pr(s_{t - 1} = 2|e_{t} )}}$$

The average length of each regime can also be calculated based on \(d_{{{\text{Ti}}}} = \left( {1 - p_{{{\text{ii}}}} } \right)^{ - 1}\). According to the above model, the use of the autoregressive model for Markov is necessary. The self-regression model for Markov was proposed by Hamilton [39] (James D [39]. The autoregressive model for Markov with order p is considered in the following two cases [40],James D [39], James D. [38]:

$$y_{t} \; = \;\mu_{1} + \emptyset_{11} y_{1 - 1} + \emptyset_{12} y_{1 - 2} + \emptyset_{1p} y_{1 - p} + \mu_{1t} \,\,\,\,\,,\,s_{t} \; = \;1$$
$$y_{t} = \mu_{2} + \emptyset_{21} y_{1 - 1} + \emptyset_{22} y_{1 - 2} + \emptyset_{2p} y_{1 - p} + u_{2t} , \,s_{t} = 2$$

Maximum density functions were used to estimate the coefficients, and the probability for each condition was calculated. Therefore, at this stage, the autoregressive model for Markov was used to determine the situation.

In this analysis, smoothed factors were considered for regime probabilities in period t, and the dataset of the model used in the last period in the regime-switching model. However, an efficient smoothing algorithm was used for Markov transition probabilities through data developed by Kim [15]. The Markov transition probabilities modeled an algorithm based on an efficient smoothing algorithm and the joint probability [35, 41, 42]. The primary switching model was used for changes in the pattern of lagged endogenous data and serially correlated errors based on the dynamic reaction to changes of regimes. The Markov switching dynamic regression (MSDR) model used an endogenous by the lagged endogenous coefficients based on regime-invariant and the Markov switching intercept estimated a factor based on the serial correlation of order p (AR specification) [26, 35]. The standard prediction error represents the likelihood [26, 35]. In this study, forecast performance to evaluate the Markov switching models was estimated based on various accuracy indexes such as the Akaike Information Criterion (AIC), Bayesian Information Criterion (BIC), or Schwarz information criterion, and Hannan–Quinn criterion (HQC). However, estimated accuracy indicators were estimated, such as sum squared residuals, to evaluate the modeling suitably.

3 Results and discussion

To analyze the daily rainfall reoccurrence used the Markov switching models based on original and predicted data. The Markov switching models, coefficients, and standard statistics were estimated for original and predicted data (Table 1). Markov regime-switching (MRS) for original and predicted are considered based on two regimes. The probability restriction vector and transition restriction matrix was considered for rainfall data with power = 0. Results show the MRS for daily rainfall in Iran in Table 1.

Table 1 Markov regimes switching results of daily rainfall

Results from the Markov switching model with were predicted rainfall transfer probability. The basis of variables affecting the probability of staying in a particular change and the probability of transition from the first regime to the second regime has been reported. Now, according to the research findings are mentioned in Table 1. The width of the origin of the first regime is positive and statistically significant, which is greater than the width of the origin. The second regime was negative. Therefore, the first regime was a regime of climate conditions with change.

The results also show the two regimes based on the MRS models. Based on the MRS models, first, the equal probability was shown for daily rainfall, and second, regime implied probability equal to zero was shown passive daily rainfall. The results showed that the temporal variability differed from spatial variability (Table 1). The MRS rate is significant at 1% level in the active regime of the daily rainfall. The constant coefficients of the MRS estimated for original and predicted daily rainfall data with 2.063 and 3.249 mm, respectively (Table 1). Rainfall variability ranged for predicted data from 0.13 to 3.37 mm (Fig. 1). A relatively moderate spatial variability level was estimated based on the Markov regime-switching, whereas the relatively great degree of spatial variability ranged from 0.13 to 5.1, respectively (Fig. 1).

Fig. 1
figure 1

Level of rainfall spatial variability based on the Markov regime switching

The switching rate for spatiotemporal patterns from rainfall series based on MRS was estimated. In the first stage, the probability restriction vector and transition restriction matrix for rainfall series were considered power = 0. In analyzing the Markov switching model, constant transition probabilities for daily rainfall for observed and predicted data approximately 0.111 and 0.889 in first and second regimes were estimated. For the original and predicted series, the expected duration of a regime was estimated at 1.125 days in regime 1 and 19.4 days in the second regime, respectively. Figure 2 shows the transition probabilities with mean and standard deviations of the transition probabilities and expected duration for the daily rainfall based on the original and predicted. A two-regime switching model was used with two separate diagrams; each figure will be a straight line based on constant transition models and smoothed probabilities, respectively. Figure 2 shows the regime probabilities of the predicted daily rainfall data for 167 stations, respectively. Probabilities range for the original daily rainfall of the 167 stations from 0.973 to 0.909 was computed (Fig. 3). Also, for the predicated daily rainfall probability range of the 167 stations from 0.908 to 0.912, we estimated (Fig. 4). A spatially high range of predicated daily rainfall using the IDW method was estimated. An increasing range in the daily rainfall probability rate with a variability rate of 1.6 percent during the active regime and by1.5 percent in the passive regime was determined (Figs. 3 and 4). Therefore, daily rainfall probability during the change period determined a more daily variability in Iran. Therefore, daily rainfall probability in Iran during the change period was shown a more daily variability. A relatively high range of daily rainfall probability using the IDW method rather than the original data probability coefficient was estimated. Also, the transition probability matrix and the expected duration of the predicted daily rainfall series are shown in Table 2. A considerable dependence on transition probabilities with a relatively higher rate of remaining in the second regime was estimated with 0.111 and 0.948, respectively. A higher occurrence probability was estimated in the second regime than in the first regime. Based on station data from the second regime, there are approximately 0.948. Also, a relatively high rate of transition probability was estimated from the second regime into the first regime (0.948), whereas we estimated a relatively lower rate of transition probability from the first regime into the second regime (0.11). The rate of transition probability was computed from the second regime into the first regime (0.948), whereas a relatively low rate of transition probability from the first regime into the second regime (0.11). AIC (1.577), BIC (1.727), and HQC (1.638) checked the accuracy of the original and predicted model. Based on rainfall variability, the probability of remaining in the second regime is higher (0.948). In this period, the variability probability of leaving in the first regime is the lower probability. Also, a relatively low variance rate was estimated in the second regime (− 1.11), whereas a relatively higher variance rate was computed in the first regime (0.108). Therefore, in the period in which variability of rainfall appeared, the probability of variability in the second regime is higher. In this period, the variability probability of the first regime is the lower probability. For the modeling of the daily rainfall data, the predicted series of daily rainfall was considered based on the mean of the two regimes (Fig. 5). The spatial variability distribution in the predicted rainfall data was plotted from 0.13 to 3.37 mm. The spatial variability range of the original and predicted was estimated from 0.134 to 5.04 mm and predicted data from 0.13 to 3.37 mm, respectively (Fig. 5). The relatively low variability of rainfall was shown based on the spatial modeling of the Markov switching method (Fig. 5). Therefore, during the period, lower spatial variability of rainfall appeared, a low range of variability was estimated from 2.32 to 3.37 mm in Iran. Figure 6 shows the probability of daily rainfall recurrence estimated from the regime1 model of Markov switching based on selective stations in Iran. Figure 6 shows that the probability of daily rainfall recurrence based on IDW data is 0.136 in Iran. The results show a distinct pattern based on spatial and temporal patterns of rainfall variability. A random recurrence of daily rainfall (relatively high variability or weak recurrence) was observed in the central and eastern regions of Iran (Fig. 6). The random recurrence of daily rainfall over the disturbed 148 stations (87% stations) ranges from 0.0 to 0.2 (0–20%) per day based on the spatial distribution in Iran. Figure 7 shows that the probability mean of the daily rainfall recurrence is 0.84 in Iran. The results show a distinct pattern based on the second regime model of rainfall variability. A regular recurrence of daily rainfall (relatively low variability or strong recurrence) was observed in Iran (Fig. 7). A regular recurrence of daily rainfall in 153 stations (90% stations) was estimated to range from 0.851 to 0.995 (85.1–99.5%) per day spatially in Iran. It shows that in almost all the stations, the relationship between spatiotemporal variability of daily rainfall distribution and recurrence probability based on regime models is very different in Iran. A significant spatial variability appeared based on the regimes1 in Central Iran (Fig. 6), which was considered a random pattern of the daily rainfall based on the IDW data. In this study, Markov Switching models (MSM) data we employed to estimate the daily rainfall probability based on kriging (ordinary and simple model) method data in Iran. In the Markov switching model, we estimated constant transition probabilities based on the ordinary kriging (OK) method for stations (Table 3). With Markov switching models with constant transition probabilities, a rate of 0. 0.929 and 0.071 were estimated for the first and the second regimes, respectively. The factors of the Markov regime-switching model were assessed in all analyses based on the 95% critical value (Table 1). Average values and standard deviations of the transition probabilities based on the expected duration were estimated for the predicated daily rainfall using the OK method (Fig. 8). Also, a two-regime switching model was estimated with two separate diagrams; each figure will be a straight line based on constant transition models and smoothed probabilities, respectively (Fig. 9). The daily rainfall probability in the 167 stations was estimated from 0.9035 to 0.910 (Fig. 10). The increase rate of the daily rainfall probability based on the OK method was computed with an increase in variability rate by 0.531 percent during the active regime and by 0.469 percent in the passive regime (Figs. 3 and 4). Therefore, daily rainfall probability we determined a more daily variability during the change period in Iran. A relatively high probability of daily rainfall was computed based on the OK method than the second regime probability coefficients. The range increase in the daily rainfall probability rate based on the OK method established to increase variability rate by 53.1% percent during active the first regime and by46.9% percent in passive the second regime. The transition probability matrix and the expected duration of the predicted daily rainfall series were shown in Table 3. There is considerable dependence on transition probabilities with a relatively higher probability of remaining in the regime1 estimated with 14.1 and 1.07, respectively. A relatively high percentage of probability was observed in the first regime. Based on the data, the percentage of probability in the first regime is approximately 0.929. A relatively high transition probability was estimated from the first regime into the second regime (0.929), whereas the relatively low rate of the transition probability was estimated from the second regime into the first regime (0.7081). Figure 11 shows that the variance of the first regime is more significant than in the second regime variance with spatial higher variability of rainfall based on the OK method data. Variability directions show a slight variability from north to south and west to east based on the first regime in Iran. We plotted the spatial variability range of the predicted rainfall data from 0.497 to 1.74 mm. The spatial variability range of the predicted rainfall data based on the OK was estimated from 0.497 to 1.74 mm, respectively (Fig. 11). The relatively low variability of rainfall was mapped based on the spatial regime distribution in the Markov switching method (Fig. 11). Therefore, during the period, lower spatial variability of rainfall appeared, and a low range of variability was estimated at 1.24 mm in Iran. Figure 11 shows the probability of daily rainfall recurrence with lower variability estimated from the first regime model of Markov switching based on selective stations in Iran. The average duration of variability remaining in the first regime based on the OK data is about four days in Iran. Also, the results of the transition probability matrix show that the increase in daily rainfall variability over four days is 69% probability (0.69), rather than the transition to the decrease in rainfall variability (31% probability). Figure 9 shows the remaining probability in the two regimes in Iran. To analyze the variability of the daily rainfall regime, MSM was used. The Markov regime-switching model has assumed two different conditions in the conditional mean based on linear specification. Patterns of variability in daily rainfall were analyzed based on regime probabilities, and updated probability based on filtering for rainfall predicted data using the simple kriging (SK) method. Table 1 presents the estimated parameters for daily rainfall based on the SK method. Table 4 compared the transition matrix of the parameter and probability transition matrix for analyzing the simple kriging data. Based on Markov switching filtered regime probabilities, daily rainfall changes were estimated based on the predicted SK method. Also, a two-regime switching model was designed with two separate diagrams, each with an indirect line based on constant transition models. Markov switching smoothed regime probabilities of daily rainfall was estimated based on the predicted SK method, with a two-regime switching model with two separate diagrams; each figure will be an irregular line based on constant smoothed coefficients and observed data in different periods. We estimated the daily rainfall probabilities for the 167 stations with the probability range from 0.899 to 0.911. Based on the models, the root-mean-square error of the root (RMSE) is 0.398, which shows a designed model statistically significant based on the Markov switching. This model is suitable to analyze the changes in the daily rainfall regime in Iran. Figure 12 shows the recurrence probability in the two regimes in Iran. Based on Fig. 12, the recurrence probability average of the second regime to the first regime is 86.39% and the first regime to the second regime is 3.61%, which shows the designed model statistically significant based on the AIC (1.747), BIC (1.8), and HQC (1.87). However, results show a similarity between variability in the predicted daily rainfall regime and the original data regime in Iran.

Fig. 2
figure 2

Markov switching smoothed regime probabilities for rainfall original data

Fig. 3
figure 3

The daily rainfall probabilities based on the original data in Iran

Fig. 4
figure 4

The daily rainfall probabilities based on the IDW method

Table 2 Constant Markov transition probabilities and expected durations
Fig. 5
figure 5

The predicted data average of daily rainfall based on the two regimes

Fig. 6
figure 6

The probability of the daily rainfall reoccurrence based on the regime1 model

Fig. 7
figure 7

The regular reoccurrence of daily rainfall based on the regime2 model

Table 3 Constant Markov transition probabilities and expected durations for the OK method
Fig. 8
figure 8

The transition probabilities and the expected duration for the daily rainfall based on predicted the OK method

Fig. 9
figure 9

The two-regime switching model based on constant transition models and smoothed probabilities

Fig. 10
figure 10

The predicted data of daily rainfall based on the smoothed probabilities

Fig. 11
figure 11

The probability of the daily rainfall reoccurrence based on the regime1 model

Table 4 Constant Markov transition probabilities and expected durations for SK method
Fig. 12
figure 12

Probability of the daily rainfall based on predicted data (A) and original data (B) in Iran

4 Conclusion

The study described a Markov switching model for the investigation of the target changes in rainfall data. The Markov switching model for spatiotemporal rainfall regime variability was used. The amount of the two regimes is suitable to analyze the target changes in rainfall. As a result, the Markov switching model depends on the original and predicted data assumed in each region, whether Markov regime-switching (MRS). Probability restriction vectors and transition restriction matrix are used to analyze rainfall regime variability, most likely by different power coefficients. Probability results presented satisfying evidence of rainfall changes in regimes and their spatiotemporal variability; we can control rainfall change conditions with short and intermediate variability in daily rainfall and intermediate and long variability in annual rainfall. However, we estimated evidence of intermediate and long variability and irregular variability patterns in Iran. Assessing random variability of rainfall versus its systematic variability showed that studying the rainfall irregularity regime is suitable for the Markov regime modeling. Therefore, the study showed Markov switching technique to estimate the significance of target changes based on the Markov switching models.