1 Introduction

In some situations, for example in biology, economic, electronic, finance and management researches, we wish to determine whether the two time series are generated by the same stochastic mechanism or their random behavior differs. The comparison of two time series models has been studied in both time- and frequency-domain methods. Coates and Diggle (1986), Diggle and Fisher (1991), Dargahi-Noubary (1992), Diggle and Al Wasel (1997), Kakizawa et al. (1998), Maharaj (2002) and Caiado et al. (2006) studied the comparison and discrimination of time series with equal length using spectral analysis approaches. Classification and clustering analysis of time series with unequal length have done by Camacho et al. (2004). They truncated data and used information about truncated time series spectra to compare them. Caiado et al. (2006) proposed a method based on periodogram to compare two unequal length time series. They calculated the periodogram at different Fourier frequencies and proposed nonparametric and parametric test statistics to test the hypothesis that the two series with different lengths are generated by the same stochastic mechanism.

In this work, the asymptotic distribution for the difference of two ARMA coefficients is presented. This can be applied to construct confidence bands, and a test to compare two time series models. Also, we present the results of Monte Carlo simulation study on the performance of the proposed method. Finally, we compare this method with approach which was introduced by Caiado et al. (2006).

2 Large Samples Inference

For two independent populations, suppose \(\left\{ {X_{t}^{(1)} , t = 1, \ldots , n_{1} } \right\}\) and \(\left\{ {X_{t}^{(2)} , t = 1, \ldots , n_{2} } \right\}\) are causal invertible ARMA(p,q) processes,

$$X_{t}^{\left( i \right)} - \phi_{1}^{\left( i \right)} X_{t - 1}^{\left( i \right)} - \cdots - \phi_{p}^{\left( i \right)} X_{t - p}^{\left( i \right)} = Z_{t}^{\left( i \right)} + \theta_{1}^{\left( i \right)} Z_{t - 1}^{\left( i \right)} + \cdots + \theta_{q}^{\left( i \right)} Z_{t - q}^{\left( i \right)} , \left\{ {Z_{t}^{\left( i \right)} } \right\}\sim{\text{IID}}\left( {0,\sigma^{2} } \right), i = 1,2.$$
(2.1)

