# Regime-Switching Temperature Dynamics Model for Weather Derivatives

Authors: Samuel Asante Gyamerah; Philip Ngare; Dennis Ikpe
Journal: International Journal of Stochastic Analysis
 (2018)

---

## Abstract

Weather is a key production factor in agricultural crop production and at the same time the most significant and least controllable source of peril in agriculture. These effects of weather on agricultural crop production have triggered a widespread support for weather derivatives as a means of mitigating the risk associated with climate change on agriculture. However, these products are faced with basis risk as a result of poor design and modelling of the underlying weather variable (temperature). In order to circumvent these problems, a novel time-varying mean-reversion Lévy regime-switching model is used to model the dynamics of the deseasonalized temperature dynamics. Using plots and test statistics, it is observed that the residuals of the deseasonalized temperature data are not normally distributed. To model the nonnormality in the residuals, we propose using the hyperbolic distribution to capture the semiheavy tails and skewness in the empirical distributions of the residuals for the shifted regime. The proposed regime-switching model has a mean-reverting heteroskedastic process in the base regime and a Lévy process in the shifted regime. By using the Expectation-Maximization algorithm, the parameters of the proposed model are estimated. The proposed model is flexible as it modelled the deseasonalized temperature data accurately.


---

## Body

## 1. Introduction

