R Under development (unstable) (2025-04-19 r88162 ucrt) -- "Unsuffered Consequences" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(partsm) > > ########################### > ###### acf.ext1 > ########################### > > data("gergnp") > lgergnp <- log(gergnp, base=exp(1)) > > out <- acf.ext1(wts=lgergnp, transf.type="orig", + type="correlation", lag.max=12, showcat=TRUE, plot=FALSE) ---- Estimated autocorrelation function for the original series. Lag acf pvalue pvl 1 0 1.000 0 *** 2 1 0.948 0 *** 3 2 0.904 0 *** 4 3 0.895 0 *** 5 4 0.889 0 *** 6 5 0.841 0 *** 7 6 0.799 0 *** 8 7 0.790 0 *** 9 8 0.783 0 *** 10 9 0.736 0 *** 11 10 0.697 0 *** 12 11 0.689 0 *** 13 12 0.685 0 *** s.e.= 0.09 Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > > out <- acf.ext1(wts=lgergnp, transf.type="perdiffsd", perdiff.coeff = c(1.004, 0.981, 1.047, 0.969), + type="correlation", lag.max=12, showcat=TRUE, plot=FALSE) ---- Estimated autocorrelation function for the residuals of the periodic differences on four seasonal dummy variables. Lag acf pvalue pvl 1 0 1.000 0.000 *** 2 1 -0.269 0.003 ** 3 2 -0.301 0.001 *** 4 3 -0.200 0.026 * 5 4 0.768 0.000 *** 6 5 -0.253 0.005 ** 7 6 -0.278 0.002 ** 8 7 -0.158 0.079 . 9 8 0.617 0.000 *** 10 9 -0.188 0.037 * 11 10 -0.271 0.003 ** 12 11 -0.147 0.104 13 12 0.554 0.000 *** s.e.= 0.09 Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > > ########################### > ###### fit.ar.par > ########################### > > ## Models for the the logarithms of the Real GNP in Germany. > data("gergnp") > lgergnp <- log(gergnp, base=exp(1)) > > ## Fit an AR(4) model with intercept and seasonal dummies. > detcomp <- list(regular=c(1,0,c(1,2,3)), seasonal=c(0,0), regvar=0) > out.ar <- fit.ar.par(wts=lgergnp, type="AR", detcomp=detcomp, p=4) > > ## Fit a PAR(2) model with seasonal intercepts. > detcomp <- list(regular=c(0,0,0), seasonal=c(1,0), regvar=0) > out.par <- fit.ar.par(wts=lgergnp, type="PAR", detcomp=detcomp, p=2) > > ########################### > ###### fit.piar > ########################### > > ## Fit a PIAR(2) model for the logarithms of the Real GNP in Germany. > data("gergnp") > lgergnp <- log(gergnp, base=exp(1)) > detcomp <- list(regular=c(0,0,0), seasonal=c(1,0), regvar=0) > out <- fit.piar(wts=lgergnp, detcomp=detcomp, p=2, initvalues=NULL) > > ########################### > ###### Fnextp.test > ########################### > > ## Test the significance of a second order lag in a PAR model for the Real GNP in Germany. > ## Including seasonal intercepts. > data("gergnp") > lgergnp <- log(gergnp, base=exp(1)) > detcomp <- list(regular=c(0,0,0), seasonal=c(1,0), regvar=0) > out <- Fnextp.test(wts=lgergnp, detcomp=detcomp, p=1, type="PAR") > > ########################### > ###### Fpar.test > ########################### > > ## Test for periodicity in a second order PAR model for > ## the logarithms of the Real GNP in Germany time series. > data("gergnp") > lgergnp <- log(gergnp, base=exp(1)) > detcomp <- list(regular=c(0,0,0), seasonal=c(1,0), regvar=0) > out <- Fpar.test(wts=lgergnp, detcomp=detcomp, p=2) > > > ########################### > ###### Fpari.piar.test > ########################### > > ## Test for the unit root 1 in a PAR(2) with seasonal intercepts for > ## the logarithms of the Real GNP in Germany. > data("gergnp") > lgergnp <- log(gergnp, base=exp(1)) > detcomp <- list(regular=c(0,0,0), seasonal=c(1,0), regvar=0) > out <- Fpari.piar.test(wts=lgergnp, detcomp=detcomp, p=2, type="PARI1") > > ########################### > ###### Fsh.test > ########################### > > ## Fsh test for the residuals of the first differences > ## of the logarithms of the Real GNP in Germany > ## on an AR(4) model with seasonal intercepts. > data("gergnp") > lgergnp <- log(gergnp, base=exp(1)) > wts <- ts(c(NA, diff(gergnp, lag=1)), frequency=4, start=start(lgergnp)) > > detcomp=list(regular=c(0,0,0), seasonal=c(1,0), regvar=0) > ar4 <- fit.ar.par(wts=lgergnp, type="AR", p=4, detcomp=detcomp) > out <- Fsh.test(res=residuals(ar4@lm.ar), s=frequency(wts)) > > ########################### > ###### LRurpar.test > ########################### > > ## Test for a single unit root in a PAR(2) model with seasonal intercepts for the > ## logarithms of the Real GNP in Germany. > data("gergnp") > lgergnp <- log(gergnp, base=exp(1)) > detcomp <- list(regular=c(0,0,0), seasonal=c(1,0), regvar=0) > out <- LRurpar.test(wts=lgergnp, detcomp=detcomp, p=2) > > ########################### > ###### PAR.MVrepr > ########################### > > ## Models for the the logarithms of the Real GNP in Germany. > data("gergnp") > lgergnp <- log(gergnp, base=exp(1)) > > ## Fit an PAR model > detcomp <- list(regular=c(0,0,0), seasonal=c(1,0), regvar=0) > out.par <- fit.ar.par(wts=lgergnp, type="PAR", detcomp=detcomp, p=2) > > ## Show the matrix representation: > out.MV <- PAR.MVrepr(out.par) > out.MV ---- Multivariate representation of a PAR model. Phi0: 1.000 0.000 0.000 0 -0.279 1.000 0.000 0 0.320 -1.237 1.000 0 0.000 -0.422 -0.637 1 Phi1: 0 0 -0.375 1.360 0 0 0.000 0.684 0 0 0.000 0.000 0 0 0.000 0.000 Eigen values of Gamma = Phi0^{-1} %*% Phi1: 0.965 0.036 0 0 Time varying accumulation of shocks: 0.173 1.182 0.492 1.360 0.140 1.158 0.573 1.064 0.118 1.054 0.552 0.881 0.134 1.160 0.594 1.010 > > ########################### > ###### PAR.MVrepr-methods > ########################### > > ## Load data and select the deterministic components. > data("gergnp") > lgergnp <- log(gergnp, base=exp(1)) > detcomp <- list(regular=c(0,0,0), seasonal=c(1,0), regvar=0) > > ## Multivariate representation of a PAR(2) model with sesonal intercepts. > out.par <- fit.ar.par(wts=lgergnp, type="PAR", detcomp=detcomp, p=2) > PAR.MVrepr(out.par) ---- Multivariate representation of a PAR model. Phi0: 1.000 0.000 0.000 0 -0.279 1.000 0.000 0 0.320 -1.237 1.000 0 0.000 -0.422 -0.637 1 Phi1: 0 0 -0.375 1.360 0 0 0.000 0.684 0 0 0.000 0.000 0 0 0.000 0.000 Eigen values of Gamma = Phi0^{-1} %*% Phi1: 0.965 0.036 0 0 Time varying accumulation of shocks: 0.173 1.182 0.492 1.360 0.140 1.158 0.573 1.064 0.118 1.054 0.552 0.881 0.134 1.160 0.594 1.010 > > ## Multivariate representation of a PIAR(2) model with sesonal intercepts. > out.piar <- fit.piar(wts=lgergnp, detcomp=detcomp, p=2) > PAR.MVrepr(out.piar) ---- Multivariate representation of a PIAR model. Phi0: 1.000 0.000 0.000 0 -0.962 1.000 0.000 0 0.000 -0.912 1.000 0 0.000 0.000 -1.113 1 Phi1: 0 0 0 1.025 0 0 0 0.000 0 0 0 0.000 0 0 0 0.000 Eigen values of Gamma = Phi0^{-1} %*% Phi1: 1 0 0 0 Time varying accumulation of shocks: 1.000 1.040 1.140 1.025 0.962 1.000 1.097 0.985 0.877 0.912 1.000 0.898 0.976 1.015 1.113 1.000 > > ########################### > ###### plotpdiff > ########################### > > ## Load data and select the deterministic components. > data("gergnp") > lgergnp <- log(gergnp, base=exp(1)) > detcomp <- list(regular=c(0,0,0), seasonal=c(1,0), regvar=0) > > ## Fit a PIAR(2) model with seasonal intercepts. > out.piar <- fit.piar(wts=lgergnp, detcomp=detcomp, p=2) > plotpdiff(out.piar) > > ########################### > ###### plotpredpiar > ########################### > > ## Load data and select the deterministic components. > data("gergnp") > lgergnp <- log(gergnp, base=exp(1)) > > ## Fit a PIAR(2) model with seasonal intercepts. > out.pred <- predictpiar(wts=lgergnp, p=2, hpred=24) > plotpredpiar(out.pred) > > ########################### > ###### predictpiar > ########################### > > ## 24 step-ahead forecasts in a PIAR(2) model for the > ## logarithms of the Real GNP in Germany. > data("gergnp") > lgergnp <- log(gergnp, base=exp(1)) > pred.out <- predictpiar(wts=lgergnp, p=2, hpred=24) > > ########################### > ###### show-methods > ########################### > > ## Load data and select the deterministic components. > data("gergnp") > lgergnp <- log(gergnp, base=exp(1)) > detcomp <- list(regular=c(0,0,0), seasonal=c(1,0), regvar=0) > > ## Fit an AR(4) model with intercept and seasonal dummies. > dcar <- list(regular=c(1,0,c(1,2,3)), seasonal=c(0,0), regvar=0) > out.ar <- fit.ar.par(wts=lgergnp, type="AR", detcomp=dcar, p=4) > show(out.ar) ---- AR model of order 4 . y_t = phi_1*y_{t-1} + phi_2*y_{t-2} + ... + phi_p*y_{t-p} + coeffs*detcomp + epsilon_t ---- Autoregressive coefficients. p=1 p=2 p=3 p=4 phi_p 0.56 -0.17 0.21 0.39 > > ## Fit a PAR(2) model with seasonal intercepts. > out.par <- fit.ar.par(wts=lgergnp, type="PAR", detcomp=detcomp, p=2) > show(out.par) ---- PAR model of order 2 . y_t = alpha_{1,s}*y_{t-1} + alpha_{2,s}*y_{t-2} + ... + alpha_{p,s}*y_{t-p} + coeffs*detcomp + epsilon_t, for s=1,2,...,4 ---- Autoregressive coefficients. s=1 s=2 s=3 s=4 alpha_1s 1.36 0.28 1.24 0.64 alpha_2s -0.38 0.68 -0.32 0.42 > > ## Fnextp.test > Fnextp.out <- Fnextp.test(wts=lgergnp, detcomp=detcomp, p=1, type="PAR") > show(Fnextp.out) ---- Test for the significance of the p+1 periodic autoregressive parameters . Null hypothesis: PAR ( 1 ) with the selected deterministic components. Alternative hypothesis: PAR ( 2 ) with the selected deterministic components. F-statistic: 8.54 on 4 and 111 DF, p-value: 4.783718e-06 *** Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > > ## Fpar.test > Fpar.out <- Fpar.test(wts=lgergnp, detcomp=detcomp, p=2) > show(Fpar.out) ---- Test for periodicity in the autoregressive parameters . Null hypothesis: AR( 2 ) with the selected deterministic components. Alternative hypothesis: PAR( 2 ) with the selected deterministic components. F-statistic: 43.46 on 6 and 116 DF, p-value: 0 *** Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > > ## Fsh.test > ar4 <- fit.ar.par(wts=lgergnp, type="AR", p=4, detcomp=detcomp) > Fsh.out <- Fsh.test(res=residuals(ar4@lm.ar), s=frequency(lgergnp)) > show(Fsh.out) ---- Test for seasonal heteroskedasticity . F-statistic: 0.52 on 3 and 119 DF, p-value: 0.6702526 Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > > ## Fit a PIAR(2) model with seasonal intercepts. > out.piar <- fit.piar(wts=lgergnp, detcomp=detcomp, p=2) > show(out.piar) ---- PIAR model of order 2 . y_t - alpha_s*y_{t-1} = beta_s*(y_{t-1} - alpha_{s-1}*y_{t-2}) + coeffs*detcomp + epsilon_t, with prod(alpha_s=1) for s=1,2,...,4. Periodic autoregressive coefficients: s=1 s=2 s=3 s=4 alpha_s 1.025 0.962 0.912 1.113 beta_s 0.338 -0.676 0.351 -0.429 > > ## Fpari.piar.test > Fpari1.out <- Fpari.piar.test(wts=lgergnp, detcomp=detcomp, p=2, type="PARI1") > show(Fpari1.out) ---- Test for a parameter restriction in a PAR model . F-statistic: 20.83 on 3 and 114 DF, p-value: 7.884426e-11 *** Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > > ## Fit a PIAR(2) model with seasonal intercepts. > out.piar <- fit.piar(wts=lgergnp, detcomp=detcomp, p=2) > show(out.piar) ---- PIAR model of order 2 . y_t - alpha_s*y_{t-1} = beta_s*(y_{t-1} - alpha_{s-1}*y_{t-2}) + coeffs*detcomp + epsilon_t, with prod(alpha_s=1) for s=1,2,...,4. Periodic autoregressive coefficients: s=1 s=2 s=3 s=4 alpha_s 1.025 0.962 0.912 1.113 beta_s 0.338 -0.676 0.351 -0.429 > > ## Test for a single unit root in a PAR(2) model with seasonal intercepts. > out.LR <- LRurpar.test(wts=lgergnp, detcomp=detcomp, p=2) > show(out.LR) ---- Likelihood ratio test for a single unit root in a PAR model of order 2 . Null hypothesis: PAR( 2 ) restricted to a unit root. Alternative hypothesis: PAR( 2 ). LR-statistic: 4.9 --- 5 and 10 per cent asymptotic critical values: when seasonal intercepts are included: 9.24, 7.52. when seasonal intercepts and trends are included: 12.96, 10.50. LRtau-statistic: -2.21 --- 5 and 10 per cent asymptotic critical values: when seasonal intercepts are included: -2.86, -2.57. when seasonal intercepts and trends are included: -3.41, -3.12. > > ## 24 step-ahead forecasts in a PIAR(2) model. > pred.out <- predictpiar(wts=lgergnp, p=2, hpred=24) > options(digits=4) > show(pred.out) ---- Forecasts for a PIAR model of order 2 . fcast fse ucb lcb 1991.01 6.123 0.01368 6.149 6.096 1991.02 6.144 0.01423 6.172 6.116 1991.03 6.158 0.02203 6.201 6.115 1991.04 6.212 0.02392 6.259 6.165 1992.01 6.155 0.02971 6.214 6.097 1992.02 6.176 0.02792 6.230 6.121 1992.03 6.187 0.03080 6.247 6.126 1992.04 6.244 0.03397 6.310 6.177 1993.01 6.188 0.03867 6.264 6.112 1993.02 6.207 0.03667 6.279 6.135 1993.03 6.215 0.03766 6.289 6.141 1993.04 6.275 0.04166 6.357 6.194 1994.01 6.221 0.04590 6.311 6.131 1994.02 6.239 0.04370 6.324 6.153 1994.03 6.244 0.04345 6.329 6.159 1994.04 6.307 0.04814 6.402 6.213 1995.01 6.253 0.05213 6.355 6.151 1995.02 6.270 0.04974 6.367 6.172 1995.03 6.272 0.04855 6.368 6.177 1995.04 6.339 0.05384 6.445 6.234 1996.01 6.286 0.05769 6.399 6.173 1996.02 6.301 0.05513 6.409 6.193 1996.03 6.301 0.05317 6.405 6.197 1996.04 6.371 0.05900 6.487 6.255 'fcast': Forecast; 'fse': Forecast standard error; 'ucb': Upper confidence bound; 'lcb': Lower condidence bound. > options(digits=7) > > ########################### > ###### summary-methods > ########################### > > ## Load data and select the deterministic components. > data("gergnp") > lgergnp <- log(gergnp, base=exp(1)) > detcomp <- list(regular=c(0,0,0), seasonal=c(1,0), regvar=0) > > ## Fit an AR(4) model with intercept and seasonal dummies. > dcar <- list(regular=c(1,0,c(1,2,3)), seasonal=c(0,0), regvar=0) > out.ar <- fit.ar.par(wts=lgergnp, type="AR", detcomp=dcar, p=4) > summary(out.ar) ---- AR model of order 4 . y_t = phi_1*y_{t-1} + phi_2*y_{t-2} + ... + phi_p*y_{t-p} + coeffs*detcomp + epsilon_t ---- Autoregressive coefficients. p=1 p=2 p=3 p=4 phi_p 0.56 -0.17 0.21 0.39 Call: lm(formula = MLag[, 1] ~ 0 + MLag[, 2:(p + 1)] + MDT) Residuals: Min 1Q Median 3Q Max -0.046689 -0.013253 0.001226 0.014248 0.036602 Coefficients: Estimate Std. Error t value Pr(>|t|) MLag[, 2:(p + 1)]1 0.5552021 0.0856252 6.484 2.49e-09 *** MLag[, 2:(p + 1)]2 -0.1749828 0.0951762 -1.839 0.06864 . MLag[, 2:(p + 1)]3 0.2114966 0.0941355 2.247 0.02662 * MLag[, 2:(p + 1)]4 0.3894855 0.0827725 4.705 7.29e-06 *** MDT..Interc 0.1369769 0.0408089 3.357 0.00108 ** MDT..SeasDum.1 -0.0458312 0.0092457 -4.957 2.56e-06 *** MDT..SeasDum.2 0.0047561 0.0110646 0.430 0.66814 MDT..SeasDum.3 -0.0006322 0.0097437 -0.065 0.94838 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.01906 on 112 degrees of freedom (4 observations deleted due to missingness) Multiple R-squared: 1, Adjusted R-squared: 1 F-statistic: 1.366e+06 on 8 and 112 DF, p-value: < 2.2e-16 > > ## Fit a PAR(2) model with seasonal intercepts. > detcomp <- list(regular=c(0,0,0), seasonal=c(1,0), regvar=0) > out.par <- fit.ar.par(wts=lgergnp, type="PAR", detcomp=detcomp, p=2) > summary(out.par) ---- PAR model of order 2 . y_t = alpha_{1,s}*y_{t-1} + alpha_{2,s}*y_{t-2} + ... + alpha_{p,s}*y_{t-p} + coeffs*detcomp + epsilon_t, for s=1,2,...,4 ---- Autoregressive coefficients. s=1 s=2 s=3 s=4 alpha_1s 1.36 0.28 1.24 0.64 alpha_2s -0.38 0.68 -0.32 0.42 Call: lm(formula = MLag[, 1] ~ 0 + Yperlag + MDT) Residuals: Min 1Q Median 3Q Max -0.036010 -0.010041 0.000738 0.010132 0.023345 Coefficients: Estimate Std. Error t value Pr(>|t|) Yperlag1 1.36009 0.19249 7.066 1.54e-10 *** Yperlag2 0.27916 0.14974 1.864 0.064948 . Yperlag3 1.23684 0.15393 8.035 1.15e-12 *** Yperlag4 0.63741 0.18549 3.436 0.000833 *** Yperlag5 -0.37525 0.21372 -1.756 0.081900 . Yperlag6 0.68417 0.15344 4.459 2.00e-05 *** Yperlag7 -0.31986 0.14636 -2.185 0.030980 * Yperlag8 0.42167 0.16741 2.519 0.013216 * MDT..SeasDum.1 0.01689 0.13463 0.125 0.900413 MDT..SeasDum.2 0.20065 0.06436 3.118 0.002326 ** MDT..SeasDum.3 0.51349 0.07194 7.138 1.07e-10 *** MDT..SeasDum.4 -0.30955 0.12661 -2.445 0.016077 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.01406 on 110 degrees of freedom (2 observations deleted due to missingness) Multiple R-squared: 1, Adjusted R-squared: 1 F-statistic: 1.696e+06 on 12 and 110 DF, p-value: < 2.2e-16 > > ## Fnextp.test > Fnextp.out <- Fnextp.test(wts=lgergnp, detcomp=detcomp, p=1, type="PAR") > summary(Fnextp.out) ---- Test for the significance of the p+1 periodic autoregressive parameters . Null hypothesis: PAR ( 1 ) with the selected deterministic components. Alternative hypothesis: PAR ( 2 ) with the selected deterministic components. F-statistic: 8.54 on 4 and 111 DF, p-value: 4.783718e-06 *** Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ---- ---- ## Fitted model for the null hypothesis. Call: lm(formula = MLag[, 1] ~ 0 + Yperlag + MDT) Residuals: Min 1Q Median 3Q Max -0.036634 -0.011828 0.001345 0.010133 0.039786 Coefficients: Estimate Std. Error t value Pr(>|t|) Yperlag1 1.02255 0.01115 91.719 < 2e-16 *** Yperlag2 0.94901 0.01015 93.534 < 2e-16 *** Yperlag3 0.90108 0.01067 84.442 < 2e-16 *** Yperlag4 1.10386 0.01182 93.362 < 2e-16 *** MDT..SeasDum.1 -0.19712 0.06424 -3.068 0.00269 ** MDT..SeasDum.2 0.32773 0.05761 5.689 9.89e-08 *** MDT..SeasDum.3 0.61662 0.06099 10.110 < 2e-16 *** MDT..SeasDum.4 -0.58943 0.06818 -8.645 3.66e-14 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.0158 on 115 degrees of freedom (1 observation deleted due to missingness) Multiple R-squared: 1, Adjusted R-squared: 1 F-statistic: 2.029e+06 on 8 and 115 DF, p-value: < 2.2e-16 ---- ---- ## Fitted model for the alternative hypothesis. Call: lm(formula = MLag[, 1] ~ 0 + Yperlag + MDT) Residuals: Min 1Q Median 3Q Max -0.036010 -0.010041 0.000738 0.010132 0.023345 Coefficients: Estimate Std. Error t value Pr(>|t|) Yperlag1 1.36009 0.19249 7.066 1.54e-10 *** Yperlag2 0.27916 0.14974 1.864 0.064948 . Yperlag3 1.23684 0.15393 8.035 1.15e-12 *** Yperlag4 0.63741 0.18549 3.436 0.000833 *** Yperlag5 -0.37525 0.21372 -1.756 0.081900 . Yperlag6 0.68417 0.15344 4.459 2.00e-05 *** Yperlag7 -0.31986 0.14636 -2.185 0.030980 * Yperlag8 0.42167 0.16741 2.519 0.013216 * MDT..SeasDum.1 0.01689 0.13463 0.125 0.900413 MDT..SeasDum.2 0.20065 0.06436 3.118 0.002326 ** MDT..SeasDum.3 0.51349 0.07194 7.138 1.07e-10 *** MDT..SeasDum.4 -0.30955 0.12661 -2.445 0.016077 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.01406 on 110 degrees of freedom (2 observations deleted due to missingness) Multiple R-squared: 1, Adjusted R-squared: 1 F-statistic: 1.696e+06 on 12 and 110 DF, p-value: < 2.2e-16 > > ## Fpar.test > Fpar.out <- Fpar.test(wts=lgergnp, detcomp=detcomp, p=2) > summary(Fpar.out) ---- Test for periodicity in the autoregressive parameters . Null hypothesis: AR( 2 ) with the selected deterministic components. Alternative hypothesis: PAR( 2 ) with the selected deterministic components. F-statistic: 43.46 on 6 and 116 DF, p-value: 0 *** Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ---- ---- ## Fitted model for the null hypothesis. Call: lm(formula = MLag[, 1] ~ 0 + MLag[, 2:(p + 1)] + MDT) Residuals: Min 1Q Median 3Q Max -0.060078 -0.016547 -0.001247 0.018020 0.062154 Coefficients: Estimate Std. Error t value Pr(>|t|) MLag[, 2:(p + 1)]1 0.82849 0.09205 9.001 5.18e-15 *** MLag[, 2:(p + 1)]2 0.15820 0.09115 1.736 0.08530 . MDT..SeasDum.1 0.01063 0.05120 0.208 0.83588 MDT..SeasDum.2 0.10316 0.05061 2.038 0.04378 * MDT..SeasDum.3 0.13392 0.05104 2.624 0.00986 ** MDT..SeasDum.4 0.09382 0.05165 1.816 0.07192 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.02514 on 116 degrees of freedom (2 observations deleted due to missingness) Multiple R-squared: 1, Adjusted R-squared: 1 F-statistic: 1.061e+06 on 6 and 116 DF, p-value: < 2.2e-16 ---- ---- ## Fitted model for the alternative hypothesis. Call: lm(formula = MLag[, 1] ~ 0 + Yperlag + MDT) Residuals: Min 1Q Median 3Q Max -0.036010 -0.010041 0.000738 0.010132 0.023345 Coefficients: Estimate Std. Error t value Pr(>|t|) Yperlag1 1.36009 0.19249 7.066 1.54e-10 *** Yperlag2 0.27916 0.14974 1.864 0.064948 . Yperlag3 1.23684 0.15393 8.035 1.15e-12 *** Yperlag4 0.63741 0.18549 3.436 0.000833 *** Yperlag5 -0.37525 0.21372 -1.756 0.081900 . Yperlag6 0.68417 0.15344 4.459 2.00e-05 *** Yperlag7 -0.31986 0.14636 -2.185 0.030980 * Yperlag8 0.42167 0.16741 2.519 0.013216 * MDT..SeasDum.1 0.01689 0.13463 0.125 0.900413 MDT..SeasDum.2 0.20065 0.06436 3.118 0.002326 ** MDT..SeasDum.3 0.51349 0.07194 7.138 1.07e-10 *** MDT..SeasDum.4 -0.30955 0.12661 -2.445 0.016077 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.01406 on 110 degrees of freedom (2 observations deleted due to missingness) Multiple R-squared: 1, Adjusted R-squared: 1 F-statistic: 1.696e+06 on 12 and 110 DF, p-value: < 2.2e-16 > > ## Fsh.test > ar4 <- fit.ar.par(wts=lgergnp, type="AR", p=4, detcomp=detcomp) > Fsh.out <- Fsh.test(res=residuals(ar4@lm.ar), s=frequency(lgergnp)) > summary(Fsh.out) ---- Test for seasonal heteroskedasticity . F-statistic: 0.52 on 3 and 119 DF, p-value: 0.6702526 Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ---- ---- ## Fitted model for the null hypothesis. Call: lm(formula = res2 ~ 1) Residuals: Min 1Q Median 3Q Max -3.388e-04 -2.899e-04 -1.532e-04 6.824e-05 1.841e-03 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3.390e-04 3.956e-05 8.569 4.45e-14 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.0004333 on 119 degrees of freedom ---- ---- ## Fitted model for the alternative hypothesis. Call: lm(formula = res2 ~ SDum[, 1:(s - 1)]) Residuals: Min 1Q Median 3Q Max -3.776e-04 -2.593e-04 -1.624e-04 5.121e-05 1.801e-03 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3.777e-04 7.960e-05 4.745 5.99e-06 *** SDum[, 1:(s - 1)]1 9.969e-07 1.126e-04 0.009 0.993 SDum[, 1:(s - 1)]2 -1.210e-04 1.126e-04 -1.075 0.285 SDum[, 1:(s - 1)]3 -3.511e-05 1.126e-04 -0.312 0.756 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.000436 on 116 degrees of freedom Multiple R-squared: 0.01324, Adjusted R-squared: -0.01228 F-statistic: 0.5186 on 3 and 116 DF, p-value: 0.6703 > > ## Fit a PIAR(2) model. > out.piar <- fit.piar(wts=lgergnp, detcomp=detcomp, p=2) > summary(out.piar, digits=1) ---- PIAR model of order 2 . y_t - alpha_s*y_{t-1} = beta_s*(y_{t-1} - alpha_{s-1}*y_{t-2}) + coeffs*detcomp + epsilon_t, with prod(alpha_s=1) for s=1,2,...,4. Periodic autoregressive coefficients: s=1 s=2 s=3 s=4 alpha_s 1.025 0.962 0.912 1.113 beta_s 0.338 -0.676 0.351 -0.429 ---- Estimates of the non-linear model. Estimate Std. Error t value Pr(>|t|) coef1 1.025 0.011 93.8 <2e-16 *** coef2 0.962 0.011 86.8 <2e-16 *** coef3 0.912 0.009 96.0 <2e-16 *** coef4 0.338 0.195 1.7 0.086 . coef5 -0.676 0.152 -4.4 2e-05 *** coef6 0.351 0.154 2.3 0.025 * coef7 -0.429 0.186 -2.3 0.023 * coef8 0.008 0.137 0.1 0.953 coef9 0.115 0.051 2.3 0.026 * coef10 0.466 0.069 6.7 9e-10 *** coef11 -0.404 0.120 -3.4 0.001 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ---- Periodically differenced data. Qtr1 Qtr2 Qtr3 Qtr4 1960 NA 0.2 0.6 -0.6 1961 -0.2 0.2 0.6 -0.6 1962 -0.2 0.3 0.6 -0.7 1963 -0.2 0.3 0.6 -0.6 1964 -0.2 0.3 0.6 -0.6 1965 -0.2 0.3 0.5 -0.6 1966 -0.2 0.3 0.5 -0.7 1967 -0.2 0.3 0.5 -0.6 1968 -0.2 0.3 0.6 -0.6 1969 -0.2 0.3 0.6 -0.6 1970 -0.2 0.3 0.6 -0.6 1971 -0.2 0.3 0.6 -0.7 1972 -0.2 0.3 0.6 -0.6 1973 -0.2 0.2 0.6 -0.7 1974 -0.2 0.2 0.6 -0.7 1975 -0.2 0.3 0.5 -0.6 1976 -0.2 0.3 0.5 -0.6 1977 -0.2 0.2 0.5 -0.6 1978 -0.2 0.3 0.5 -0.6 1979 -0.2 0.3 0.5 -0.6 1980 -0.2 0.2 0.5 -0.6 1981 -0.2 0.2 0.5 -0.6 1982 -0.2 0.2 0.5 -0.6 1983 -0.2 0.3 0.5 -0.6 1984 -0.2 0.2 0.6 -0.6 1985 -0.2 0.3 0.6 -0.7 1986 -0.2 0.3 0.6 -0.7 1987 -0.2 0.3 0.6 -0.6 1988 -0.2 0.3 0.6 -0.7 1989 -0.2 0.3 0.6 -0.7 1990 -0.2 0.3 0.6 -0.7 > > ## Fpari.piar.test > Fpari1.out <- Fpari.piar.test(wts=lgergnp, detcomp=detcomp, p=2, type="PARI1") > Fpari1.out ---- Test for a parameter restriction in a PAR model . F-statistic: 20.83 on 3 and 114 DF, p-value: 7.884426e-11 *** Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > # options(digits=3) > # summary(Fpari1.out) > # options(digits=3) > > ## Fit a PIAR(2) model with seasonal intercepts. > out.piar <- fit.piar(wts=lgergnp, detcomp=detcomp, p=2) > summary(out.piar, digits=1) ---- PIAR model of order 2 . y_t - alpha_s*y_{t-1} = beta_s*(y_{t-1} - alpha_{s-1}*y_{t-2}) + coeffs*detcomp + epsilon_t, with prod(alpha_s=1) for s=1,2,...,4. Periodic autoregressive coefficients: s=1 s=2 s=3 s=4 alpha_s 1.025 0.962 0.912 1.113 beta_s 0.338 -0.676 0.351 -0.429 ---- Estimates of the non-linear model. Estimate Std. Error t value Pr(>|t|) coef1 1.025 0.011 93.8 <2e-16 *** coef2 0.962 0.011 86.8 <2e-16 *** coef3 0.912 0.009 96.0 <2e-16 *** coef4 0.338 0.195 1.7 0.086 . coef5 -0.676 0.152 -4.4 2e-05 *** coef6 0.351 0.154 2.3 0.025 * coef7 -0.429 0.186 -2.3 0.023 * coef8 0.008 0.137 0.1 0.953 coef9 0.115 0.051 2.3 0.026 * coef10 0.466 0.069 6.7 9e-10 *** coef11 -0.404 0.120 -3.4 0.001 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ---- Periodically differenced data. Qtr1 Qtr2 Qtr3 Qtr4 1960 NA 0.2 0.6 -0.6 1961 -0.2 0.2 0.6 -0.6 1962 -0.2 0.3 0.6 -0.7 1963 -0.2 0.3 0.6 -0.6 1964 -0.2 0.3 0.6 -0.6 1965 -0.2 0.3 0.5 -0.6 1966 -0.2 0.3 0.5 -0.7 1967 -0.2 0.3 0.5 -0.6 1968 -0.2 0.3 0.6 -0.6 1969 -0.2 0.3 0.6 -0.6 1970 -0.2 0.3 0.6 -0.6 1971 -0.2 0.3 0.6 -0.7 1972 -0.2 0.3 0.6 -0.6 1973 -0.2 0.2 0.6 -0.7 1974 -0.2 0.2 0.6 -0.7 1975 -0.2 0.3 0.5 -0.6 1976 -0.2 0.3 0.5 -0.6 1977 -0.2 0.2 0.5 -0.6 1978 -0.2 0.3 0.5 -0.6 1979 -0.2 0.3 0.5 -0.6 1980 -0.2 0.2 0.5 -0.6 1981 -0.2 0.2 0.5 -0.6 1982 -0.2 0.2 0.5 -0.6 1983 -0.2 0.3 0.5 -0.6 1984 -0.2 0.2 0.6 -0.6 1985 -0.2 0.3 0.6 -0.7 1986 -0.2 0.3 0.6 -0.7 1987 -0.2 0.3 0.6 -0.6 1988 -0.2 0.3 0.6 -0.7 1989 -0.2 0.3 0.6 -0.7 1990 -0.2 0.3 0.6 -0.7 > > ## Test for a single unit root in a PAR(2) model with seasonal intercepts. > out.LR <- LRurpar.test(wts=lgergnp, detcomp=detcomp, p=2) > options(digits=1) > summary(out.LR) ---- Likelihood ratio test for a single unit root in a PAR model of order 2 . Null hypothesis: PAR( 2 ) restricted to a unit root. Alternative hypothesis: PAR( 2 ). LR-statistic: 5 --- 5 and 10 per cent asymptotic critical values: when seasonal intercepts are included: 9.24, 7.52. when seasonal intercepts and trends are included: 12.96, 10.50. LRtau-statistic: -2 --- 5 and 10 per cent asymptotic critical values: when seasonal intercepts are included: -2.86, -2.57. when seasonal intercepts and trends are included: -3.41, -3.12. ---- ---- ## Fitted model for the null hypothesis. Estimate Std. Error t value Pr(>|t|) coef1 1.025 0.011 93.75 2e-107 coef2 0.962 0.011 86.81 7e-104 coef3 0.912 0.009 95.99 1e-108 coef4 0.338 0.195 1.73 9e-02 coef5 -0.676 0.152 -4.44 2e-05 coef6 0.351 0.154 2.27 3e-02 coef7 -0.429 0.186 -2.31 2e-02 coef8 0.008 0.137 0.06 1e+00 coef9 0.115 0.051 2.26 3e-02 coef10 0.466 0.069 6.71 9e-10 coef11 -0.404 0.120 -3.36 1e-03 ---- ---- ## Fitted model for the alternative hypothesis. Call: lm(formula = MLag[, 1] ~ 0 + Yperlag + MDT) Coefficients: Yperlag1 Yperlag2 Yperlag3 Yperlag4 Yperlag5 1.3601 0.2792 1.2368 0.6374 -0.3753 Yperlag6 Yperlag7 Yperlag8 MDT..SeasDum.1 MDT..SeasDum.2 0.6842 -0.3199 0.4217 0.0169 0.2007 MDT..SeasDum.3 MDT..SeasDum.4 0.5135 -0.3096 > options(digits=7) > > proc.time() user system elapsed 0.56 0.07 0.62