Assume \(\hat{\varvec{\beta }}_{i} = (\hat{\phi }_{1}^{\left( i \right)} , \ldots , \hat{\phi }_{p}^{\left( i \right)} , \hat{\theta }_{1}^{\left( i \right)} , \ldots , \hat{\theta }_{q}^{\left( i \right)} )^{'} = (\hat{\phi }^{\left( i \right)} , \hat{\theta }^{\left( i \right)} )^{'} , i = 1, 2,\) and \(\hat{\sigma }^{2}\) are the maximum likelihood estimators of \(\varvec{\beta}_{i} = (\phi^{\left( i \right)} ,\varvec{\theta}^{\left( i \right)} )^{'} , i = 1, 2,\) and \(\sigma^{2}\), respectively.

We are interested in testing \(H_{0} :\varvec{\beta}_{1} =\varvec{\beta}_{2}\) versus \(H_{1} :\varvec{\beta}_{1} \ne\varvec{\beta}_{2} .\) If \(H_{0}\) is rejected, then the two time series models are different, and if \(H_{0}\) is not rejected, then there is no significant difference between two models and two time series have same stochastic mechanism.

Lemma 2.1

Under the assumptions of model (2.1), for \(i = 1,2,\)

$$\sqrt n \left( {\hat{\varvec{\beta }}_{i} -\varvec{\beta}_{i} } \right) \to N_{p + q} \left( {0,{\text{V}}_{i} } \right) \quad {\text{as}}\; n \to \infty ,$$

where \(n = \hbox{min} \left( {n_{1} , n_{2} } \right),\) and the asymptotic covariance matrix \({\text{V}}_{i}\) can be computed from

$${\text{V}}_{i} = \sigma^{2} \left[ {\begin{array}{*{20}c} {E\left( {U_{t}^{\left( i \right)} U_{t}^{'\left( i \right)} } \right)} & {E\left( {U_{t}^{\left( i \right)} V_{t}^{'\left( i \right)} } \right)} \\ {E\left( {V_{t}^{\left( i \right)} U_{t}^{'\left( i \right)} } \right)} & {E\left( {V_{t}^{\left( i \right)} V_{t}^{'\left( i \right)} } \right)} \\ \end{array} } \right]^{ - 1} ,$$

where \(\varvec{U}_{t}^{\left( i \right)} = (U_{t}^{\left( i \right)} , \ldots , U_{t + 1 - p}^{\left( i \right)} )^{'} ,\) \(\varvec{V}_{t}^{\left( i \right)} = (V_{t}^{\left( i \right)} , \ldots , V_{t + 1 - q}^{\left( i \right)} )^{'}\) and \(\left\{ {U_{t} } \right\}\), \(\left\{ {V_{t} } \right\}\) are the autoregressive processes,

$$\phi \left( B \right)U_{t} = Z_{t} ,$$

and

$$\theta \left( B \right)V_{t} = Z_{t} .$$

Proof

The outline of the proof is given in Brockwell and Davis (1991). □

We are interested in making inference about the parameter \(\varvec{\beta}=\varvec{\beta}_{1} -\varvec{\beta}_{2}\). We will apply a methodology similar to the works of Mahmoudi and Mahmoudi (2013a, b), and Mahmoudi et al. (2014). Since \({\hat{\varvec{\beta}}}_{i} , i = 1,2,\) are estimators for \(\varvec{\beta}_{i} , i = 1,2\), \(\varvec{b} = {\hat{\varvec{\beta}}}_{1} - {\hat{\varvec{\beta}}}_{2}\) is a reasonable estimator for the parameter \(\varvec{\beta}\).

Now, by using the Cramer’s theorem and Slutsky’s theorem, the asymptotic distribution for \(\varvec{b}\) is therefore given by

$$\sqrt n \left( {\varvec{b} -\varvec{\beta}} \right) \to N_{p + q} \left( {0,\varSigma } \right) , \quad{\text{as}}\; n \to \infty ,$$

where

$$\varSigma = {\text{V}}_{1} + {\text{V}}_{2} .$$

Consequently we have

$$T_{n} = n\left( {\varvec{b} -\varvec{\beta}} \right)^{'} \varSigma^{ - 1} \left( {\varvec{b} -\varvec{\beta}} \right) \to \chi^{2} \left( {p + q} \right), \quad{\text{as}} \;n \to \infty ,$$
(2.2)

where \(\chi^{2} \left( {p + q} \right)\) is Chi-square distribution with (\(p + q\)) degrees of freedom. This result can be used to construct asymptotic confidence bands and hypothesis testing.

2.1 Asymptotic Confidence Bands

Note that the parameter \(\varSigma\) in \(T_{n}\) given by (2.2) depends on the unknown parameters \({\text{V}}_{1} , {\text{V}}_{2}\) and \(\sigma^{2}\), so it cannot be used as a pivotal quantity for the parameter \(\varvec{\beta}\). We use common estimators of above parameters; therefore, we have

$$T_{n}^{*} = n\left( {\varvec{b} -\varvec{\beta}} \right)^{'} \hat{\varSigma }^{ - 1} \left( {\varvec{b} -\varvec{\beta}} \right) \to \chi^{2} \left( {p + q} \right)\quad {\text{as }}n \to \infty ,$$
(2.3)

where \(\hat{\varSigma } = {\hat{\text{V}}}_{1} + {\hat{\text{V}}}_{2} .\) (See Ferguson 1996.)

Now, \(T_{n}^{*}\) can be used as a pivotal quantity to construct asymptotic confidence bands for \(\varvec{\beta}\),

$$P\left\{ {\varvec{\beta}:n\left( {\varvec{b} -\varvec{\beta}} \right)^{'} \hat{\varSigma }^{ - 1} \left( {\varvec{b} -\varvec{\beta}} \right) \le \chi_{1 - \alpha }^{2} (p + q)} \right\} = 1 - \alpha ,$$
(2.4)

where \(\chi_{1 - \alpha }^{2} \left( {p + q} \right)\) is (\(1 - \alpha\)) percentile of \(\chi^{2} \left( {p + q} \right)\) distribution.

2.2 Hypothesis Testing

As mentioned, hypothesis testing about \(\varvec{\beta}\) is important in practice. For instance, the assumption \(\varvec{\beta}= 0\) is equivalent to the assumption \(\varvec{\beta}_{1} =\varvec{\beta}_{2}\) (equality of two models). In general, to test \(H_{0} :\varvec{\beta}=\varvec{\beta}_{0}\), the test statistic can be

$$T_{0} = n\left( {\varvec{b} -\varvec{\beta}_{0} } \right)^{'} \hat{\varSigma }^{ - 1} \left( {\varvec{b} -\varvec{\beta}_{0} } \right).$$
(2.5)

Under null hypothesis, \(T_{0}\) has asymptotically a \(\chi^{2} \left( {p + q} \right)\) distribution. Therefore, the critical region for a test of size \(\alpha\) is \(T_{0} > \chi_{1 - \alpha }^{2} \left( {p + q} \right).\)

Remark

In application, the orders of model for each time series are selected by Akaike information-corrected criterion (AICC) or Bayesian information criterion (BIC) selection criterions. If \({\text{ARMA}}(p_{1} ,q_{1} )\) and \({\text{ARMA}}(p_{2} ,q_{2} )\) are best models to series 1 and 2, respectively, then we assume \(p = { \hbox{max} }\left\{ {p_{1} , p_{2} } \right\}\), \(q = { \hbox{max} }\left\{ {q_{1} , q_{2} } \right\}\) and fit \({\text{ARMA}}(p,q)\) model to each time series.

3 Simulation Study

In this section, numerous data sets are generated and analyzed to investigate the performance of proposed method. Estimated type I error probabilities (\(\hat{\alpha }\)) and empirical powers \((\hat{\pi })\) are computed for different values of

$$\left( {n1, n2} \right) = \left\{ {\left( {100, 50} \right), \left( {150, 75} \right), \left( {200, 100} \right), \left( {500, 250} \right), \left( {1000, 500} \right), (2000,1000)} \right\}$$

based on 1000 replications. Also we compare the performance of proposed method with the method which was presented by Caiado et al. (2006). The methodology for computing the test statistic based on their method runs as follows:

  1. (i)

    Compute the periodogram ordinates of \(\left\{ {X_{t}^{(k)} } \right\}\) by

    $$P_{{X_{t}^{\left( k \right)} }} \left( {\omega_{j} } \right) = \left( {2\pi n_{k} } \right)^{ - 1} \left| {\mathop \sum \limits_{t = 1}^{{n_{k} }} X_{t}^{\left( k \right)} e^{{ - it\omega_{j} }} } \right|^{2} ,$$

    where \(\omega_{j} = 2\pi j/n_{k}\), for \(j = 1, \ldots , m_{k} ,\) with \(m_{k} = \left[ {n_{k} /2} \right]\), the largest integer less than or equal to \(n_{k} /2\), and the frequency \(\omega_{j}\) is in the range \(\left[ { - \pi , \pi } \right].\)

    Without loss of generality, let \(r = \left[ {pm_{1} /m_{2} } \right]\) be the largest integer less than or equal to \(pm_{1} /m_{2}\) for \(p = 1, \ldots , m_{2}\), and \(m_{2} < m_{1} .\)

  2. (ii)

    Normalize the periodograms, dividing by the sample variances and let

    $${\text{NP}}_{{X_{t}^{\left( k \right)} }} \left( {\omega_{p} } \right) = \frac{{P_{{X_{t}^{\left( k \right)} }} \left( {\omega_{j} } \right)}}{{\widehat{\text{Var}}(X_{t}^{\left( k \right)} )}}.$$
  3. (iii)

    Define the sample mean and sample variance of the log-normalized periodogram by

    $$\bar{X}_{{{\text{LNP}},k}} = \frac{1}{m}\mathop \sum \limits_{p = 1}^{m} \log \left( {{\text{NP}}_{{X_{t}^{\left( k \right)} }} \left( {\omega_{p} } \right)} \right),$$

    and

    $$S_{{{\text{LNP}},k}}^{2} = \frac{1}{m}\mathop \sum \limits_{p = 1}^{m} \left( {\log \left( {{\text{NP}}_{{X_{t}^{\left( k \right)} }} \left( {\omega_{p} } \right)} \right) - \bar{X}_{{{\text{LNP}},k}} } \right)^{2} ,$$

    where \(m\) is the number of periodogram ordinates of the series with shorter length (in this case \(m = m_{2}\)).

  4. (iv)

    Compute the test statistic

    $$D_{\text{NP}} = \frac{{\frac{1}{m}\mathop \sum \nolimits_{p = 1}^{m} \left( {{ \log }\left( {{\text{NP}}_{{X_{t}^{\left( 1 \right)} }} \left( {\omega_{p} } \right)} \right) - { \log }\left( {{\text{NP}}_{{X_{t}^{\left( 2 \right)} }} \left( {\omega_{p} } \right)} \right)} \right)}}{{\sqrt {\left( {S_{{{\text{LNP}},1}}^{2} + S_{{{\text{LNP}},2}}^{2} } \right)/m} }},$$

    for comparison of the log-normalized periodograms of the two series.

\(D_{\text{NP}}\) has asymptotically a standard normal distribution. Therefore, the critical region for a test of level \(\alpha\) is \(\left| {D_{\text{NP}} } \right| > Z_{1 - \alpha /2} ,\) where \(Z_{1 - \alpha /2}\) is (\(1 - \alpha /2\)) percentile of standard normal distribution.

Example 1

(AR(1)). Consider the AR(1) model

$$X_{t}^{\left( i \right)} - \phi_{1}^{\left( i \right)} X_{t - 1}^{\left( i \right)} = Z_{t}^{\left( i \right)},\quad \left\{ {Z_{t}^{\left( i \right)} } \right\}\sim{\text{IID}}\left( {0,1} \right),\quad i = 1,2.$$

Therefore, we have

$$\sqrt n \left( {b - \beta } \right) \to N_{1} \left( {0,\varSigma } \right),\quad {\text{as }}n \to \infty ,$$

where \(\varSigma = {\text{V}}_{1} + {\text{V}}_{2}\) and \({\text{V}}_{i} = \left( {1 - \left( {\phi_{1}^{\left( i \right)} } \right)^{2} } \right).\)

We consider \(\phi_{1}^{\left( 1 \right)} = 0.5\) for the first population. For the second population, we consider \(\phi_{1}^{\left( 2 \right)} = 0.1, 0.3, 0.5, 0.7\) and \(0.9.\)

The two rows opposite of \(\phi_{1}^{\left( 2 \right)} = 0.5\) in Table 1 report the values of \(\hat{\alpha }\) for proposed method (above row) and \(D_{\text{NP}}\) test statistic (bottom row), respectively. Other rows give the values of \(\hat{\pi }\) for the other values of \(\phi_{1}^{\left( 2 \right)}\).

Table 1 Estimates of power and size of 0.05 test of significance for AR(1), \(\phi_{1}\) = 0.5 versus AR(1), \(\phi_{1} = 0.1,\varvec{ }0.3,\varvec{ }0.5,\varvec{ }0.7\) and \(0.9.\)

Example 2

(MA(1)). Consider the MA(1) model

$$X_{t}^{\left( i \right)} = Z_{t}^{\left( i \right)} + \theta_{1}^{\left( i \right)} Z_{t - 1}^{\left( i \right)},\quad \left\{ {Z_{t}^{\left( i \right)} } \right\}\sim{\text{IID}}\left( {0,1} \right),\quad i = 1,2.$$

Therefore, we have

$$\sqrt n \left( {b - \beta } \right) \to N_{1} \left( {0,\varSigma } \right), \quad{\text{as}} \; n \to \infty ,$$

where \(\varSigma = {\text{V}}_{1} + {\text{V}}_{2}\) and \({\text{V}}_{i} = \left( {1 - \left( {\theta_{1}^{\left( i \right)} } \right)^{2} } \right).\)

We consider \(\theta_{1}^{\left( 1 \right)} = 0.5\) for the first population. For the second population, we consider \(\theta_{1}^{\left( 2 \right)} = 0.1, 0.3, 0.5, 0.7\) and \(0.9.\)

The two rows opposite of \(\theta_{1}^{\left( 2 \right)} = 0.5\) in Table 2 report the values of \(\hat{\alpha }\) for proposed method (above row) and \(D_{\text{NP}}\) test statistic (bottom row), respectively. Other rows give the values of \(\hat{\pi }\) for the other values of \(\theta_{1}^{\left( 2 \right)}\).

Table 2 Estimates of power and size of 0.05 test of significance for MA(1), \(\theta_{1}\) = 0.5 versus MA(1), \(\theta_{1} = 0.1, 0.3, 0.5, 0.7\) and \(0.9.\)

Example 3

(ARMA(1,1)). Consider the ARMA(1,1) model

$$X_{t}^{\left( i \right)} - \phi_{1}^{\left( i \right)} X_{t - 1}^{\left( i \right)} = Z_{t}^{\left( i \right)} + \theta_{1}^{\left( i \right)} Z_{t - 1}^{\left( i \right)} , \quad\left\{ {Z_{t}^{\left( i \right)} } \right\}\sim{\text{IID}}\left( {0,1} \right),\quad i = 1,2.$$

Therefore, we have

$$\sqrt n \left( {\varvec{b} -\varvec{\beta}} \right) \to N_{2} \left( {0,{\varvec{\Sigma}}} \right),\quad {\text{as }} n \to \infty ,$$

where

$$\varSigma = {{V}}_{1} + {{V}}_{2} \quad{\text{and}}\quad {{V}}_{i} = \left[ {\begin{array}{*{20}c} {( {1 - ( {\phi_{1}^{( i )} } )^{2} } )( {1 + \phi_{1}^{( i )} \theta_{1}^{( i )} } )} & { - ( {1 - ( {\phi_{1}^{( i )} } )^{2} } )( {1 - ( {\theta_{1}^{( i )} } )^{2} } )} \\ { - ( {1 - ( {\phi_{1}^{( i )} } )^{2} } )( {1 - ( {\theta_{1}^{( i )} } )^{2} } )} & {( {1 - ( {\theta_{1}^{( i )} } )^{2} } )( {1 + \phi_{1}^{( i )} \theta_{1}^{( i )} } )} \\ \end{array} }\right].$$

We consider \(\phi_{1}^{\left( 1 \right)} = 0.2\) and \(\theta_{1}^{\left( 1 \right)} = - 0.5\) for the first population. For the second population, we consider \(\phi_{1}^{\left( 2 \right)} = 0.2\) and \(\theta_{1}^{\left( 2 \right)} = - 0.1, - 0.3, - 0.5, - 0.7\) and \(- 0.9.\)

The two rows opposite of \(\theta_{1}^{\left( 2 \right)} = - 0.5\) in Table 3 report the values of \(\hat{\alpha }\) for proposed method (above row) and \(D_{\text{NP}}\) test statistic (bottom row), respectively. Other rows give the values of \(\hat{\pi }\) for the other values of \(\theta_{1}^{\left( 2 \right)}\).

Table 3 Estimates of power and size of 0.05 test of significance for ARMA(1,1), \(\phi_{1}\) = 0.2, \(\theta_{1}\) = −0.5 versus ARMA(1,1), \(\phi_{1} = 0.2, \theta_{1} = - 0.1, - 0.3, - 0.5, - 0.7\) and \(- 0.9.\)

Example 4

IID noise versus AR(1).

For the first population, we generate data from \({\text{IIDN}}\left( {0,1} \right).\) For the second population, we consider the AR(1) model with \(\phi_{1}^{\left( 2 \right)} = 0.0, 0.2, 0.4, 0.6\) and \(0.8.\)

The two rows opposite of \(\phi_{1}^{\left( 2 \right)} = 0.0\) in Table 4 report the values of \(\hat{\alpha }\) for proposed method (above row) and \(D_{\text{NP}}\) test statistic (bottom row), respectively. Other rows give the values of \(\hat{\pi }\) for the other values of \(\phi_{1}^{\left( 2 \right)}\).

Table 4 Estimates of power and size of 0.05 test of significance for IID noise versus AR(1), \(\phi_{1} = 0.0,\varvec{ }0.2,\varvec{ }0.4,\varvec{ }0.6\) and \(0.8.\)

As can be seen in Tables 1, 2, 3 and 4, the results reveal that the size of two methods is very close to the nominal level (\(\alpha = 0.05\)), especially as \(\left( {n_{1} , n_{2} } \right)\) growing, and so the type I error are asymptotically controlled by two methods. On the other hand, the power studies show the excellent discriminatory ability of the proposed method. The proposed test is more powerful than the \(D_{\text{NP}}\) statistic test. Also, recording the CPU time spent on both methods emphasized the proposed method is computationally intensive.