From tilling of the farmland to selling of the output of the crop yield, farmers around the world make countless decisions that affect their performance. Yet, there is one very important factor that they cannot control, climate. The world’s climate keeps on changing and this change will persist at rates that are projected to be out of the ordinary for some centuries [1]. Africa is no exception of these extreme climate changes across the world. Extreme climate events cause strain on food security, water resources, and human health in Africa. Ordinarily, it is the cause of limited economic growth and obstructs poverty reduction efforts for most countries in Africa [2]. With agriculture being the major contributing factor of the gross domestic product (GDP) growth of most countries in Africa [3] and climate conditions having extensive and causal correlation with the production variables [4], there should be an effective management technique to hedge against agricultural production risk. Most agricultural producers have encountered crop failures because of extreme weather conditions due to changes in climate. As a result, most farmers in Africa have developed their own traditional ways to improve the effect of extreme weather changes.As an institutional response to weather changes, the Chicago Mercantile Exchange (CME) introduced the weather derivative (WD). WD has been in existence in most developed countries (Canada, Europe, USA, and Japan). However, most farmers in Africa have rarely heard about this effective hedging tool. WD, if introduced in Africa, will be more viable, reliable, and efficient to the agricultural industry and can hedge against the increasing weather changes that affect agriculture since it is devoid of factors like loss adjustments, moral hazards, adverse selections, high premiums, and complex information requirements. To avoid basis risk associated with WD, there should be an efficient model for the underlying weather variable used in pricing WD. The weather variable considered in this study is temperature. Temperature controls and influences other elements of weather like clouds, humidity, air pressure, and precipitation that affect crops during and after crop production (https://en.wikibooks.org/wiki/Basic Geography/Climate/Climate Elements, accessed on 26/01/2018.)In the last decade, there has been empirical literatures on modelling the dynamics of temperature. Dischel [5] was the first to propose a continuous stochastic model for temperature. He modelled temperature as a mean-reverting process by adapting directly the Hull-White model. The noise process in his model was driven by two Wiener processes corresponding to the distribution of the temperature and the distribution of the changes in temperature. Thereafter, McIntyre and Doherty [6] proposed a mean-reverting SDE with a constant volatility daily average temperature at Heathrow airport in the United Kingdom (UK). Dornier and Queruel [7] disagreed with the direct use of the Hull-White model adopted by Dischel. They rather used a conventional Autoregressive Moving Average model rather than the AR(1) model proposed by Dischel. By replacing Brownian motion with fractional Brownian motion, Brody et al. [8] modelled the evolution of temperature that allowed the integration of a long memory effect. Other researchers [9–11] used different kinds of mean-reverting OU model driven by Brownian motion. In contrast to other researchers using Brownian motion to capture the residuals, Benth and Šaltyte˙-Benth [12] proposed an OU model that incorporate seasonal volatility and mean. In the model of Benth and Šaltyte˙-Benth, the residuals were driven by the generalized hyperbolic Lévy process rather than Brownian motion. The process they employed was an adjustable class of Lévy process that captured the skewness and semiheavy tails properties of the residuals.Clearly, it can be observed that most of these researchers assumed no changes in state of the dynamics of temperature and hence modelled temperature dynamics as a single regime. The above methods of modelling temperature may lead to intractable pricing techniques for temperature derivatives. As noted by Brockett et al. [13], temperature time-series data shows sudden changes due to artificial and natural factors. By employing regime-switching models, the researcher can capture such sudden and discrete shifts in the temperature dynamics. Regime-switching models do capture most of the stylized facts of temperature accurately more than the single stochastic differential equation model, hence the need for different stochastic model for each switching state.With a mean-reverting process as their base regime and a Brownian motion with mean different from zero as their shifted regime, Elias et al. [14] presented a constant volatility two-state MRS model for temperature dynamics at the city of Toronto, Canada. The model of Elias et al. (from hence we will call the model developed by Elias et al. as Elias’ Model) failed to capture the fact that volatility of temperature varies with varying temperature as it goes through discrete changes between the states of the regime process. Evarest et al. [15] improved on Elias’ model by capturing the fact that volatility of temperature varies as temperature goes through discrete changes between the states of the regime. They priced weather derivatives contracts based on the daily temperature dynamics. They used their model to calculate the future contract of HDD, CDD, and CAT indices. The introduction of the local volatility in the base regime helped in capturing well the dynamics of the underlying process. This led to a better pricing process as compared to Elias’ model. However, they failed to capture the extreme and fat tail characteristics of temperature data in their model. In his seminal thesis, Cui [16] modelled and priced temperature derivative. He modelled the dynamics of temperature by a standard mean-reverting Ornstein-Uhlenbeck process with a general Lévy process as the driving noise. He extended his model by proposing a continuous-time autoregressive (CAR) model driven by a general Lévy process which he calibrated to the Canadian data. The two models he proposed were used in deriving futures price on HDD, CDD, and CAT. He later developed a two-state MRS model with a “normal” regime and a “jump” regime. The “normal” regime depended on a standard OU process. For the “jump” regime, he used different noise process (Brownian motion with more extreme drift and volatility) to drive the abnormal positive or negative “jumps” in the temperature dynamics. However, he failed to capture the changes in volatility of temperature during the MRS model but rather assumed a constant volatility in both regimes.Several models have been formulated over time to capture the stylized facts of temperature; however these models proposed in literature have failed to capture well the stylized features of temperature, thus affecting the pricing models of WD. Inaccurate representation of the dynamics of temperature affects the pricing of WD. WD also relies on accurate extensive long-term time-series data [17]. However, there is lack of accessible, accurate, complete, and usable weather data in most African countries. Calibrating the MRS model is not trivial because the regimes are not clearly observable but latent. To outwit these problems, we use Expectation-Maximization (EM) algorithm to estimate the parameters in the model.From the above literatures presented, Brownian motion has been replaced with a fractional Brownian motion and subsequently by a generalized hyperbolic Lévy processes. Nevertheless, it will be interesting to explore both Brownian motion and Lévy processes in a MRS model that incorporates “normal” temperatures and “extremes” in temperature. The contribution of this paper is twofold; firstly we developed a mathematically tractable temperature dynamics model for the African farmer by using regime-switching model and secondly we showed that Gaussian distribution cannot capture the dynamics of real-life temperature. To the best of our knowledge, the two-state regime-switching model developed is the first kind of model that can be used to price futures and options on futures.


## 2. Daily Temperature Dynamics

The most widely used temperature indices in most industries (energy consumers, energy industry, travel, transportation, agriculture, government, retailing, and construction) are the cumulative average temperature (CAT), cooling degree days (CDD), and heating degree days (HDD). Nevertheless, in this research, we use the CAT and growing degree days (GDD) since they are the dominant indices that affect agriculture in Africa [18, 19]. GDD is the measure of the suitability for a crop to grow in relation to the standard temperature.Definition 1.
For a given single temperature weather station, letTmax(t) and Tmin(t) represent the daily maximum and minimum temperature (the temperatures used in this research are measured in degrees Celsius) recorded at day t, respectively. We define the daily average temperature at day t as(1)Tt≡Tmaxt+Tmint2.Definition 2.
Assume the daily average temperature (DAT)T(t) at time t≥0, and then the CATt and GDDt generated at a specific location over a specific measurement period [τ1,τ2] are defined as(2)CATτ1,τ2≔∑t=τ1τ2Tt(3)GDDτ1,τ2≔∑t=τ1τ2max⁡Tt-Toptimal,0


### 2.1. Stylized Facts of Temperature

Temperature has clear characteristics which differs largely from commodities and other financial assets. The most palpable characteristics of temperature are the following.(i) Seasonality Feature. Temperature exhibits annual (365 days) seasonal movements. The DAT T(t) at time t≥0 is defined as the sum of the deseasonalized temperature T~(t) and deterministic seasonal component Sd(t) given as(4)Tt=T~t+SdtTo model the variations of temperature without the deterministic seasonality, the seasonal component in (4) will be removed to obtain the deseasonalized temperature T~(t). The deterministic seasonal model at time t, Sd(t), is defined as(5)Sdt=A0+A1t+A2sin⁡2π365t-φwhere A0 and A1 represent the constant and coefficient in the linear seasonal trend of the raw data, respectively, A2 captures the amplitude of the variation, and φ is the phase angle.(ii) Mean-Reverting Feature. It is practically impossible for daily temperature to deviate from the mean temperature over a long period. Daily temperature reverts toward the mean, a feature that is common to other commodities. As observed by Alaton et al. [9], long-term changes may be as a result different factors which includes but are not limited to global warming, green-house effects, and urbanization.(iii) Extreme Feature. Temperature data have extremal data points. These extremal data points are “abnormal” movement caused by abrupt changes in temperature. In contrast to stocks which usually exhibit jumps in their price movements, daily temperature can show some signs of spikes which are normally short-lived and of very extreme size.(iv) Locality Feature. Temperature has a strongly localized response in temperature modelling and as such requires caution in making generalization, hence the need for different models to capture these different characteristics at different locations.(v) Volatility. In their two-state regime switching model formulation, Elias et al. [14] considered a constant volatility in either sate of his model. But this assumption might not be a reality since a shift in temperature residuals from one state to the other causes a change in the volatility from one state to the other. Extremal data points in temperature residues have greater volatility effects than is the case when there are no spikes or sudden increase in temperature. This is ascertained in the Engle test performed to check for heteroscedasticity in the temperature residuals (see Table 2). In model (9), the volatility is assumed to be dependent on the current deseasonalized temperature T~(t). More precisely, the higher the deseasonalized temperature level, the larger the changes in the deseasonalized daily average temperature. Hence, in this study we will propose a model whose volatility differ with each regime and underlying process.


## 2.1. Stylized Facts of Temperature

Temperature has clear characteristics which differs largely from commodities and other financial assets. The most palpable characteristics of temperature are the following.(i) Seasonality Feature. Temperature exhibits annual (365 days) seasonal movements. The DAT T(t) at time t≥0 is defined as the sum of the deseasonalized temperature T~(t) and deterministic seasonal component Sd(t) given as(4)Tt=T~t+SdtTo model the variations of temperature without the deterministic seasonality, the seasonal component in (4) will be removed to obtain the deseasonalized temperature T~(t). The deterministic seasonal model at time t, Sd(t), is defined as(5)Sdt=A0+A1t+A2sin⁡2π365t-φwhere A0 and A1 represent the constant and coefficient in the linear seasonal trend of the raw data, respectively, A2 captures the amplitude of the variation, and φ is the phase angle.(ii) Mean-Reverting Feature. It is practically impossible for daily temperature to deviate from the mean temperature over a long period. Daily temperature reverts toward the mean, a feature that is common to other commodities. As observed by Alaton et al. [9], long-term changes may be as a result different factors which includes but are not limited to global warming, green-house effects, and urbanization.(iii) Extreme Feature. Temperature data have extremal data points. These extremal data points are “abnormal” movement caused by abrupt changes in temperature. In contrast to stocks which usually exhibit jumps in their price movements, daily temperature can show some signs of spikes which are normally short-lived and of very extreme size.(iv) Locality Feature. Temperature has a strongly localized response in temperature modelling and as such requires caution in making generalization, hence the need for different models to capture these different characteristics at different locations.(v) Volatility. In their two-state regime switching model formulation, Elias et al. [14] considered a constant volatility in either sate of his model. But this assumption might not be a reality since a shift in temperature residuals from one state to the other causes a change in the volatility from one state to the other. Extremal data points in temperature residues have greater volatility effects than is the case when there are no spikes or sudden increase in temperature. This is ascertained in the Engle test performed to check for heteroscedasticity in the temperature residuals (see Table 2). In model (9), the volatility is assumed to be dependent on the current deseasonalized temperature T~(t). More precisely, the higher the deseasonalized temperature level, the larger the changes in the deseasonalized daily average temperature. Hence, in this study we will propose a model whose volatility differ with each regime and underlying process.


## 3. Markov Regime-Switching (MRS) Model

The Markov switching model developed by Hamilton [20] and Hamilton [21] inferred that the distribution of a variable is known, conditional on the occurrence of a specific regime/state. The switching process between the regimes is Markovian and is determined by an unobserved random variable. The underlying regimes, however, do not necessarily have to be Markovian but should be independent. The daily temperatures do change from day to day and these changes are not directly observable but latent. Therefore, statistical inference with regard to the likelihood of occurrence of each of the regimes at any time should be drawn.MRS has been used effectively in modelling the behaviour of the stock market and spot price of electricity [22–25]. Chevallier and Goutte [26] used sixteen international stock markets to compare the performance of regime-switching Lévy models. Chevallier and Goutte [27] developed an estimation methodology that provided a better fit for electricity and CO2 market prices by using mean-reverting Lévy jump processes.In temperature modelling, it is typical to assume that there are different regimes that can capture distinct principal weather condition or the localized weather behaviour. In our study, the daily temperature is assumed to be latent with two possible regimes, either in the base regime (“normal or mean-reverting regime”St=1) or in the shifted regime (“extreme” regime St=2). Suppose that each regime in the regime-switching model undergoes discrete shifts between the regimes St of the process, and then St follows a first-order Markov process with the transition matrix:(6)P=p11p12p21p22=p111-p111-p22p22The transition probabilities of our temperature process pij in (6) is given as(7)pij=PSt=j∣St-1=i∀i,j=1,2(8)0≤pij≤1and∑j=12pij=1Due to the Markov property of the states at any given time t, the future state of the underlying process (temperature) St+1 is independent of the past state St-1 of the underlying process given the present state St of the underlying process.


### 3.1. Modelling Daily Temperature Dynamics

To efficiently model the dynamics of temperature, it is assumed that the deseasonalized temperature is either under base regime or shifted regime and each regime is independent and parallel to the other regimes. The deseasonalized temperatureT~(t) is assumed to be driven by two sources of randomness: a Markov process and Lévy process. We assume a constant mean-reversion rate in the base regime. Based on the stylized facts of temperature, a regime-switching stochastic model that describes the dynamics of temperature is formulated. This model can be used to price weather derivatives. The base regime model is assumed to follow a mean-reverting stochastic process with a time-varying volatility. The residuals of the base regime are assumed to be generated by a Brownian process.To effectively capture the nonnormality of the temperature residuals (see Figures3, 5, 6, and 7 and Table 5), the residuals of the shifted regime are captured by a Lévy process. By comparing the generalized hyperbolic distribution to its subclasses (normal-inverse Gaussian, Hyperbolic, and Variance-Gamma), we were able to find the best distribution that can model the asymmetry and heavy tails of the residuals data. As our first regime-switching model, we call it time-varying mean-reversion Lévy (TML) regime-switching model. This proposed model is distinctly appropriate to capture the dynamics of temperature. In sequel, the propose TML model for the deseasonalized temperature dynamics is given as(9)T~t=T~tM:dT~tM=κT~tMdt+σMT~tMdWt,withprobabilityp1T~tL:dT~tL=μLdt+σLdLt,withprobabilityp2where σMT~tM is deseasonalized daily volatility of the base through time and σL is the volatility of the shifted regimes and κ is the mean-reversion rate of the deseasonalized temperature in the base regime which reverses the deseasonalized temperature to the long-term equilibrium level after the deseasonalized temperature has drifted from this equilibrium. Wt~N(0,t) is the standard Brownian motion. Lt is a Lévy process which is cádlág, adapted, real-valued general Lévy process with independent, stationary increments and stochastically continuous, and T~t is the deseasonalized temperature at time t.Proposition 3.
If the deseasonalized daily average temperatureT~(t) follows model (9), then the explicit solution is given by(10)T~t=T~Mt:T~Mt=T~t-1eκt+∫t-1tσT~seκt-sdWsT~Lt:T~Lt=T~t-1+μLt+∫t-1tσLdLsProof.
Determining the stochastic integral of the base regime process demands a variation of parameters approach to spell out a new functionf[T(t),t]=T~W(t)e-κt. By Itô’s lemma, the derivative of the new function can be found. (11)dfTt,t=-κe-κtT~Mtdt+e-κtdT~Mt=-κe-κtT~Mtdt+e-κtκT~Mtdt+σ1T~MtdWt=σ1e-κtT~tdWtfTt,t=T~Mte-κt=Tt-1+∫t-1tσ1Tse-κsdWsT~Mt=Tt-1eκt+∫t-1tσ1Tseκt-sdWsFor the shifted regime(12)dT~Lt=μLdt+σ2dLt∫t-1tdT~Ls=∫t-1tμLds+∫0tσ2dLsT~t=T~t-1+μLt+∫t-1tσ2dLs


## 3.1. Modelling Daily Temperature Dynamics

To efficiently model the dynamics of temperature, it is assumed that the deseasonalized temperature is either under base regime or shifted regime and each regime is independent and parallel to the other regimes. The deseasonalized temperatureT~(t) is assumed to be driven by two sources of randomness: a Markov process and Lévy process. We assume a constant mean-reversion rate in the base regime. Based on the stylized facts of temperature, a regime-switching stochastic model that describes the dynamics of temperature is formulated. This model can be used to price weather derivatives. The base regime model is assumed to follow a mean-reverting stochastic process with a time-varying volatility. The residuals of the base regime are assumed to be generated by a Brownian process.To effectively capture the nonnormality of the temperature residuals (see Figures3, 5, 6, and 7 and Table 5), the residuals of the shifted regime are captured by a Lévy process. By comparing the generalized hyperbolic distribution to its subclasses (normal-inverse Gaussian, Hyperbolic, and Variance-Gamma), we were able to find the best distribution that can model the asymmetry and heavy tails of the residuals data. As our first regime-switching model, we call it time-varying mean-reversion Lévy (TML) regime-switching model. This proposed model is distinctly appropriate to capture the dynamics of temperature. In sequel, the propose TML model for the deseasonalized temperature dynamics is given as(9)T~t=T~tM:dT~tM=κT~tMdt+σMT~tMdWt,withprobabilityp1T~tL:dT~tL=μLdt+σLdLt,withprobabilityp2where σMT~tM is deseasonalized daily volatility of the base through time and σL is the volatility of the shifted regimes and κ is the mean-reversion rate of the deseasonalized temperature in the base regime which reverses the deseasonalized temperature to the long-term equilibrium level after the deseasonalized temperature has drifted from this equilibrium. Wt~N(0,t) is the standard Brownian motion. Lt is a Lévy process which is cádlág, adapted, real-valued general Lévy process with independent, stationary increments and stochastically continuous, and T~t is the deseasonalized temperature at time t.Proposition 3.
If the deseasonalized daily average temperatureT~(t) follows model (9), then the explicit solution is given by(10)T~t=T~Mt:T~Mt=T~t-1eκt+∫t-1tσT~seκt-sdWsT~Lt:T~Lt=T~t-1+μLt+∫t-1tσLdLsProof.
Determining the stochastic integral of the base regime process demands a variation of parameters approach to spell out a new functionf[T(t),t]=T~W(t)e-κt. By Itô’s lemma, the derivative of the new function can be found. (11)dfTt,t=-κe-κtT~Mtdt+e-κtdT~Mt=-κe-κtT~Mtdt+e-κtκT~Mtdt+σ1T~MtdWt=σ1e-κtT~tdWtfTt,t=T~Mte-κt=Tt-1+∫t-1tσ1Tse-κsdWsT~Mt=Tt-1eκt+∫t-1tσ1Tseκt-sdWsFor the shifted regime(12)dT~Lt=μLdt+σ2dLt∫t-1tdT~Ls=∫t-1tμLds+∫0tσ2dLsT~t=T~t-1+μLt+∫t-1tσ2dLs


## 4. Analysis of Temperature Data

The daily maximum and minimum surface temperature data were taken from the weather measurement stations at Bole and Tamale. Bole and Tamale are located in the Northern region (the hottest region in Ghana) of Ghana. Bole and Tamale are the district capital of Bole and Tamale, respectively. In Ghana, the main source of weather data is from the Ghana Meteorological Agency. The sample period expands from 01/01/1987 to 31/08/2012 and consists of a total of 9375 observations. The average of the daily maximum and minimum temperature is calculated according to Definition1. The raw data is checked for missing data to avoid gaps in the historical data. Depending on the size of the missing data (the proportion of the missing data should not be more than 10%), the missing data is filled using the method of combined average. The combined average is calculated using two distinct averages: the average of 7 days (d) after and before the missing day,(13)Tdayt=∑d=17Tt-d+∑d=17Tt+d14,and the average of that missing day across previous N years,(14)Tyeart=1N∑y=1NTytThe missing values in the dataset are filled by averaging the calculated value in (13) and (14).In Table1, the descriptive statistics for the daily average temperature of the two measurement stations (Bole and Tamale) are presented. The values of the median, mean, maximum, and minimum temperature for both towns are consistent and this can be attributed to the fact that the geographical locations of these two measurement stations are not distant apart. The amount of variation (std) is relatively small but vary between two measurement stations. With a skewness value of 0.41 and 0.31 for Bole and Tamale, respectively, the empirical distribution of these two towns are asymmetrical. With a negative excess kurtosis for both towns, it can be explained that the distribution of the DAT data is more outlier-prone than the normal distribution. We present the values χ2-statistics of Pearson’s criteria of goodness-of-fit with its P values of the DAT time-series data (see Table 1). From the values of the χ2 goodness-of-fit test and at a 1%  α-level of significance, the null hypothesis (DAT data is normally distributed) can be rejected. With a Hurst exponent (H) greater than 0.5 for the two towns, there is a strong trend in the DAT data. However, the trend in Bole DAT data is more predictable than that of Tamale.Table 1
Descriptive statistics for daily average temperature.
Mean Median Mode std Min Max Skewness Kurtosis Hurst Exponent χ 2 P value Bole 27.20 27.00 26.5 2.07 21.40 34.20 0.41 2.77 0.8212 615.01 0 Tamale 28.69 28.40 27.8 2.47 21.40 35.60 0.31 2.34 0.7643 567.85 0Table 2
Engle test for residual heteroscedasticity of Bole and Tamale.
Test statistics p-value Bole 1175.2 0 Tamale 1282.9 0


### 4.1. Seasonal Component

Generally, temperature follows a seasonal pattern. These seasonal patterns can be decomposed into a seasonal trend and linear trend depending on the region where the data was taken and the number of years of temperature data used. The seasonal component in the DAT time-series data is captured in model (5). In order to calibrate the DAT time-series data to the proposed model (9), the DAT time series will be deseasonalized. Figure 2 shows the deseasonalized data of the daily average temperature for Bole and Tamale.From Figure1, there is a strong seasonality in the DAT time-series data. Temperature exhibits a seasonal trend in Africa; higher temperatures during the dry seasons; and lower temperatures during the rainy seasons. The seasonal trend is captured in model (5). The seasonal component of model (5) is given as A2sin2π/360(t-φ). The DAT data is calibrated to the model and, using the least square method of estimation, the parameters are estimated.Figure 1
Historical average temperature against the day of observation from 01/01/1987 to 31/08/2012, exhibiting seasonal cycles.
(a)
Bole deseasonalized DAT (b)
Tamale deseasonalized DATFigure 2
Deseasonalized daily average temperature from 01/01/1987 to 31/08/2012.
(a)
Bole deseasonalized DAT (b)
Tamale deseasonalized DATFigure 3
Histogram of final residuals in Bole and Tamale.
(a)
Histogram of Bole final residuals (b)
Histogram of Tamale final residualsEven though the linear trend in the data is weak, a close observation (see Figure1) shows an increasing trend in the DAT time-series data. The linear trend in our data may be as a result of the longer period of years taken. Also, as observed by Alaton et al. [9], this increasing trend of DAT over some decades at this location is as a result of many factors which include but are not limited to global warming, green-house effect, and urbanization. The linear component of model (5) is given as A0+A1t.


### 4.2. Residuals

Figure4 shows the squared residual plot of the deseasonalized daily average temperature data of Bole and Tamale. There is evidence of continuous variation in the variance of noise, an indication of seasonal heteroscedasticity. This shows that volatility of the deseasonalized DAT residuals is not constant as assumed by Elias et al. [14]. To further validate this result, we use the Engle test of residual heteroscedasticity to test for conditional heteroscedasticity. From Table 2, we can reject the null hypothesis of no conditional heteroscedasticity and conclude that there are significant heteroscedasticity effects in the residual series of both towns. With a p value of 0 and at a 1%  α-level of significance for both towns, there is a strong evidence to reject the null hypothesis of no conditional heteroscedasticity effects.Figure 4
Squared final residuals of Bole and Tamale.
(a)
Bole squared residuals (b)
Tamale squared residualsFigure 5
Normal distributed QQ-plot for Bole and Tamale residuals.Figure 6
Normal fit plot of Bole and Tamale residuals.Figure 7
Box-plot of final residuals.


#### 4.2.1. Normality Test of Temperature Data Residuals

In this section, statistical and graphical methods are applied to the DAT residuals time-series data to test for the normality of the residuals.Most conventional literatures [9, 14, 15] assumed that the residuals are independent and identically and normally distributed. It should however be noted that inaccurate choice of the distribution of this residuals can cause model error and mispricing when pricing weather derivatives. To model the residuals of the DAT data, it is important to test the residuals for normality using different goodness-of-fit test.Table3 shows the normal distribution χ2-statistics of the residuals. The values of χ2 for Bole and Tamale are significant at 99% confidence level implying that the residuals of Bole and Tamale are not normally distributed. The descriptive statistics of the residuals of Bole and Tamale are presented in Table 4. From the Hurst exponent in Table 4, the residuals of Bole and Tamale DAT have strong trend and are more predictable. The skewness and kurtosis in Table 4 further show that the residuals are not normally distributed. These results are congruous to the Q-Q plot for normal distribution (Figure 5) and the normal fit plot (Figure 6). Figure 7 shows that there are cases of outliers in the residuals of the daily average temperature of Bole and Tamale.Table 3
χ 2 statistics of final residuals of Bole and Tamale.
χ 2 P value Bole 230.3531 8.9851×10-48 Tamale 419.0531 2.2355×10-87Table 4
Descriptive statistics of final residuals of Bole and Tamale.
Mean Median std Min Max Skewness Kurtosis Hurst Exponent Bole 1.0873×10-06 0.0879 1.2995 -7.7166 5.5563 -0.4181 3.9910 0.7718 Tamale 3.6874×10-06 0.1328 1.5431 -7.3353 5.6889 -0.4947 3.6699 0.7029Table 5
Goodness-of-fit test for residuals.
(a)
Jacque-Bera Test
Bole Tamale  Test Statistics 656.7203 557.6335  P value ≤ 0.001 ≤ 0.001  (b)
Anderson-Darling test
Bole Tamale  Test Statistics 26.0323 36.0366  P value ≤ 0.0005 ≤ 0.0005Additionally, using the Jacque-Bera (JB) goodness-of-fit test and the Anderson-Darling (AD) test for normality (see Table5), we can reject the null hypothesis that the residuals are normally distributed at a 99% confidence level. From the test statistics (Table 5) and graphical representations (Figures 5–7), there is enough evidence to state that the deseasonalized DAT residuals of Bole and Tamale do not follow the normal distribution. Thus, it can be concluded that it is not efficient to model the random noise with a Gaussian process.Due to the inability of the normal distribution to capture well the residuals of the deseasonalized DAT data, we propose using the Lévy process to model the residuals of the shifted regime. We use the generalized hyperbolic (GH) distribution and its subclasses (normal-inverse Gaussian (NIG), hyperbolic (HYP), and the variance-gamma (VG)) to capture the skewness and semiheavy tails in the residuals data. We test for the best fit for our residuals data using the above named distributions.


### 4.3. Generalized Hyperbolic (GH) Distribution

We model the residualsϵt of the shifted regime by the generalized hyperbolic (GH) distribution and the subclasses which are relevant for applications.Definition 4.
The one-dimensional generalized hyperbolic (GH) distribution was introduced by Barndorff-Nielsen [28] and its probability density function is defined as (15)fGHx;v,α,β,μ,δ=ξv,α,β,δδ2+x-μ2v/2-1/4eβx-μ×Kv-1/2αδ2-x-μ2where ξ(v,α,β,δ)=(α2-β2)v/2/2παv-1/2δvKv(δα2-β2), Kv is the modified Bessel function of the third kind of order v, and x∈REach parameter inGH(v,α,β,μ,δ)) distribution has different effect on the shape of the distribution: v∈R determines the characterization of subclasses of the GH distribution, α>0 controls the steepness around the peak (the larger α, the steeper the density), β with 0≤|β|≤α is the asymmetry parameter (β= 0 gives a symmetric distribution around μ and the skewness of the density increases as μ increases), μ is the location of the distribution, and δ>0 is the scaling. A proper choice of these parameters can help in describing different shapes of the distribution.Suppose a random variableX follows a generalized hyperbolic distribution, and then the characteristics function (moment generating function (MGF) or the cumulant function) is given as (16)MXz=EezX=eμzα2-β2α2-β+z2v/2Kvδα2-β+z2Kvδα2-β2,β+z<α The subclasses of the GH distribution include the normal-inverse Gaussian (NIG) distribution, the hyperbolic (HYP) distribution, and the variance-gamma (VG) distribution.Definition 5.
Forv=-0.5 in the GH distribution, we obtain the normal-inverse Gaussian (NIG). The probability density function (pdf) of a NIG distribution NIG(α,β,μ,δ) of a random variable X is an infinitely divisible distribution which is given as(17)fNIGx;α,β,μ,δ)=αδπ-1exp⁡δα2-β2+βx-μ⁡K1αδ2+x-μ2δ2+x-μ2where 0≤|β|≤α, 0≤δ, and x,μ∈R. kv is the modified Bessel function.The NIG distribution was introduced in finance literature in 1997 by Barndorff-Nielsen [29]. NIG distribution has a heavier tail than the normal distribution and can take different kinds of shapes. The MGF of NIG distribution is(18)MNIGz=exp⁡μz+δα2-β2-α2-β+z2,∀β+z<αThe NIG distribution have the following properties:(1)
Conditioned thatβ=0, α→∞, and σ/α=σ2, the NIG distribution will approach the normal distribution N(μ,σ2).(2)
Assuming thatX~NIG(α,β,μ,δ), then, ∀a∈R+ and ∀b∈R, we have that Y=aX+b~NIG(α/a,β/a,aμ+b,aδ)Definition 6.
The Hyperbolic Distribution (HYP) is a subclass of the GH distribution when v=1. Given a hyperbolic random variable X, the pdf is given as(19)fHYPx;α,β,μ,δ)=α2-β22αδK1δα2-β2exp⁡-αδ2+x-μ2+βx-μ⁡ where x,μ∈R,0≤δ,|β|<α and K1 is t the Bessel function of the third kind with index 1The hyperbolic distribution can also capture semiheavy tails. The MGF of the hyperbolic distribution is(20)MHYPz=eμzα2-β2K1δα2-β+z2α2-β+z2K1δα2-β2,∀β+z<αThe hyperbolic distribution is not closed under convolution.Definition 7.
By restrictingδ=0 and v>0, we have the Variance-Gamma (VG) distribution with pdf (21)fVGx;v,α,β,μ)=α2-β22vπΓv2αv-1/2x-μv-1/2Kv-1/2αx-μeβx-μ,∀x∈R where μ∈R,v>0,α>|β|≥0, and Γ denotes the gamma-function. Kv(·) is the modified Bessel function of the second kind.The Variance-Gamma density was introduced by Madan et al. [30]. The tails of VG distribution decrease slowly than the normal distribution. The class of VG distributions is closed under convolution. The MGF of VG distribution is(22)MVGz=eμzα2-β2α2-β+z22v,∀β+z<α


