Last updated on 2020-05-17 05:46:45 CEST.
Flavor | Version | Tinstall | Tcheck | Ttotal | Status | Flags |
---|---|---|---|---|---|---|
r-devel-linux-x86_64-debian-clang | 3.0 | ERROR | ||||
r-devel-linux-x86_64-debian-gcc | 3.0 | 6.68 | 61.10 | 67.78 | ERROR | |
r-devel-linux-x86_64-fedora-clang | 3.0 | 104.44 | ERROR | |||
r-devel-linux-x86_64-fedora-gcc | 3.0 | 103.10 | ERROR | |||
r-devel-windows-ix86+x86_64 | 3.0 | 24.00 | 148.00 | 172.00 | OK | |
r-patched-linux-x86_64 | 3.0 | 8.54 | 78.83 | 87.37 | ERROR | |
r-patched-solaris-x86 | 3.0 | 140.70 | ERROR | |||
r-release-linux-x86_64 | 3.0 | 9.42 | 78.20 | 87.62 | ERROR | |
r-release-osx-x86_64 | 3.0 | OK | ||||
r-release-windows-ix86+x86_64 | 3.0 | 37.00 | 149.00 | 186.00 | OK | |
r-oldrel-osx-x86_64 | 3.0 | OK | ||||
r-oldrel-windows-ix86+x86_64 | 3.0 | 14.00 | 98.00 | 112.00 | OK |
Version: 3.0
Check: package dependencies
Result: NOTE
Package suggested but not available for checking: 'TSA'
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-patched-linux-x86_64, r-patched-solaris-x86, r-release-linux-x86_64
Version: 3.0
Check: Rd cross-references
Result: NOTE
Unknown package 'TSA' in Rd xrefs
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-patched-linux-x86_64, r-release-linux-x86_64
Version: 3.0
Check: examples
Result: ERROR
Running examples in 'portes-Ex.R' failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: BoxPierce
> ### Title: The Univariate-Multivariate Box and Pierce Portmanteau Test
> ### Aliases: BoxPierce
> ### Keywords: Portmanteau Test
>
> ### ** Examples
>
> x <- rnorm(100)
> BoxPierce(x) ## univariate test
lags statistic df p-value
5 3.365573 5 0.6438184
10 5.656600 10 0.8432421
15 6.411116 15 0.9719842
20 10.784097 20 0.9516304
25 14.805770 25 0.9458056
30 18.070877 30 0.9573747
> x <- cbind(rnorm(100),rnorm(100))
> BoxPierce(x) ## multivariate test
lags statistic df p-value
5 21.57526 20 0.3639953
10 46.56519 40 0.2203640
15 68.17104 60 0.2192425
20 80.06079 80 0.4770587
25 93.89001 100 0.6531214
30 109.78629 120 0.7374883
> ##
> ##
> ## Annual flow of the river Nile at Aswan - 1871 to 1970
> fit <- arima(Nile, c(1, 0, 1))
> lags <- c(5, 10, 20)
> ## Apply the univariate test statistic on the fitted model
> BoxPierce(fit, lags) ## Correct (no need to specify order)
lags statistic df p-value
5 1.278883 3 0.7341534
10 9.002228 8 0.3421081
20 12.767895 18 0.8051730
> BoxPierce(fit, lags, order = 2) ## Correct
lags statistic df p-value
5 1.278883 3 0.7341534
10 9.002228 8 0.3421081
20 12.767895 18 0.8051730
> ## Apply the test statistic on the residuals and set order = 2
> res <- resid(fit)
> BoxPierce(res, lags) ## Wrong (order is needed!)
lags statistic df p-value
5 1.278883 5 0.9370895
10 9.002228 10 0.5318922
20 12.767895 20 0.8871190
> BoxPierce(res, lags, order = 2) ## Correct
lags statistic df p-value
5 1.278883 3 0.7341534
10 9.002228 8 0.3421081
20 12.767895 18 0.8051730
> ##
> ##
> ## Quarterly, west German investment, income, and consumption from 1960 Q1 to 1982 Q4
> data(WestGerman)
> DiffData <- matrix(numeric(3 * 91), ncol = 3)
> for (i in 1:3)
+ DiffData[, i] <- diff(log(WestGerman[, i]), lag = 1)
> fit <- ar.ols(DiffData, intercept = TRUE, order.max = 2)
> lags <- c(5,10)
> ## Apply the test statistic on the fitted model
> BoxPierce(fit,lags) ## Correct (no need to specify order)
lags statistic df p-value
5 29.13889 27 0.3541968
10 66.82771 72 0.6502032
> ## Apply the test statistic on the residuals where order = 2
> res <- ts((fit$resid)[-(1:2), ])
> BoxPierce(res,lags) ## Wrong (order is needed!)
lags statistic df p-value
5 29.13889 45 0.9678196
10 66.82771 90 0.9679689
> BoxPierce(res,lags,order = 2) ## Correct
lags statistic df p-value
5 29.13889 27 0.3541968
10 66.82771 72 0.6502032
> ##
> ##
> ## Monthly log stock returns of Intel corporation data: Test for ARCH Effects
> monthintel <- as.ts(monthintel)
> BoxPierce(monthintel) ## Usual test
lags statistic df p-value
5 4.666889 5 0.45786938
10 14.364748 10 0.15699489
15 23.120348 15 0.08161787
20 24.000123 20 0.24238680
25 29.617977 25 0.23891229
30 31.943703 30 0.37015020
> BoxPierce(monthintel,squared.residuals=TRUE) ## Test for ARCH effects
lags statistic df p-value
5 40.78073 5 1.039009e-07
10 49.57872 10 3.189915e-07
15 81.90133 15 3.131517e-11
20 86.50575 20 3.006796e-10
25 87.54737 25 7.161478e-09
30 88.55017 30 1.087505e-07
> ##
> ##
> ## Test for seasonality
> ## Accidental Deaths in the US 1973 - 1978
> seasonal.arima <- arima(USAccDeaths, order = c(0,1,1), seasonal = list(order = c(0,1,1)))
> BoxPierce(seasonal.arima, lags = 5, season = 12)
lags statistic df p-value
5 0.5845238 3 0.899966
> ## Quarterly U.K. economic time series from 1957 Q3 to 1967 Q4
> cd <- EconomicUK[,1]
> cd.fit <- arima(cd,order=c(0,1,0),seasonal=list(order=c(0,1,1),period=4))
> BoxPierce(cd.fit, lags = c(5,10), season = 4)
lags statistic df p-value
5 1.307341 4 0.8601288
10 1.918594 9 0.9926904
> ##
> ##
> #### Write a function to fit a model: Apply portmanteau test on fitted obj with class "list"
> ## Example 1
> require("FitAR")
Loading required package: FitAR
Loading required package: lattice
Loading required package: leaps
Loading required package: ltsa
Loading required package: bestglm
Attaching package: 'FitAR'
The following object is masked from 'package:forecast':
BoxCox
> FitModel <- function(data){
+ fit <- FitAR(z=data,p=2)
+ p <- length(fit$phiHat)
+ order <- p
+ res <- fit$res
+ list(res=res,order=order)
+ }
> Fit <- FitModel(Nile)
> BoxPierce(Fit)
lags statistic df p-value
5 1.158604 3 0.7629488
10 9.847560 8 0.2758887
15 13.158988 13 0.4356074
20 15.144813 18 0.6520008
25 16.276022 23 0.8432003
30 19.215107 28 0.8913678
> detach(package:FitAR)
> ##
> ## Example 2
> require("TSA")
Loading required package: TSA
Warning in library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'TSA'
> FitModel <- function(data){
+ fit <- TSA::tar(y=log(data),p1=4,p2=4,d=3,a=0.1,b=0.9,print=FALSE)
+ res <- ts(fit$std.res)
+ p1 <- fit$p1
+ p2 <- fit$p2
+ order <- max(p1, p2)
+ parSpec <- list(res=res,order=order)
+ parSpec
+ }
> data(prey.eq)
Warning in data(prey.eq) : data set 'prey.eq' not found
> Fit <- FitModel(prey.eq)
Error in loadNamespace(name) : there is no package called 'TSA'
Calls: FitModel ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-patched-linux-x86_64, r-release-linux-x86_64
Version: 3.0
Check: examples
Result: ERROR
Running examples in ‘portes-Ex.R’ failed
The error most likely occurred in:
> ### Name: BoxPierce
> ### Title: The Univariate-Multivariate Box and Pierce Portmanteau Test
> ### Aliases: BoxPierce
> ### Keywords: Portmanteau Test
>
> ### ** Examples
>
> x <- rnorm(100)
> BoxPierce(x) ## univariate test
lags statistic df p-value
5 3.365573 5 0.6438184
10 5.656600 10 0.8432421
15 6.411116 15 0.9719842
20 10.784097 20 0.9516304
25 14.805770 25 0.9458056
30 18.070877 30 0.9573747
> x <- cbind(rnorm(100),rnorm(100))
> BoxPierce(x) ## multivariate test
lags statistic df p-value
5 21.57526 20 0.3639953
10 46.56519 40 0.2203640
15 68.17104 60 0.2192425
20 80.06079 80 0.4770587
25 93.89001 100 0.6531214
30 109.78629 120 0.7374883
> ##
> ##
> ## Annual flow of the river Nile at Aswan - 1871 to 1970
> fit <- arima(Nile, c(1, 0, 1))
> lags <- c(5, 10, 20)
> ## Apply the univariate test statistic on the fitted model
> BoxPierce(fit, lags) ## Correct (no need to specify order)
lags statistic df p-value
5 1.278883 3 0.7341534
10 9.002228 8 0.3421081
20 12.767895 18 0.8051730
> BoxPierce(fit, lags, order = 2) ## Correct
lags statistic df p-value
5 1.278883 3 0.7341534
10 9.002228 8 0.3421081
20 12.767895 18 0.8051730
> ## Apply the test statistic on the residuals and set order = 2
> res <- resid(fit)
> BoxPierce(res, lags) ## Wrong (order is needed!)
lags statistic df p-value
5 1.278883 5 0.9370895
10 9.002228 10 0.5318922
20 12.767895 20 0.8871190
> BoxPierce(res, lags, order = 2) ## Correct
lags statistic df p-value
5 1.278883 3 0.7341534
10 9.002228 8 0.3421081
20 12.767895 18 0.8051730
> ##
> ##
> ## Quarterly, west German investment, income, and consumption from 1960 Q1 to 1982 Q4
> data(WestGerman)
> DiffData <- matrix(numeric(3 * 91), ncol = 3)
> for (i in 1:3)
+ DiffData[, i] <- diff(log(WestGerman[, i]), lag = 1)
> fit <- ar.ols(DiffData, intercept = TRUE, order.max = 2)
> lags <- c(5,10)
> ## Apply the test statistic on the fitted model
> BoxPierce(fit,lags) ## Correct (no need to specify order)
lags statistic df p-value
5 29.13889 27 0.3541968
10 66.82771 72 0.6502032
> ## Apply the test statistic on the residuals where order = 2
> res <- ts((fit$resid)[-(1:2), ])
> BoxPierce(res,lags) ## Wrong (order is needed!)
lags statistic df p-value
5 29.13889 45 0.9678196
10 66.82771 90 0.9679689
> BoxPierce(res,lags,order = 2) ## Correct
lags statistic df p-value
5 29.13889 27 0.3541968
10 66.82771 72 0.6502032
> ##
> ##
> ## Monthly log stock returns of Intel corporation data: Test for ARCH Effects
> monthintel <- as.ts(monthintel)
> BoxPierce(monthintel) ## Usual test
lags statistic df p-value
5 4.666889 5 0.45786938
10 14.364748 10 0.15699489
15 23.120348 15 0.08161787
20 24.000123 20 0.24238680
25 29.617977 25 0.23891229
30 31.943703 30 0.37015020
> BoxPierce(monthintel,squared.residuals=TRUE) ## Test for ARCH effects
lags statistic df p-value
5 40.78073 5 1.039009e-07
10 49.57872 10 3.189915e-07
15 81.90133 15 3.131517e-11
20 86.50575 20 3.006796e-10
25 87.54737 25 7.161478e-09
30 88.55017 30 1.087505e-07
> ##
> ##
> ## Test for seasonality
> ## Accidental Deaths in the US 1973 - 1978
> seasonal.arima <- arima(USAccDeaths, order = c(0,1,1), seasonal = list(order = c(0,1,1)))
> BoxPierce(seasonal.arima, lags = 5, season = 12)
lags statistic df p-value
5 0.5845238 3 0.899966
> ## Quarterly U.K. economic time series from 1957 Q3 to 1967 Q4
> cd <- EconomicUK[,1]
> cd.fit <- arima(cd,order=c(0,1,0),seasonal=list(order=c(0,1,1),period=4))
> BoxPierce(cd.fit, lags = c(5,10), season = 4)
lags statistic df p-value
5 1.307341 4 0.8601288
10 1.918594 9 0.9926904
> ##
> ##
> #### Write a function to fit a model: Apply portmanteau test on fitted obj with class "list"
> ## Example 1
> require("FitAR")
Loading required package: FitAR
Loading required package: lattice
Loading required package: leaps
Loading required package: ltsa
Loading required package: bestglm
Attaching package: ‘FitAR’
The following object is masked from ‘package:forecast’:
BoxCox
> FitModel <- function(data){
+ fit <- FitAR(z=data,p=2)
+ p <- length(fit$phiHat)
+ order <- p
+ res <- fit$res
+ list(res=res,order=order)
+ }
> Fit <- FitModel(Nile)
> BoxPierce(Fit)
lags statistic df p-value
5 1.158604 3 0.7629488
10 9.847560 8 0.2758887
15 13.158988 13 0.4356074
20 15.144813 18 0.6520008
25 16.276022 23 0.8432003
30 19.215107 28 0.8913678
> detach(package:FitAR)
> ##
> ## Example 2
> require("TSA")
Loading required package: TSA
Warning in library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called ‘TSA’
> FitModel <- function(data){
+ fit <- TSA::tar(y=log(data),p1=4,p2=4,d=3,a=0.1,b=0.9,print=FALSE)
+ res <- ts(fit$std.res)
+ p1 <- fit$p1
+ p2 <- fit$p2
+ order <- max(p1, p2)
+ parSpec <- list(res=res,order=order)
+ parSpec
+ }
> data(prey.eq)
Warning in data(prey.eq) : data set ‘prey.eq’ not found
> Fit <- FitModel(prey.eq)
Error in loadNamespace(name) : there is no package called ‘TSA’
Calls: FitModel ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Flavors: r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-patched-solaris-x86