Skip to contents

Test if a time series is periodically integrated.

Usage

test_piar(x, d, p, sintercept = FALSE, sslope = FALSE, homoschedastic = FALSE)

Arguments

x

time series.

d

period.

p

autoregressive order, a positive integer.

sintercept

if TRUE, include seasonal intercept.

sslope

if TRUE, include seasonal slope.

homoschedastic

if TRUE, assume the innovations variance is the same for all seasons.

Details

Computes test statistics for Franses (1996) test for periodic integration of order 1. The test is based on periodic autoregression of order p, where p can be any positive integer.

Value

a list with the following components:

p

autoregressive order.

spec

values of sintercept, sslope, and homoschedastic, a named logical vector.

statistics

a matrix containing the test statistics (first row) and the corresponding p-values (second row). "LR" is not normalised, so its p-value is NA.

References

Boswijk HP and Franses PH (1996). ``Unit roots in periodic autoregressions.'' Journal of Time Series Analysis, 17(3), pp. 221--245.

Author

Georgi N. Boshnakov

Note

Currently only the case p = 1 is handled, for p > 1 the statistics are set to NA. :TODO: handle this.

All statistics are computed but some p-values are not computed yet.

See also

Examples

ts1 <- window(dataFranses1996[ , "CanadaUnemployment"],
              start = c(1960, 1), end = c(1987, 4))
test_piar(ts1, 4, 1, sintercept = TRUE)
#> $p
#> [1] 1
#> 
#> $spec
#>     sintercept         sslope homoschedastic 
#>           TRUE          FALSE          FALSE 
#> 
#> $statistics
#>                LR      LRtau        tau  perFuller
#> stats   0.2757132 -0.5250840 -0.5066658 -0.7737611
#> pvalues        NA  0.8680436  0.8749612  0.9052944
#> 
pcTest(ts1, "piar", 4, 1, sintercept = TRUE) # same
#> $p
#> [1] 1
#> 
#> $spec
#>     sintercept         sslope homoschedastic 
#>           TRUE          FALSE          FALSE 
#> 
#> $statistics
#>                LR      LRtau        tau  perFuller
#> stats   0.2757132 -0.5250840 -0.5066658 -0.7737611
#> pvalues        NA  0.8680436  0.8749612  0.9052944
#> 

test_piar(ts1, 4, 1, sintercept = TRUE, sslope = TRUE)
#> $p
#> [1] 1
#> 
#> $spec
#>     sintercept         sslope homoschedastic 
#>           TRUE           TRUE          FALSE 
#> 
#> $statistics
#>               LR     LRtau        tau  perFuller
#> stats   32.46523 -5.697827 -1.8148425 -4.8636649
#> pvalues       NA        NA  0.6583561  0.8397845
#> 
test_piar(ts1, 4, 1)              
#> $p
#> [1] 1
#> 
#> $spec
#>     sintercept         sslope homoschedastic 
#>          FALSE          FALSE          FALSE 
#> 
#> $statistics
#>                LR     LRtau       tau perFuller
#> stats   0.1868073 0.4322121 0.4126738 0.3638568
#> pvalues        NA 0.7540915 0.7478642 0.8316871
#> 
test_piar(ts1, 4, 1, homoschedastic = TRUE)              
#> $p
#> [1] 1
#> 
#> $spec
#>     sintercept         sslope homoschedastic 
#>          FALSE          FALSE           TRUE 
#> 
#> $statistics
#>                LR     LRtau       tau perFuller
#> stats   0.2111895 0.4595536 0.4126738 0.3638568
#> pvalues        NA 0.7628059 0.7478642 0.8316871
#>