### 4.4. Parameter Estimation

The parameters of the seasonality model and the TML model is estimated. The estimation of these parameters depends on the Bole and Tamale DAT data from01/01/1987 to 31/08/2012.


#### 4.4.1. Fitting the Deterministic Seasonality Model to Data

The deterministic seasonality process, model (5), can be transformed to(23)Sdt=a0+a1t+a2sin⁡2π365t+a3cos⁡2π365tTo find the numerical values in model (5), the transformed deterministic seasonality process (model (23)) is fitted to the DAT data. The parameters are estimated using the least square methods.(24)A0=a0A1=a1A2=a22+a32φ=3652πtan-1a3a2


#### 4.4.2. Estimation of the TML Parameters

Estimating the parameters of TML model is not trivial. The parameters of the model are estimated using the Expectation-Maximization algorithm developed by Dempster et al. [31]. The vector of unknown parameters will be estimated by two steps’ iterative algorithm: an expectation- (E-) step and a maximization- (M-) step.Discretization.Even though temperature is a continuous process, its data is not recorded continuously but rather recorded in discrete time points. Therefore, estimating the parameters in a continuous time will be computationally costly. Before the parameters of the TML model are estimated, they will have to be calibrated to the deseasonalized DAT data and this is possible by transforming the model from its continuous form to a discrete form. The discretized form of model (9) for the base and shifted regimes is given as(25)T~t=T~tM:T~tM=T~t-1M1+κ+σMT~t-1MϵtM,T~Mis  in  regime1T~tL:T~tL=T~t-1L+μL+σLϵtL,T~Lis  in  regime2where ϵM(t) and ϵL(t) are the Weiner residual and Lévy residual, respectively.From (25), the vector of unknown parameters θ1={βM,σM,p1} and θ2={μL,σL,p2} for the base and shifted regimes, respectively, will be estimated.E-Step. Assume the length of the DAT historical data is N+1 and t=0,1,2,3,…,N where t represents a specific time that the DAT is recorded and θn is the computed vector of parameters in the nth iteration. The conditional distribution of the regimes St for time update values of t=0,1,2,3,…,N will be calculated. Suppose FtT~(t) is a vector of the past t+1 historical data of the discretized model, and then FtT~(t)={T~(1),T~(2),T~(3),…,T~(N)}.(i)Filtering. Based on the Bayes rule, the filtered probability of the discretized model can be estimated as(26)PSt=i∣FtT~t;Θn=PSt=i,T~t∣Ft-1T~t;ΘnfT~t∣Ft-1T~t;Θn=PSt=i∣Ft-1T~t;ΘnfT~t∣St=i;Ft-1T~t;Θn∑i∈sPSt=i∣Ft-1T~t;ΘnfT~t∣St=i;Ft-1T~t;Θn where Θ={θ1,θ2} and fT~(t)∣St=i;Ft-1T~(t) is the density of the underlying regime process i at time t conditional that the underlying process was in regime i. The conditional probability density function for the base and shifted regimes will be calculated from the CDF.From (25), the drift and diffusion coefficient of the base regime are (1+β)T~t-1M and σMT~t-1M, respectively. Similarly, the drift and diffusion coefficient of the shifted regimes are T~t-1L+μL and σL, respectively.(ii)Smoothing. For t=N-1,N-2,…,1 iterate(27)PSt=i∣FtT~t;Θn=∑i∈sPSt=i∣FtT~t;ΘnPSt+1=j∣FtT~T;ΘnpijnPSt+1=i∣FtT~t;Θn The probability density functions (pdf) of the base and shifted regimes based on their diffusion and drift coefficient is, respectively, given as(28)fT~t∣St=i;Ft-1T~t;θ^1n=1σ1n2πT~t-1exp-T~t-1+κnT~t-122σ1n2T~t-12(29)fT~t∣St=i;Ft-1T~t;θ^2n=1σ2n2πexp⁡-T~t-μn-T~t-122σ2n2M-Step.By maximizing the expected log-likelihood function Θ(n+1)=argmax⁡QΘ∣Θ(n), the maximum likelihood (ML) estimate Θ(n+1) for the vector of unknown parameters will be calculated. Also, in this step the transition probabilities of the regime-switching model will be estimated.The log-likelihood function from the conditional probability density function of both regimes is, respectively, given as(30)log⁡Lθ1n,FtT~,St=∑t=2NPSt=i∣FtT~t;θ1^nlog⁡P1,i-log⁡σ12πT~t-1-12σ12T~t-12T~t-1+κnT~t-12(31)log⁡Lθ1n,FtT~,St=∑t=2NPSt=i∣FtT~t;θ2^nlog⁡P2,i-log⁡σ22π-12σ22T~t-μn-T~t-12By maximizing the log-likelihood function presented in (30), the vector of parameters θ1(n+1) can be estimated.(32)σ^1n+1=∑t=2NPSt=1∣FtT~t;θ1^nT~t-1-2T~t-1+βT~t-12∑t=2NPSt=1∣FtT~t;θ1^n(33)κ^n+1=∑t=1NPSt=1∣FtT~t;θ1^nT~t-1-2T~t-1T~t-T~t-1∑t=2NPSt=1∣FtT~t;θ1^nProof.
The first derivative of (30) with respect to σ1 is(34)∂L∂σ1=1σ13∑t=2NPSt=1∣FtT~t;θ1^nT~t-1+βT~t-12-σ12T~t-12T~t-12By maximizing (34), (35)∑t=2NPSt=1∣FtT~t;θ1^nT~t-1-2T~t-1+βT~t-12-σ12T~t-12=0∑t=2NPSt=1∣FtT~t;θ1^nT~t-1-2T~t-1+βT~t-12=∑t=2NPSt=1∣FtT~t;θ^1nσ12σ^1n+1=∑t=2NPSt=1∣FtT~t;θ1^nT~t-1-2T~t-1+βT~t-12∑t=2NPSt=1∣FtT~t;θ1^n The derivative of (30) with respect to β is(36)∂L∂κ=∑t=1NPSt=1∣FtT~t;θ1^nσ1-2T~t-1-2-T~t-12-βT~t-12+T~tT~t-1By maximizing (36), (37)∑t=1NPSt=1∣FtT~t;θ1^nσ1-2T~t-1-2-T~t-12-βT~t-12+T~tT~t-1=0κ∑t=2NPSt=1∣FtT~t;θ1^n=∑t=1NPSt=1∣FtT~t;θ1^nT~t-1-2T~t-1T~t-T~t-1κ^n+1=∑t=1NPSt=1∣FtT~t;θ1^nT~t-1-2T~t-1T~t-T~t-1∑t=2NPSt=1∣FtT~t;θ1^nAlso, the vector of unknowns ofθ2(n+1) can be estimated by maximizing (31):(38)μ^n+1=∑t=2NPSt=2∣FtT~t;θ2^nT~t-T~t-1∑t=2NPSt=2∣FtT~t;θ2^n(39)σ^2n+1=∑t=2NPSt=2∣FtT~t;θ2^nT~t-T~t-1-μ2∑t=2NPSt=2∣FtT~t;θ2^nProof.
By finding the derivative of (31) with respect to σ2,(40)∂L∂σ2=1σ23∑t=2NPSt=2∣FtT~t;θ^2nT~t-T~t-1-μ2-σ22Maximizing (40) gives (41)∑t=2NPSt=2∣FtT~t;θ^2nT~t-T~t-1-μ2-σ22=0∑t=2NPSt=2∣FtT~t;θ^2nT~t-T~t-1-μ2=σ22∑t=2NPSt=2∣FtT~t;θ^2nσ^2n+1=∑t=2NPSt=2∣FtT~t;θ2^nT~t-T~t-1-μ2∑t=2NPSt=2∣FtT~t;θ2^n The derivative of (31) with respect to μ is(42)∂L∂σ2=∑t=2NPSt=2∣FtT~t;θ^2nσ2-2T~t-T~t-1-μ2By maximizing (42)(43)∑t=2NPSt=2∣FtT~t;θ^2nT~t-T~t-12=μ∑t=2NPSt=2∣FtT~t;θ^2n(44)μ^n+1=∑t=2NPSt=2∣FtT~t;θ2^nT~t-T~t-1∑t=2NPSt=2∣FtT~t;θ2^nThe transition probabilities are estimated by making use of the formula proposed by Kim [32]:(45)pijn+1=∑t=2NPSt=j,St-1=i∣FNT~t;Θn∑t=2NPSt=i∣FNT~t;Θn=∑t=2NPSt=j∣FNT~t;ΘnpijnPSt-1=iFt-1T~t;Θn/PSt=j∣Ft-1T~t;Θn∑t=2NPSt-1=i∣FNT~t;Θn


## 4.1. Seasonal Component

Generally, temperature follows a seasonal pattern. These seasonal patterns can be decomposed into a seasonal trend and linear trend depending on the region where the data was taken and the number of years of temperature data used. The seasonal component in the DAT time-series data is captured in model (5). In order to calibrate the DAT time-series data to the proposed model (9), the DAT time series will be deseasonalized. Figure 2 shows the deseasonalized data of the daily average temperature for Bole and Tamale.From Figure1, there is a strong seasonality in the DAT time-series data. Temperature exhibits a seasonal trend in Africa; higher temperatures during the dry seasons; and lower temperatures during the rainy seasons. The seasonal trend is captured in model (5). The seasonal component of model (5) is given as A2sin2π/360(t-φ). The DAT data is calibrated to the model and, using the least square method of estimation, the parameters are estimated.Figure 1
Historical average temperature against the day of observation from 01/01/1987 to 31/08/2012, exhibiting seasonal cycles.
(a)
Bole deseasonalized DAT (b)
Tamale deseasonalized DATFigure 2
Deseasonalized daily average temperature from 01/01/1987 to 31/08/2012.
(a)
Bole deseasonalized DAT (b)
Tamale deseasonalized DATFigure 3
Histogram of final residuals in Bole and Tamale.
(a)
Histogram of Bole final residuals (b)
Histogram of Tamale final residualsEven though the linear trend in the data is weak, a close observation (see Figure1) shows an increasing trend in the DAT time-series data. The linear trend in our data may be as a result of the longer period of years taken. Also, as observed by Alaton et al. [9], this increasing trend of DAT over some decades at this location is as a result of many factors which include but are not limited to global warming, green-house effect, and urbanization. The linear component of model (5) is given as A0+A1t.


## 4.2. Residuals

Figure4 shows the squared residual plot of the deseasonalized daily average temperature data of Bole and Tamale. There is evidence of continuous variation in the variance of noise, an indication of seasonal heteroscedasticity. This shows that volatility of the deseasonalized DAT residuals is not constant as assumed by Elias et al. [14]. To further validate this result, we use the Engle test of residual heteroscedasticity to test for conditional heteroscedasticity. From Table 2, we can reject the null hypothesis of no conditional heteroscedasticity and conclude that there are significant heteroscedasticity effects in the residual series of both towns. With a p value of 0 and at a 1%  α-level of significance for both towns, there is a strong evidence to reject the null hypothesis of no conditional heteroscedasticity effects.Figure 4
Squared final residuals of Bole and Tamale.
(a)
Bole squared residuals (b)
Tamale squared residualsFigure 5
Normal distributed QQ-plot for Bole and Tamale residuals.Figure 6
Normal fit plot of Bole and Tamale residuals.Figure 7
Box-plot of final residuals.


### 4.2.1. Normality Test of Temperature Data Residuals

In this section, statistical and graphical methods are applied to the DAT residuals time-series data to test for the normality of the residuals.Most conventional literatures [9, 14, 15] assumed that the residuals are independent and identically and normally distributed. It should however be noted that inaccurate choice of the distribution of this residuals can cause model error and mispricing when pricing weather derivatives. To model the residuals of the DAT data, it is important to test the residuals for normality using different goodness-of-fit test.Table3 shows the normal distribution χ2-statistics of the residuals. The values of χ2 for Bole and Tamale are significant at 99% confidence level implying that the residuals of Bole and Tamale are not normally distributed. The descriptive statistics of the residuals of Bole and Tamale are presented in Table 4. From the Hurst exponent in Table 4, the residuals of Bole and Tamale DAT have strong trend and are more predictable. The skewness and kurtosis in Table 4 further show that the residuals are not normally distributed. These results are congruous to the Q-Q plot for normal distribution (Figure 5) and the normal fit plot (Figure 6). Figure 7 shows that there are cases of outliers in the residuals of the daily average temperature of Bole and Tamale.Table 3
χ 2 statistics of final residuals of Bole and Tamale.
χ 2 P value Bole 230.3531 8.9851×10-48 Tamale 419.0531 2.2355×10-87Table 4
Descriptive statistics of final residuals of Bole and Tamale.
Mean Median std Min Max Skewness Kurtosis Hurst Exponent Bole 1.0873×10-06 0.0879 1.2995 -7.7166 5.5563 -0.4181 3.9910 0.7718 Tamale 3.6874×10-06 0.1328 1.5431 -7.3353 5.6889 -0.4947 3.6699 0.7029Table 5
Goodness-of-fit test for residuals.
(a)
Jacque-Bera Test
Bole Tamale  Test Statistics 656.7203 557.6335  P value ≤ 0.001 ≤ 0.001  (b)
Anderson-Darling test
Bole Tamale  Test Statistics 26.0323 36.0366  P value ≤ 0.0005 ≤ 0.0005Additionally, using the Jacque-Bera (JB) goodness-of-fit test and the Anderson-Darling (AD) test for normality (see Table5), we can reject the null hypothesis that the residuals are normally distributed at a 99% confidence level. From the test statistics (Table 5) and graphical representations (Figures 5–7), there is enough evidence to state that the deseasonalized DAT residuals of Bole and Tamale do not follow the normal distribution. Thus, it can be concluded that it is not efficient to model the random noise with a Gaussian process.Due to the inability of the normal distribution to capture well the residuals of the deseasonalized DAT data, we propose using the Lévy process to model the residuals of the shifted regime. We use the generalized hyperbolic (GH) distribution and its subclasses (normal-inverse Gaussian (NIG), hyperbolic (HYP), and the variance-gamma (VG)) to capture the skewness and semiheavy tails in the residuals data. We test for the best fit for our residuals data using the above named distributions.


## 4.2.1. Normality Test of Temperature Data Residuals

In this section, statistical and graphical methods are applied to the DAT residuals time-series data to test for the normality of the residuals.Most conventional literatures [9, 14, 15] assumed that the residuals are independent and identically and normally distributed. It should however be noted that inaccurate choice of the distribution of this residuals can cause model error and mispricing when pricing weather derivatives. To model the residuals of the DAT data, it is important to test the residuals for normality using different goodness-of-fit test.Table3 shows the normal distribution χ2-statistics of the residuals. The values of χ2 for Bole and Tamale are significant at 99% confidence level implying that the residuals of Bole and Tamale are not normally distributed. The descriptive statistics of the residuals of Bole and Tamale are presented in Table 4. From the Hurst exponent in Table 4, the residuals of Bole and Tamale DAT have strong trend and are more predictable. The skewness and kurtosis in Table 4 further show that the residuals are not normally distributed. These results are congruous to the Q-Q plot for normal distribution (Figure 5) and the normal fit plot (Figure 6). Figure 7 shows that there are cases of outliers in the residuals of the daily average temperature of Bole and Tamale.Table 3
χ 2 statistics of final residuals of Bole and Tamale.
χ 2 P value Bole 230.3531 8.9851×10-48 Tamale 419.0531 2.2355×10-87Table 4
Descriptive statistics of final residuals of Bole and Tamale.
Mean Median std Min Max Skewness Kurtosis Hurst Exponent Bole 1.0873×10-06 0.0879 1.2995 -7.7166 5.5563 -0.4181 3.9910 0.7718 Tamale 3.6874×10-06 0.1328 1.5431 -7.3353 5.6889 -0.4947 3.6699 0.7029Table 5
Goodness-of-fit test for residuals.
(a)
Jacque-Bera Test
Bole Tamale  Test Statistics 656.7203 557.6335  P value ≤ 0.001 ≤ 0.001  (b)
Anderson-Darling test
Bole Tamale  Test Statistics 26.0323 36.0366  P value ≤ 0.0005 ≤ 0.0005Additionally, using the Jacque-Bera (JB) goodness-of-fit test and the Anderson-Darling (AD) test for normality (see Table5), we can reject the null hypothesis that the residuals are normally distributed at a 99% confidence level. From the test statistics (Table 5) and graphical representations (Figures 5–7), there is enough evidence to state that the deseasonalized DAT residuals of Bole and Tamale do not follow the normal distribution. Thus, it can be concluded that it is not efficient to model the random noise with a Gaussian process.Due to the inability of the normal distribution to capture well the residuals of the deseasonalized DAT data, we propose using the Lévy process to model the residuals of the shifted regime. We use the generalized hyperbolic (GH) distribution and its subclasses (normal-inverse Gaussian (NIG), hyperbolic (HYP), and the variance-gamma (VG)) to capture the skewness and semiheavy tails in the residuals data. We test for the best fit for our residuals data using the above named distributions.


## 4.3. Generalized Hyperbolic (GH) Distribution

We model the residualsϵt of the shifted regime by the generalized hyperbolic (GH) distribution and the subclasses which are relevant for applications.Definition 4.
The one-dimensional generalized hyperbolic (GH) distribution was introduced by Barndorff-Nielsen [28] and its probability density function is defined as (15)fGHx;v,α,β,μ,δ=ξv,α,β,δδ2+x-μ2v/2-1/4eβx-μ×Kv-1/2αδ2-x-μ2where ξ(v,α,β,δ)=(α2-β2)v/2/2παv-1/2δvKv(δα2-β2), Kv is the modified Bessel function of the third kind of order v, and x∈REach parameter inGH(v,α,β,μ,δ)) distribution has different effect on the shape of the distribution: v∈R determines the characterization of subclasses of the GH distribution, α>0 controls the steepness around the peak (the larger α, the steeper the density), β with 0≤|β|≤α is the asymmetry parameter (β= 0 gives a symmetric distribution around μ and the skewness of the density increases as μ increases), μ is the location of the distribution, and δ>0 is the scaling. A proper choice of these parameters can help in describing different shapes of the distribution.Suppose a random variableX follows a generalized hyperbolic distribution, and then the characteristics function (moment generating function (MGF) or the cumulant function) is given as (16)MXz=EezX=eμzα2-β2α2-β+z2v/2Kvδα2-β+z2Kvδα2-β2,β+z<α The subclasses of the GH distribution include the normal-inverse Gaussian (NIG) distribution, the hyperbolic (HYP) distribution, and the variance-gamma (VG) distribution.Definition 5.
Forv=-0.5 in the GH distribution, we obtain the normal-inverse Gaussian (NIG). The probability density function (pdf) of a NIG distribution NIG(α,β,μ,δ) of a random variable X is an infinitely divisible distribution which is given as(17)fNIGx;α,β,μ,δ)=αδπ-1exp⁡δα2-β2+βx-μ⁡K1αδ2+x-μ2δ2+x-μ2where 0≤|β|≤α, 0≤δ, and x,μ∈R. kv is the modified Bessel function.The NIG distribution was introduced in finance literature in 1997 by Barndorff-Nielsen [29]. NIG distribution has a heavier tail than the normal distribution and can take different kinds of shapes. The MGF of NIG distribution is(18)MNIGz=exp⁡μz+δα2-β2-α2-β+z2,∀β+z<αThe NIG distribution have the following properties:(1)
Conditioned thatβ=0, α→∞, and σ/α=σ2, the NIG distribution will approach the normal distribution N(μ,σ2).(2)
Assuming thatX~NIG(α,β,μ,δ), then, ∀a∈R+ and ∀b∈R, we have that Y=aX+b~NIG(α/a,β/a,aμ+b,aδ)Definition 6.
The Hyperbolic Distribution (HYP) is a subclass of the GH distribution when v=1. Given a hyperbolic random variable X, the pdf is given as(19)fHYPx;α,β,μ,δ)=α2-β22αδK1δα2-β2exp⁡-αδ2+x-μ2+βx-μ⁡ where x,μ∈R,0≤δ,|β|<α and K1 is t the Bessel function of the third kind with index 1The hyperbolic distribution can also capture semiheavy tails. The MGF of the hyperbolic distribution is(20)MHYPz=eμzα2-β2K1δα2-β+z2α2-β+z2K1δα2-β2,∀β+z<αThe hyperbolic distribution is not closed under convolution.Definition 7.
By restrictingδ=0 and v>0, we have the Variance-Gamma (VG) distribution with pdf (21)fVGx;v,α,β,μ)=α2-β22vπΓv2αv-1/2x-μv-1/2Kv-1/2αx-μeβx-μ,∀x∈R where μ∈R,v>0,α>|β|≥0, and Γ denotes the gamma-function. Kv(·) is the modified Bessel function of the second kind.The Variance-Gamma density was introduced by Madan et al. [30]. The tails of VG distribution decrease slowly than the normal distribution. The class of VG distributions is closed under convolution. The MGF of VG distribution is(22)MVGz=eμzα2-β2α2-β+z22v,∀β+z<α


## 4.4. Parameter Estimation

The parameters of the seasonality model and the TML model is estimated. The estimation of these parameters depends on the Bole and Tamale DAT data from01/01/1987 to 31/08/2012.


### 4.4.1. Fitting the Deterministic Seasonality Model to Data

The deterministic seasonality process, model (5), can be transformed to(23)Sdt=a0+a1t+a2sin⁡2π365t+a3cos⁡2π365tTo find the numerical values in model (5), the transformed deterministic seasonality process (model (23)) is fitted to the DAT data. The parameters are estimated using the least square methods.(24)A0=a0A1=a1A2=a22+a32φ=3652πtan-1a3a2


### 4.4.2. Estimation of the TML Parameters

Estimating the parameters of TML model is not trivial. The parameters of the model are estimated using the Expectation-Maximization algorithm developed by Dempster et al. [31]. The vector of unknown parameters will be estimated by two steps’ iterative algorithm: an expectation- (E-) step and a maximization- (M-) step.Discretization.Even though temperature is a continuous process, its data is not recorded continuously but rather recorded in discrete time points. Therefore, estimating the parameters in a continuous time will be computationally costly. Before the parameters of the TML model are estimated, they will have to be calibrated to the deseasonalized DAT data and this is possible by transforming the model from its continuous form to a discrete form. The discretized form of model (9) for the base and shifted regimes is given as(25)T~t=T~tM:T~tM=T~t-1M1+κ+σMT~t-1MϵtM,T~Mis  in  regime1T~tL:T~tL=T~t-1L+μL+σLϵtL,T~Lis  in  regime2where ϵM(t) and ϵL(t) are the Weiner residual and Lévy residual, respectively.From (25), the vector of unknown parameters θ1={βM,σM,p1} and θ2={μL,σL,p2} for the base and shifted regimes, respectively, will be estimated.E-Step. Assume the length of the DAT historical data is N+1 and t=0,1,2,3,…,N where t represents a specific time that the DAT is recorded and θn is the computed vector of parameters in the nth iteration. The conditional distribution of the regimes St for time update values of t=0,1,2,3,…,N will be calculated. Suppose FtT~(t) is a vector of the past t+1 historical data of the discretized model, and then FtT~(t)={T~(1),T~(2),T~(3),…,T~(N)}.(i)Filtering. Based on the Bayes rule, the filtered probability of the discretized model can be estimated as(26)PSt=i∣FtT~t;Θn=PSt=i,T~t∣Ft-1T~t;ΘnfT~t∣Ft-1T~t;Θn=PSt=i∣Ft-1T~t;ΘnfT~t∣St=i;Ft-1T~t;Θn∑i∈sPSt=i∣Ft-1T~t;ΘnfT~t∣St=i;Ft-1T~t;Θn where Θ={θ1,θ2} and fT~(t)∣St=i;Ft-1T~(t) is the density of the underlying regime process i at time t conditional that the underlying process was in regime i. The conditional probability density function for the base and shifted regimes will be calculated from the CDF.From (25), the drift and diffusion coefficient of the base regime are (1+β)T~t-1M and σMT~t-1M, respectively. Similarly, the drift and diffusion coefficient of the shifted regimes are T~t-1L+μL and σL, respectively.(ii)Smoothing. For t=N-1,N-2,…,1 iterate(27)PSt=i∣FtT~t;Θn=∑i∈sPSt=i∣FtT~t;ΘnPSt+1=j∣FtT~T;ΘnpijnPSt+1=i∣FtT~t;Θn The probability density functions (pdf) of the base and shifted regimes based on their diffusion and drift coefficient is, respectively, given as(28)fT~t∣St=i;Ft-1T~t;θ^1n=1σ1n2πT~t-1exp-T~t-1+κnT~t-122σ1n2T~t-12(29)fT~t∣St=i;Ft-1T~t;θ^2n=1σ2n2πexp⁡-T~t-μn-T~t-122σ2n2M-Step.By maximizing the expected log-likelihood function Θ(n+1)=argmax⁡QΘ∣Θ(n), the maximum likelihood (ML) estimate Θ(n+1) for the vector of unknown parameters will be calculated. Also, in this step the transition probabilities of the regime-switching model will be estimated.The log-likelihood function from the conditional probability density function of both regimes is, respectively, given as(30)log⁡Lθ1n,FtT~,St=∑t=2NPSt=i∣FtT~t;θ1^nlog⁡P1,i-log⁡σ12πT~t-1-12σ12T~t-12T~t-1+κnT~t-12(31)log⁡Lθ1n,FtT~,St=∑t=2NPSt=i∣FtT~t;θ2^nlog⁡P2,i-log⁡σ22π-12σ22T~t-μn-T~t-12By maximizing the log-likelihood function presented in (30), the vector of parameters θ1(n+1) can be estimated.(32)σ^1n+1=∑t=2NPSt=1∣FtT~t;θ1^nT~t-1-2T~t-1+βT~t-12∑t=2NPSt=1∣FtT~t;θ1^n(33)κ^n+1=∑t=1NPSt=1∣FtT~t;θ1^nT~t-1-2T~t-1T~t-T~t-1∑t=2NPSt=1∣FtT~t;θ1^nProof.
The first derivative of (30) with respect to σ1 is(34)∂L∂σ1=1σ13∑t=2NPSt=1∣FtT~t;θ1^nT~t-1+βT~t-12-σ12T~t-12T~t-12By maximizing (34), (35)∑t=2NPSt=1∣FtT~t;θ1^nT~t-1-2T~t-1+βT~t-12-σ12T~t-12=0∑t=2NPSt=1∣FtT~t;θ1^nT~t-1-2T~t-1+βT~t-12=∑t=2NPSt=1∣FtT~t;θ^1nσ12σ^1n+1=∑t=2NPSt=1∣FtT~t;θ1^nT~t-1-2T~t-1+βT~t-12∑t=2NPSt=1∣FtT~t;θ1^n The derivative of (30) with respect to β is(36)∂L∂κ=∑t=1NPSt=1∣FtT~t;θ1^nσ1-2T~t-1-2-T~t-12-βT~t-12+T~tT~t-1By maximizing (36), (37)∑t=1NPSt=1∣FtT~t;θ1^nσ1-2T~t-1-2-T~t-12-βT~t-12+T~tT~t-1=0κ∑t=2NPSt=1∣FtT~t;θ1^n=∑t=1NPSt=1∣FtT~t;θ1^nT~t-1-2T~t-1T~t-T~t-1κ^n+1=∑t=1NPSt=1∣FtT~t;θ1^nT~t-1-2T~t-1T~t-T~t-1∑t=2NPSt=1∣FtT~t;θ1^nAlso, the vector of unknowns ofθ2(n+1) can be estimated by maximizing (31):(38)μ^n+1=∑t=2NPSt=2∣FtT~t;θ2^nT~t-T~t-1∑t=2NPSt=2∣FtT~t;θ2^n(39)σ^2n+1=∑t=2NPSt=2∣FtT~t;θ2^nT~t-T~t-1-μ2∑t=2NPSt=2∣FtT~t;θ2^nProof.
By finding the derivative of (31) with respect to σ2,(40)∂L∂σ2=1σ23∑t=2NPSt=2∣FtT~t;θ^2nT~t-T~t-1-μ2-σ22Maximizing (40) gives (41)∑t=2NPSt=2∣FtT~t;θ^2nT~t-T~t-1-μ2-σ22=0∑t=2NPSt=2∣FtT~t;θ^2nT~t-T~t-1-μ2=σ22∑t=2NPSt=2∣FtT~t;θ^2nσ^2n+1=∑t=2NPSt=2∣FtT~t;θ2^nT~t-T~t-1-μ2∑t=2NPSt=2∣FtT~t;θ2^n The derivative of (31) with respect to μ is(42)∂L∂σ2=∑t=2NPSt=2∣FtT~t;θ^2nσ2-2T~t-T~t-1-μ2By maximizing (42)(43)∑t=2NPSt=2∣FtT~t;θ^2nT~t-T~t-12=μ∑t=2NPSt=2∣FtT~t;θ^2n(44)μ^n+1=∑t=2NPSt=2∣FtT~t;θ2^nT~t-T~t-1∑t=2NPSt=2∣FtT~t;θ2^nThe transition probabilities are estimated by making use of the formula proposed by Kim [32]:(45)pijn+1=∑t=2NPSt=j,St-1=i∣FNT~t;Θn∑t=2NPSt=i∣FNT~t;Θn=∑t=2NPSt=j∣FNT~t;ΘnpijnPSt-1=iFt-1T~t;Θn/PSt=j∣Ft-1T~t;Θn∑t=2NPSt-1=i∣FNT~t;Θn


## 4.4.1. Fitting the Deterministic Seasonality Model to Data

The deterministic seasonality process, model (5), can be transformed to(23)Sdt=a0+a1t+a2sin⁡2π365t+a3cos⁡2π365tTo find the numerical values in model (5), the transformed deterministic seasonality process (model (23)) is fitted to the DAT data. The parameters are estimated using the least square methods.(24)A0=a0A1=a1A2=a22+a32φ=3652πtan-1a3a2


## 4.4.2. Estimation of the TML Parameters

Estimating the parameters of TML model is not trivial. The parameters of the model are estimated using the Expectation-Maximization algorithm developed by Dempster et al. [31]. The vector of unknown parameters will be estimated by two steps’ iterative algorithm: an expectation- (E-) step and a maximization- (M-) step.Discretization.Even though temperature is a continuous process, its data is not recorded continuously but rather recorded in discrete time points. Therefore, estimating the parameters in a continuous time will be computationally costly. Before the parameters of the TML model are estimated, they will have to be calibrated to the deseasonalized DAT data and this is possible by transforming the model from its continuous form to a discrete form. The discretized form of model (9) for the base and shifted regimes is given as(25)T~t=T~tM:T~tM=T~t-1M1+κ+σMT~t-1MϵtM,T~Mis  in  regime1T~tL:T~tL=T~t-1L+μL+σLϵtL,T~Lis  in  regime2where ϵM(t) and ϵL(t) are the Weiner residual and Lévy residual, respectively.From (25), the vector of unknown parameters θ1={βM,σM,p1} and θ2={μL,σL,p2} for the base and shifted regimes, respectively, will be estimated.E-Step. Assume the length of the DAT historical data is N+1 and t=0,1,2,3,…,N where t represents a specific time that the DAT is recorded and θn is the computed vector of parameters in the nth iteration. The conditional distribution of the regimes St for time update values of t=0,1,2,3,…,N will be calculated. Suppose FtT~(t) is a vector of the past t+1 historical data of the discretized model, and then FtT~(t)={T~(1),T~(2),T~(3),…,T~(N)}.(i)Filtering. Based on the Bayes rule, the filtered probability of the discretized model can be estimated as(26)PSt=i∣FtT~t;Θn=PSt=i,T~t∣Ft-1T~t;ΘnfT~t∣Ft-1T~t;Θn=PSt=i∣Ft-1T~t;ΘnfT~t∣St=i;Ft-1T~t;Θn∑i∈sPSt=i∣Ft-1T~t;ΘnfT~t∣St=i;Ft-1T~t;Θn where Θ={θ1,θ2} and fT~(t)∣St=i;Ft-1T~(t) is the density of the underlying regime process i at time t conditional that the underlying process was in regime i. The conditional probability density function for the base and shifted regimes will be calculated from the CDF.From (25), the drift and diffusion coefficient of the base regime are (1+β)T~t-1M and σMT~t-1M, respectively. Similarly, the drift and diffusion coefficient of the shifted regimes are T~t-1L+μL and σL, respectively.(ii)Smoothing. For t=N-1,N-2,…,1 iterate(27)PSt=i∣FtT~t;Θn=∑i∈sPSt=i∣FtT~t;ΘnPSt+1=j∣FtT~T;ΘnpijnPSt+1=i∣FtT~t;Θn The probability density functions (pdf) of the base and shifted regimes based on their diffusion and drift coefficient is, respectively, given as(28)fT~t∣St=i;Ft-1T~t;θ^1n=1σ1n2πT~t-1exp-T~t-1+κnT~t-122σ1n2T~t-12(29)fT~t∣St=i;Ft-1T~t;θ^2n=1σ2n2πexp⁡-T~t-μn-T~t-122σ2n2M-Step.By maximizing the expected log-likelihood function Θ(n+1)=argmax⁡QΘ∣Θ(n), the maximum likelihood (ML) estimate Θ(n+1) for the vector of unknown parameters will be calculated. Also, in this step the transition probabilities of the regime-switching model will be estimated.The log-likelihood function from the conditional probability density function of both regimes is, respectively, given as(30)log⁡Lθ1n,FtT~,St=∑t=2NPSt=i∣FtT~t;θ1^nlog⁡P1,i-log⁡σ12πT~t-1-12σ12T~t-12T~t-1+κnT~t-12(31)log⁡Lθ1n,FtT~,St=∑t=2NPSt=i∣FtT~t;θ2^nlog⁡P2,i-log⁡σ22π-12σ22T~t-μn-T~t-12By maximizing the log-likelihood function presented in (30), the vector of parameters θ1(n+1) can be estimated.(32)σ^1n+1=∑t=2NPSt=1∣FtT~t;θ1^nT~t-1-2T~t-1+βT~t-12∑t=2NPSt=1∣FtT~t;θ1^n(33)κ^n+1=∑t=1NPSt=1∣FtT~t;θ1^nT~t-1-2T~t-1T~t-T~t-1∑t=2NPSt=1∣FtT~t;θ1^nProof.
The first derivative of (30) with respect to σ1 is(34)∂L∂σ1=1σ13∑t=2NPSt=1∣FtT~t;θ1^nT~t-1+βT~t-12-σ12T~t-12T~t-12By maximizing (34), (35)∑t=2NPSt=1∣FtT~t;θ1^nT~t-1-2T~t-1+βT~t-12-σ12T~t-12=0∑t=2NPSt=1∣FtT~t;θ1^nT~t-1-2T~t-1+βT~t-12=∑t=2NPSt=1∣FtT~t;θ^1nσ12σ^1n+1=∑t=2NPSt=1∣FtT~t;θ1^nT~t-1-2T~t-1+βT~t-12∑t=2NPSt=1∣FtT~t;θ1^n The derivative of (30) with respect to β is(36)∂L∂κ=∑t=1NPSt=1∣FtT~t;θ1^nσ1-2T~t-1-2-T~t-12-βT~t-12+T~tT~t-1By maximizing (36), (37)∑t=1NPSt=1∣FtT~t;θ1^nσ1-2T~t-1-2-T~t-12-βT~t-12+T~tT~t-1=0κ∑t=2NPSt=1∣FtT~t;θ1^n=∑t=1NPSt=1∣FtT~t;θ1^nT~t-1-2T~t-1T~t-T~t-1κ^n+1=∑t=1NPSt=1∣FtT~t;θ1^nT~t-1-2T~t-1T~t-T~t-1∑t=2NPSt=1∣FtT~t;θ1^nAlso, the vector of unknowns ofθ2(n+1) can be estimated by maximizing (31):(38)μ^n+1=∑t=2NPSt=2∣FtT~t;θ2^nT~t-T~t-1∑t=2NPSt=2∣FtT~t;θ2^n(39)σ^2n+1=∑t=2NPSt=2∣FtT~t;θ2^nT~t-T~t-1-μ2∑t=2NPSt=2∣FtT~t;θ2^nProof.
By finding the derivative of (31) with respect to σ2,(40)∂L∂σ2=1σ23∑t=2NPSt=2∣FtT~t;θ^2nT~t-T~t-1-μ2-σ22Maximizing (40) gives (41)∑t=2NPSt=2∣FtT~t;θ^2nT~t-T~t-1-μ2-σ22=0∑t=2NPSt=2∣FtT~t;θ^2nT~t-T~t-1-μ2=σ22∑t=2NPSt=2∣FtT~t;θ^2nσ^2n+1=∑t=2NPSt=2∣FtT~t;θ2^nT~t-T~t-1-μ2∑t=2NPSt=2∣FtT~t;θ2^n The derivative of (31) with respect to μ is(42)∂L∂σ2=∑t=2NPSt=2∣FtT~t;θ^2nσ2-2T~t-T~t-1-μ2By maximizing (42)(43)∑t=2NPSt=2∣FtT~t;θ^2nT~t-T~t-12=μ∑t=2NPSt=2∣FtT~t;θ^2n(44)μ^n+1=∑t=2NPSt=2∣FtT~t;θ2^nT~t-T~t-1∑t=2NPSt=2∣FtT~t;θ2^nThe transition probabilities are estimated by making use of the formula proposed by Kim [32]:(45)pijn+1=∑t=2NPSt=j,St-1=i∣FNT~t;Θn∑t=2NPSt=i∣FNT~t;Θn=∑t=2NPSt=j∣FNT~t;ΘnpijnPSt-1=iFt-1T~t;Θn/PSt=j∣Ft-1T~t;Θn∑t=2NPSt-1=i∣FNT~t;Θn


## 5. Discussion and Results

By inserting the estimated parameters into the transformed deterministic seasonality process (model (23)), the deterministic seasonal DAT is obtained for Bole and Tamale. The linear trend in the model is evidently very small. However, the linear trend of Bole DAT is more evident than that of Tamale DAT. Using the parameter estimates values in Table 6, seasonal sine graph is fitted to our Bole and Tamale DAT data (see Figure 8).(46)Sdt=26.8194+2.3855×10-05t-2.0234sin⁡2π365t-196.2153Sdt=28.5058+3.7039×10-05t-2.1026sin⁡2π365t-200.5695The estimated parameters of normal, HYP, GH, NIG, and VG distributions are presented in the Table 7.Table 6
Estimated parameters for deterministic seasonality model.
A 0 A 1 A2 φ Bole 26.8194 2.3855×10-5 -2.0234 196.2153 Tamale 28.5058 3.7039×10-05 -2.1026 200.5695Table 7
Estimated parameters of Normal, HYP, GH, NIG, and VG distributions fitted to Bole and Tamale DAT residuals. The parameters are estimated using the maximum likelihood method.
Normal HYP GH NIG VG Bole v – – 3.2875 – 0.0144 α – 1.7178 1.4813 × 1 0 - 5 1.5010 0.4968 β – -0.3921 -0.1839 -0.4087 -0.0140 μ 1.0873 × 1 0 - 6 0.6179 0.4638 0.6413 0.5004 δ 1.2995 1.6783 5.5849 × 1 0 - 6 2.2664 0  Tamale v – – 3.7329 – 0.0101 α – 1.6520 3.1272 × 1 0 - 5 1.5212 0.5006 β – -0.5406 -0.2570 -0.5807 -0.0097 μ 3.6874 × 1 0 - 6 1.1181 0.6802 1.1893 0.4793 δ 1.5431 2.2130 1.0713 × 1 0 - 5 2.8794 0Figure 8
Seasonal fit plot of Bole and Tamale residuals.To test for the goodness-of-fit of the distributions, two distance measures are used; the Kolmogorov-Smirnov (K-S) and the Anderson-Darling (A-D) statistic are used. The K-S test statistic and A-D test statistic are used to summarize the difference between the fitted cumulative density function (cdf) and the empirical cdf. Comparative to Kolmogorov-Smirnov, the A-D test statistics is more powerful because it incorporates integration over the entire range of data by paying more attention to the tail distances. The lower the value of K-S and A-D test statistics, the better the fit of that distribution.Regardless of the test used, the distance between the fitted hyperbolic distribution and its empirical distribution is lower compared to the other distributions and their empirical. This affirms that the hyperbolic distribution does fit well to our Bole and Tamale random noise. A series of random numbers for GH, NIG, HYP, and VG are generated using the parameters estimated in Table7. The Q-Q plots of the quantiles of the residuals versus the randomly generated quantiles of the GH, NIG, HYP, and VG distributions are plotted (see Figure 9). The straight line (in red) shows how the residual data would behave if it is perfectly distributed with the GH, NIG, HYP, and VG. From the illustrated figures (Figure 9), it is evident that the hyperbolic distribution fits plausibly well for our Bole and Tamale random components than the normal, GH, NIG, HYP, and VG distributions. This is consistent with the A-D and K-S goodness-of-fit test in Table 9.Figure 9
Q-Q plots of HYP, NIG, GH, and VG distributions.The deseasonalized DATT~t and the conditional probability of being in the extreme regime P(St=2) for the historical deseasonalized DAT are shown in Figure 10. The deseasonalized DAT that are categorize as “extremes,” that is, with P(St=2)>0.8, are represented by red dots.Figure 10
Calibration results of the MRS model with two independent regimes fitted to the deseasonalized daily average temperature. The lower panel shows the conditional probabilityP of being in the extreme regime.
(a)
Bole (b)
TamaleThe estimates of the TML model for deseasonalized temperature is presented in Table8. The speed of the mean-reversion is fairly low for both Bole and Tamale. However, the mean-reversion rate of Tamale is higher than that of Bole. The Markov probability p11 of the deseasonalized DAT to stay in the “normal” regime of the TML model at Bole and Tamale is higher than the Markov probability p22 of the deseasonalized DAT to stay in the “extreme” regime at Bole and Tamale. We can conclude that the “normal” regime of the TML model at both Bole and Tamale is relatively stable comparative to the “extreme" regime of the TML model. However, it is evident that there are instances that the temperatures of Bole and Tamale are at their extremes since the probability of staying in the “extreme” regime is significant even though it is small comparative to the probability of staying in the “normal” regime.Table 8
Estimated parameters for TML model.
Parameter σ 1 κ μ σ 2 p 11 p 22 Bole 0.0656 0.2047 29.8465 1.3939 0.9913 0.9490 Tamale 0.0100 0.3574 31.7835 1.4579 0.9909 0.9135Table 9
Goodness-of-fit test using the Kolmogorov-Smirnov and Anderson-Darling.
Normal HYP GH NIG VG Bole Kolmogorov-Smirnov 2.9650 0.6474 1.8743 0.7000 3.8201 Anderson-Darling 26.0323 0.5346 10.6454 0.7398 36.3417  Tamale Kolmogorov-Smirnov 1.4567 0.8977 1.2440 0.9370 2.4174 Anderson-Darling 36.0366 0.6035 8.8242 0.7864 41.6297


## 6. Conclusion

In this research, a novel time-varying mean-reversion Lévy regime-switching (TML) temperature dynamics model which captures the normal variations and extreme variations in temperature is developed to characterize the stochastic dynamics of temperature. The model includes a time-varying volatility and a Lévy process giving rise to the innovations. The parameters of the TML model is estimated by using a robust estimation method called the Expectation-Maximization (EM) algorithm.A study of the Bole and Tamale historical DAT data showed that the deseasonalized DAT data has the mean-reversion property. Using plots and test statistics, it was observed that the residuals of the deseasonalized data are not normally distributed. To model the nonnormality in the residuals, we employed the generalized hyperbolic, normal-inverse Gaussian, and hyperbolic distributions to capture the skewness and semiheavy tails in the residuals. The hyperbolic distribution was found to be the best distribution that can capture the semiheavy tails and skewness in the empirical distributions of the residuals in the shifted (“extreme”) regime. The introduction of the generalized hyperbolic and its subclasses led us to use the Lévy process in the shifted regime of the TML model for the deseasonalized temperature. The proposed regime-switching model is flexible as it modelled the deseasonalized temperature data reasonably well. Also, it was observed that there are instances that the temperature at both measurement stations are at their extremes as stated in the introduction.From our results, it is evident that, due to the changes in volatility of the daily average temperature dynamics, conventional models that depend on Gaussian distribution will be ineffective when pricing weather derivatives in the derivative market. Our model however can be used to price weather derivative contracts written on temperature indices (CAT and GDD) for farmers in Africa since it incorporates the stylized facts of temperature in the model.



---

*Source: 8534131-2018-07-10.xml*