CRAN Package Check Results for Package pcts

Last updated on 2023-11-28 09:52:04 CET.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 0.15.6 37.38 271.89 309.27 OK
r-devel-linux-x86_64-debian-gcc 0.15.7 35.33 200.60 235.93 OK
r-devel-linux-x86_64-fedora-clang 0.15.7 396.96 OK
r-devel-linux-x86_64-fedora-gcc 0.15.7 220.67 OK
r-devel-windows-x86_64 0.15.7 32.00 205.00 237.00 OK
r-patched-linux-x86_64 0.15.6 49.29 265.85 315.14 OK
r-release-linux-x86_64 0.15.7 44.60 265.24 309.84 OK
r-release-macos-arm64 0.15.7 101.00 ERROR
r-release-macos-x86_64 0.15.7 241.00 ERROR
r-release-windows-x86_64 0.15.7 34.00 242.00 276.00 OK
r-oldrel-macos-arm64 0.15.7 96.00 ERROR
r-oldrel-macos-x86_64 0.15.5 129.00 NOTE
r-oldrel-windows-x86_64 0.15.7 40.00 236.00 276.00 OK

Check Details

Version: 0.15.7
Check: examples
Result: ERROR Running examples in ‘pcts-Ex.R’ failed The error most likely occurred in: > ### Name: fitPM > ### Title: Fit periodic time series models > ### Aliases: fitPM fitPM-methods fitPM,ANY,ANY-method > ### fitPM,mcSpec,ANY-method fitPM,numeric,ANY-method > ### fitPM,PeriodicArModel,ANY-method > ### fitPM,PeriodicArModel,PeriodicMTS-method > ### fitPM,PeriodicArModel,PeriodicTS-method > ### fitPM,PiPeriodicArModel,ANY-method fitPM,SiPeriodicArModel,ANY-method > ### Keywords: pcts methods > > ### ** Examples > > ## newm1 <- list(phi = matrix(1:12, nrow=4), p=rep(3,4), period=4, si2 = rep(1,4)) > ## new_pfm1 <- PeriodicFilterModel(newm1, intercept=0) > > ## generate some data; > set.seed(1234) > simts1 <- pcts(rnorm(1024), nseasons = 4) > > fitPM(c(3,3,3,3), simts1) An object of class FittedPeriodicArModel Number of seasons: 4 Mean: -0.06076922 -0.002750496 -0.0114049 -0.05637432 SigmaSq: 1.060891 0.9714497 0.9903078 0.9074826 Periodic order: AR(3,3,3,3) ar1 ar2 ar3 S1 0.11396728 -0.122469184 0.0075900305 S2 -0.00450794 0.083377197 0.0164112748 S3 -0.04491259 -0.005276924 0.0396226884 S4 0.03387766 -0.070385164 0.0001322766 number of obs. for each season: 256 256 256 256 > fitPM(3, simts1) An object of class FittedPeriodicArModel Number of seasons: 4 Mean: -0.06076922 -0.002750496 -0.0114049 -0.05637432 SigmaSq: 1.060891 0.9714497 0.9903078 0.9074826 Periodic order: AR(3,3,3,3) ar1 ar2 ar3 S1 0.11396728 -0.122469184 0.0075900305 S2 -0.00450794 0.083377197 0.0164112748 S3 -0.04491259 -0.005276924 0.0396226884 S4 0.03387766 -0.070385164 0.0001322766 number of obs. for each season: 256 256 256 256 > ## the fit on the underlying data is equivalent. > fitPM(c(3,3,3,3), as.numeric(simts1)) An object of class FittedPeriodicArModel Number of seasons: 4 Mean: -0.06076922 -0.002750496 -0.0114049 -0.05637432 SigmaSq: 1.060891 0.9714497 0.9903078 0.9074826 Periodic order: AR(3,3,3,3) ar1 ar2 ar3 S1 0.11396728 -0.122469184 0.0075900305 S2 -0.00450794 0.083377197 0.0164112748 S3 -0.04491259 -0.005276924 0.0396226884 S4 0.03387766 -0.070385164 0.0001322766 number of obs. for each season: 256 256 256 256 > > ## equivalently, use a PAR(3,3,3,3) model for argument 'model' > ## here the coefficients of pfm1 are ignored, since the estimation is linear. > pfm1 <- PeriodicArModel(matrix(1:12, nrow = 4), order = rep(3,4), sigma2 = 1) > pfm1 An object of class "PeriodicArModel" Number of seasons: 4 Mean: 0 0 0 0 SigmaSq: 1 1 1 1 Periodic order: AR(3,3,3,3) ar1 ar2 ar3 S1 1 5 9 S2 2 6 10 S3 3 7 11 S4 4 8 12 > ## these give same results as above > fitPM(pfm1, simts1) An object of class FittedPeriodicArModel Number of seasons: 4 Mean: -0.06076922 -0.002750496 -0.0114049 -0.05637432 SigmaSq: 1.060891 0.9714497 0.9903078 0.9074826 Periodic order: AR(3,3,3,3) ar1 ar2 ar3 S1 0.11396728 -0.122469184 0.0075900305 S2 -0.00450794 0.083377197 0.0164112748 S3 -0.04491259 -0.005276924 0.0396226884 S4 0.03387766 -0.070385164 0.0001322766 number of obs. for each season: 256 256 256 256 > fitPM(pfm1, as.numeric(simts1)) An object of class FittedPeriodicArModel Number of seasons: 4 Mean: -0.06076922 -0.002750496 -0.0114049 -0.05637432 SigmaSq: 1.060891 0.9714497 0.9903078 0.9074826 Periodic order: AR(3,3,3,3) ar1 ar2 ar3 S1 0.11396728 -0.122469184 0.0075900305 S2 -0.00450794 0.083377197 0.0164112748 S3 -0.04491259 -0.005276924 0.0396226884 S4 0.03387766 -0.070385164 0.0001322766 number of obs. for each season: 256 256 256 256 > > fitPM(c(1,1,1,1), simts1) An object of class FittedPeriodicArModel Number of seasons: 4 Mean: -0.06076922 -0.002750496 -0.0114049 -0.05637432 SigmaSq: 1.075896 0.978132 0.9917217 0.91232 Periodic order: AR(1,1,1,1) ar1 S1 0.108486672 S2 0.001318166 S3 -0.041828251 S4 0.036776157 number of obs. for each season: 256 256 256 256 > fitPM(c(3,2,2,1), simts1) An object of class FittedPeriodicArModel Number of seasons: 4 Mean: -0.06076922 -0.002750496 -0.0114049 -0.05637432 SigmaSq: 1.060947 0.9717132 0.9917187 0.91232 Periodic order: AR(3,2,2,1) ar1 ar2 ar3 S1 0.113395504 -0.122778518 -0.0004315542 S2 -0.006365449 0.084234949 NA S3 -0.041825811 -0.001666751 NA S4 0.036776157 NA NA number of obs. for each season: 256 256 256 256 > fitPM(c(3,2,2,2), simts1) An object of class FittedPeriodicArModel Number of seasons: 4 Mean: -0.06076922 -0.002750496 -0.0114049 -0.05637432 SigmaSq: 1.060891 0.9717132 0.9917187 0.9074826 Periodic order: AR(3,2,2,2) ar1 ar2 ar3 S1 0.113967280 -0.122469184 0.007590031 S2 -0.006365449 0.084234949 NA S3 -0.041825811 -0.001666751 NA S4 0.033877417 -0.070384980 NA number of obs. for each season: 256 256 256 256 > > pdSafeParOrder(c(3,2,2,1)) [1] 3 2 2 2 > pdSafeParOrder(rev(c(3,2,2,1))) [1] 1 2 2 3 > > x <- arima.sim(list(ar = 0.9), n = 960) > pcx <- pcts(x, nseasons = 4) > mx <- matrix(x, nrow = 4) > > ##pc.acf(mx) > ##pc.acf(mx, maxlag=10) > ## TODO: avoid the warning when length ot the time series is not multiple > autocovariances(t(mx), maxlag = 6, nseasons = 4) An object of class "Lagged2d" Slot *data*: Lag_0 Lag_1 Lag_2 Lag_3 Lag_4 Lag_5 Lag_6 4.413696 3.698001 3.444325 3.083434 2.981296 2.740127 2.443547 5.256342 4.480398 3.791234 3.376241 2.959491 2.945734 2.704898 4.544553 4.226788 3.573730 2.787481 2.179323 1.972540 2.118425 4.744290 4.149401 3.620436 3.039397 2.267672 1.595720 1.419777 6.188442 4.913592 4.132992 3.413550 2.893992 1.944995 1.202820 5.079685 5.095852 4.020852 3.462512 2.909262 2.517747 1.724930 4.452634 4.097511 4.466851 3.581613 2.929054 2.568013 2.159905 4.028403 3.766262 3.375314 3.895400 3.027806 2.462040 2.266185 4.256483 3.789805 3.519559 3.181409 3.595804 2.723855 2.312791 5.064014 4.082757 3.780803 3.857862 3.271179 3.849951 2.962659 4.610889 4.241189 3.677709 3.378335 3.220566 2.679142 3.078473 4.492845 4.083564 3.715123 3.132441 2.782178 2.780713 2.430421 4.759835 4.221811 3.785254 3.334577 2.753388 2.379137 2.523684 4.176337 3.914353 3.379820 3.318057 2.895464 2.089529 1.813878 4.256341 3.795704 3.522276 3.120697 3.030260 2.548401 1.864357 4.123065 3.730340 3.387307 3.057720 2.614952 2.406073 2.003338 > autocovariances(t(mx)) An object of class "SampleAutocovariances" , , Lag_0 4.940244 4.425333 3.856613 3.312517 4.425333 4.931782 4.153459 3.576585 3.856613 4.153459 4.586589 4.037720 3.312517 3.576585 4.037720 4.444731 , , Lag_1 3.053109 3.270405 3.765441 4.205794 2.830618 3.009076 3.520014 3.771935 2.262606 2.432067 2.839903 3.242108 1.928944 2.007498 2.285101 2.672126 , , Lag_2 1.754047 1.767143 2.068452 2.409498 1.430174 1.496301 1.828329 2.244051 1.298815 1.204518 1.458011 1.818073 1.238070 1.181317 1.385222 1.602964 , , Lag_3 1.3489948 1.2683819 1.4101905 1.573585 0.9844681 0.8640092 1.0299877 1.269531 0.9647423 0.9969533 0.9680465 1.158972 1.1158544 1.1012862 1.0621654 1.144140 , , Lag_4 1.0681173 1.1595254 1.0799309 1.1913186 0.8013338 0.9328923 0.7987529 0.8834352 0.8382119 0.9644516 0.8820007 0.8776038 0.9012098 1.0414786 1.0527977 0.9306610 , , Lag_5 0.8764845 1.0569533 1.0166630 0.9120474 0.8499661 1.0786949 0.8387545 0.7325839 0.6867834 0.9726713 0.8366954 0.8057214 0.8406734 1.0936087 0.8225248 0.8450239 , , Lag_6 0.9444448 1.1035309 0.8113775 0.8291835 1.1822682 1.2821839 1.0012574 0.8592283 0.8407831 0.8361079 0.6282596 0.6109829 0.8258035 0.7665833 0.6435341 0.6931841 , , Lag_7 0.8689502 0.7994249 0.7699847 0.7690557 1.0024370 0.9676477 0.9242707 0.9797624 0.6284261 0.5784530 0.5320890 0.5642380 0.5484201 0.5434399 0.4715212 0.5167750 , , Lag_8 0.3468684 0.4347957 0.4606310 0.4804946 0.6027137 0.5625705 0.6254156 0.6782344 0.4822539 0.4593642 0.4413930 0.4271425 0.4255004 0.4902419 0.4739370 0.3877285 , , Lag_9 0.2562200 0.3388748 0.2662562 0.2117790 0.3822483 0.4504162 0.3251202 0.3949501 0.1804663 0.3399479 0.2212054 0.3085179 0.1899286 0.3206453 0.1264308 0.1618857 , , Lag_10 0.15180484 0.1875179 -0.03011971 -0.01144414 0.05629723 0.1683812 -0.02502021 0.03307518 -0.08409547 0.1247324 -0.20909008 -0.16511840 -0.07978351 0.1421987 -0.13790670 -0.11767234 , , Lag_11 -0.11875727 0.136673414 -0.12715441 -0.1241331 -0.13047205 0.071926993 -0.12785582 -0.1132037 -0.08908832 -0.009374151 -0.14856401 -0.1563577 -0.04172053 0.093328912 0.04497078 -0.1002592 , , Lag_12 -0.0005362661 0.055885198 -0.06454129 -0.12617478 -0.0837065154 -0.030487010 -0.12492654 -0.05076665 -0.1603845066 -0.092526648 -0.18793024 -0.07192433 -0.0329581327 -0.002391903 -0.07344575 0.04800647 , , Lag_13 0.110795032 0.08497155 -0.10692939 0.039275700 0.067135202 0.08472719 -0.08162884 -0.013675882 0.003970013 0.07475564 -0.12919526 -0.199029101 0.117818973 0.25836952 0.01765533 0.005315572 , , Lag_14 0.2569690 0.4167017 0.1750001 0.099989082 0.2811720 0.3627738 0.2535473 0.142481793 0.2898364 0.3371195 0.1645728 0.008941963 0.2990899 0.3708633 0.1952323 0.025439383 , , Lag_15 0.3366081 0.3613924 0.3104424 0.1448003 0.4606357 0.4791444 0.4525622 0.2297306 0.3597465 0.3331262 0.3165522 0.1907237 0.3781567 0.3046630 0.2260963 0.2302541 , , Lag_16 0.3386886 0.2301517 0.1967166 0.2457013 0.4153102 0.2978708 0.3316045 0.3155847 0.3095268 0.2480752 0.2709355 0.3258925 0.2947141 0.2232702 0.2175240 0.3021335 , , Lag_17 0.3556765 0.2901412 0.2181435 0.3035475 0.3473894 0.3594809 0.3021085 0.3914716 0.3700382 0.4697207 0.3183025 0.4731177 0.2458445 0.4474799 0.2438784 0.4462941 Slot n: [1] 240 Slot varnames: [1] "Series 1" "Series 2" "Series 3" "Series 4" Slot objectname: x > > ##It is an error to have more columns than rows. > ## autocovariances(mx, maxlag = 6, nseasons = 4) > ## autocovariances(mx) > > num2pcpar(mx, c(1,1,1,1), period = 4) $mean [1] 0.2212892 0.2610529 0.2222639 0.1751942 $coef An object of class "slMatrix" Slot "m": lag season 0 1 1 1 -0.9462426 2 1 -0.8957722 3 1 -0.8421822 4 1 -0.8803319 $scale [1] 0.9800724 0.9837131 1.0433693 0.9435026 > num2pcpar(mx, c(3,3,3,3), period = 4) $mean [1] 0.2212892 0.2610529 0.2222639 0.1751942 $coef An object of class "slMatrix" Slot "m": lag season 0 1 2 3 1 1 -0.9962631 0.009726434 0.05118143 2 1 -0.9003005 0.144883523 -0.15588601 3 1 -0.7223822 -0.177308198 0.05138492 4 1 -0.9444632 0.052370207 0.01986882 $scale [1] 0.9768186 0.9723284 1.0339197 0.9404123 > > sipfm1 <- new("SiPeriodicArModel", iorder = 1, siorder = 1, pcmodel = pfm1) > sipfm1 An object of class "SiPeriodicArModel" iorder: 1, siorder: 1 PAR part of the model, An object of class "PeriodicArModel" Number of seasons: 4 Mean: 0 0 0 0 SigmaSq: 1 1 1 1 Periodic order: AR(3,3,3,3) ar1 ar2 ar3 S1 1 5 9 S2 2 6 10 S3 3 7 11 S4 4 8 12 > fitPM(sipfm1, mx) An object of class "SiPeriodicArModel" iorder: 1, siorder: 1 PAR part of the model, An object of class FittedPeriodicArModel Number of seasons: 4 Mean: 0 0 0 0 SigmaSq: 1.900178 2.014823 2.512701 1.919159 Periodic order: AR(3,3,3,3) ar1 ar2 ar3 S1 0.03633172 0.02831852 0.02492281 S2 -0.02263934 -0.21176922 0.09351833 S3 -0.17347841 0.01862405 0.13451737 S4 0.02770379 0.11071311 0.07843985 number of obs. for each season: 238 238 238 238 > pfm1 An object of class "PeriodicArModel" Number of seasons: 4 Mean: 0 0 0 0 SigmaSq: 1 1 1 1 Periodic order: AR(3,3,3,3) ar1 ar2 ar3 S1 1 5 9 S2 2 6 10 S3 3 7 11 S4 4 8 12 > > > ## experiments and testing > fit1 <- fitPM(c(3,3,3,3), simts1) > fit1_mf <- new("MultiFilter", coef = fit1@ar@coef) > vs <- mcompanion::mf_VSform(fit1_mf, form = "I") > tmp <- mcompanion::VAR2pcfilter(vs$Phi[ , -4], + Phi0inv = vs$Phi0inv, D = fit1@sigma2, what = "") > names(tmp) # "pcfilter" "var" "Uform" [1] "pcfilter" "var" "Uform" > tmp$var [1] 0.9074826 0.9903078 0.9714497 1.0608910 > zapsmall(tmp$pcfilter) [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.11396728 -0.12246918 0.00759003 0 0 0 [2,] -0.00450794 0.08337720 0.01641127 0 0 0 [3,] -0.04491259 -0.00527692 0.03962269 0 0 0 [4,] 0.03387766 -0.07038516 0.00013228 0 0 0 > fit1@ar@coef lag season 1 2 3 1 0.11396728 -0.122469184 0.0075900305 2 -0.00450794 0.083377197 0.0164112748 3 -0.04491259 -0.005276924 0.0396226884 4 0.03387766 -0.070385164 0.0001322766 > all.equal(tmp$pcfilter[ , 1:3], fit1@ar@coef, check.attributes = FALSE) # TRUE [1] TRUE > tmp$Uform $Sigma [1] 1.0608910 0.9714497 0.9903078 0.9074826 $U0 [,1] [,2] [,3] [,4] [1,] 1 -0.03387766 0.07038516 -0.0001322766 [2,] 0 1.00000000 0.04491259 0.0052769241 [3,] 0 0.00000000 1.00000000 0.0045079396 [4,] 0 0.00000000 0.00000000 1.0000000000 $U [,1] [,2] [,3] [1,] -1.829718e-19 6.802028e-20 -3.263662e-22 [2,] 3.962269e-02 4.045944e-20 2.495333e-21 [3,] 8.337720e-02 1.641127e-02 -1.224348e-21 [4,] 1.139673e-01 -1.224692e-01 7.590031e-03 $U0inv [,1] [,2] [,3] [,4] [1,] 1 0.03387766 -0.07190670 0.0002776578 [2,] 0 1.00000000 -0.04491259 -0.0050744608 [3,] 0 0.00000000 1.00000000 -0.0045079396 [4,] 0 0.00000000 0.00000000 1.0000000000 $perm [1] 4 3 2 1 > fit1@sigma2 [1] 1.0608910 0.9714497 0.9903078 0.9074826 > > ## both give the matrix Sigma for the "I" form > identical( + vs$Phi0inv %*% diag(fit1@sigma2) %*% t(vs$Phi0inv) + , + tmp$Uform$U0inv %*% diag(tmp$Uform$Sigma) %*% t(tmp$Uform$U0inv) + ) # TRUE [1] TRUE > > ## no, this is a different matrix > var1_mat <- cbind(vs$Phi0, # identity matrix + - vs$Phi) # drop trailing zero columns? > var1_mat <- mcompanion::mCompanion(var1_mat) > var1_Sigma <- vs$Phi0inv %*% diag(fit1@sigma2) %*% t(vs$Phi0inv) > abs(eigen(diag(nrow(var1_mat)) - var1_mat)$values) Error in getClassDef(x@superClass, package = packageSlot(x))@virtual : no applicable method for `@` applied to an object of class "NULL" Calls: eigen ... .selectSuperClasses -> vapply -> FUN -> isVirtualExt Execution halted Flavor: r-release-macos-arm64

Version: 0.15.7
Check: examples
Result: ERROR Running examples in ‘pcts-Ex.R’ failed The error most likely occurred in: > ### Name: fitPM > ### Title: Fit periodic time series models > ### Aliases: fitPM fitPM-methods fitPM,ANY,ANY-method > ### fitPM,mcSpec,ANY-method fitPM,numeric,ANY-method > ### fitPM,PeriodicArModel,ANY-method > ### fitPM,PeriodicArModel,PeriodicMTS-method > ### fitPM,PeriodicArModel,PeriodicTS-method > ### fitPM,PiPeriodicArModel,ANY-method fitPM,SiPeriodicArModel,ANY-method > ### Keywords: pcts methods > > ### ** Examples > > ## newm1 <- list(phi = matrix(1:12, nrow=4), p=rep(3,4), period=4, si2 = rep(1,4)) > ## new_pfm1 <- PeriodicFilterModel(newm1, intercept=0) > > ## generate some data; > set.seed(1234) > simts1 <- pcts(rnorm(1024), nseasons = 4) > > fitPM(c(3,3,3,3), simts1) An object of class FittedPeriodicArModel Number of seasons: 4 Mean: -0.06076922 -0.002750496 -0.0114049 -0.05637432 SigmaSq: 1.060891 0.9714497 0.9903078 0.9074826 Periodic order: AR(3,3,3,3) ar1 ar2 ar3 S1 0.11396728 -0.122469184 0.0075900305 S2 -0.00450794 0.083377197 0.0164112748 S3 -0.04491259 -0.005276924 0.0396226884 S4 0.03387766 -0.070385164 0.0001322766 number of obs. for each season: 256 256 256 256 > fitPM(3, simts1) An object of class FittedPeriodicArModel Number of seasons: 4 Mean: -0.06076922 -0.002750496 -0.0114049 -0.05637432 SigmaSq: 1.060891 0.9714497 0.9903078 0.9074826 Periodic order: AR(3,3,3,3) ar1 ar2 ar3 S1 0.11396728 -0.122469184 0.0075900305 S2 -0.00450794 0.083377197 0.0164112748 S3 -0.04491259 -0.005276924 0.0396226884 S4 0.03387766 -0.070385164 0.0001322766 number of obs. for each season: 256 256 256 256 > ## the fit on the underlying data is equivalent. > fitPM(c(3,3,3,3), as.numeric(simts1)) An object of class FittedPeriodicArModel Number of seasons: 4 Mean: -0.06076922 -0.002750496 -0.0114049 -0.05637432 SigmaSq: 1.060891 0.9714497 0.9903078 0.9074826 Periodic order: AR(3,3,3,3) ar1 ar2 ar3 S1 0.11396728 -0.122469184 0.0075900305 S2 -0.00450794 0.083377197 0.0164112748 S3 -0.04491259 -0.005276924 0.0396226884 S4 0.03387766 -0.070385164 0.0001322766 number of obs. for each season: 256 256 256 256 > > ## equivalently, use a PAR(3,3,3,3) model for argument 'model' > ## here the coefficients of pfm1 are ignored, since the estimation is linear. > pfm1 <- PeriodicArModel(matrix(1:12, nrow = 4), order = rep(3,4), sigma2 = 1) > pfm1 An object of class "PeriodicArModel" Number of seasons: 4 Mean: 0 0 0 0 SigmaSq: 1 1 1 1 Periodic order: AR(3,3,3,3) ar1 ar2 ar3 S1 1 5 9 S2 2 6 10 S3 3 7 11 S4 4 8 12 > ## these give same results as above > fitPM(pfm1, simts1) An object of class FittedPeriodicArModel Number of seasons: 4 Mean: -0.06076922 -0.002750496 -0.0114049 -0.05637432 SigmaSq: 1.060891 0.9714497 0.9903078 0.9074826 Periodic order: AR(3,3,3,3) ar1 ar2 ar3 S1 0.11396728 -0.122469184 0.0075900305 S2 -0.00450794 0.083377197 0.0164112748 S3 -0.04491259 -0.005276924 0.0396226884 S4 0.03387766 -0.070385164 0.0001322766 number of obs. for each season: 256 256 256 256 > fitPM(pfm1, as.numeric(simts1)) An object of class FittedPeriodicArModel Number of seasons: 4 Mean: -0.06076922 -0.002750496 -0.0114049 -0.05637432 SigmaSq: 1.060891 0.9714497 0.9903078 0.9074826 Periodic order: AR(3,3,3,3) ar1 ar2 ar3 S1 0.11396728 -0.122469184 0.0075900305 S2 -0.00450794 0.083377197 0.0164112748 S3 -0.04491259 -0.005276924 0.0396226884 S4 0.03387766 -0.070385164 0.0001322766 number of obs. for each season: 256 256 256 256 > > fitPM(c(1,1,1,1), simts1) An object of class FittedPeriodicArModel Number of seasons: 4 Mean: -0.06076922 -0.002750496 -0.0114049 -0.05637432 SigmaSq: 1.075896 0.978132 0.9917217 0.91232 Periodic order: AR(1,1,1,1) ar1 S1 0.108486672 S2 0.001318166 S3 -0.041828251 S4 0.036776157 number of obs. for each season: 256 256 256 256 > fitPM(c(3,2,2,1), simts1) An object of class FittedPeriodicArModel Number of seasons: 4 Mean: -0.06076922 -0.002750496 -0.0114049 -0.05637432 SigmaSq: 1.060947 0.9717132 0.9917187 0.91232 Periodic order: AR(3,2,2,1) ar1 ar2 ar3 S1 0.113395504 -0.122778518 -0.0004315542 S2 -0.006365449 0.084234949 NA S3 -0.041825811 -0.001666751 NA S4 0.036776157 NA NA number of obs. for each season: 256 256 256 256 > fitPM(c(3,2,2,2), simts1) An object of class FittedPeriodicArModel Number of seasons: 4 Mean: -0.06076922 -0.002750496 -0.0114049 -0.05637432 SigmaSq: 1.060891 0.9717132 0.9917187 0.9074826 Periodic order: AR(3,2,2,2) ar1 ar2 ar3 S1 0.113967280 -0.122469184 0.007590031 S2 -0.006365449 0.084234949 NA S3 -0.041825811 -0.001666751 NA S4 0.033877417 -0.070384980 NA number of obs. for each season: 256 256 256 256 > > pdSafeParOrder(c(3,2,2,1)) [1] 3 2 2 2 > pdSafeParOrder(rev(c(3,2,2,1))) [1] 1 2 2 3 > > x <- arima.sim(list(ar = 0.9), n = 960) > pcx <- pcts(x, nseasons = 4) > mx <- matrix(x, nrow = 4) > > ##pc.acf(mx) > ##pc.acf(mx, maxlag=10) > ## TODO: avoid the warning when length ot the time series is not multiple > autocovariances(t(mx), maxlag = 6, nseasons = 4) An object of class "Lagged2d" Slot *data*: Lag_0 Lag_1 Lag_2 Lag_3 Lag_4 Lag_5 Lag_6 4.413696 3.698001 3.444325 3.083434 2.981296 2.740127 2.443547 5.256342 4.480398 3.791234 3.376241 2.959491 2.945734 2.704898 4.544553 4.226788 3.573730 2.787481 2.179323 1.972540 2.118425 4.744290 4.149401 3.620436 3.039397 2.267672 1.595720 1.419777 6.188442 4.913592 4.132992 3.413550 2.893992 1.944995 1.202820 5.079685 5.095852 4.020852 3.462512 2.909262 2.517747 1.724930 4.452634 4.097511 4.466851 3.581613 2.929054 2.568013 2.159905 4.028403 3.766262 3.375314 3.895400 3.027806 2.462040 2.266185 4.256483 3.789805 3.519559 3.181409 3.595804 2.723855 2.312791 5.064014 4.082757 3.780803 3.857862 3.271179 3.849951 2.962659 4.610889 4.241189 3.677709 3.378335 3.220566 2.679142 3.078473 4.492845 4.083564 3.715123 3.132441 2.782178 2.780713 2.430421 4.759835 4.221811 3.785254 3.334577 2.753388 2.379137 2.523684 4.176337 3.914353 3.379820 3.318057 2.895464 2.089529 1.813878 4.256341 3.795704 3.522276 3.120697 3.030260 2.548401 1.864357 4.123065 3.730340 3.387307 3.057720 2.614952 2.406073 2.003338 > autocovariances(t(mx)) An object of class "SampleAutocovariances" , , Lag_0 4.940244 4.425333 3.856613 3.312517 4.425333 4.931782 4.153459 3.576585 3.856613 4.153459 4.586589 4.037720 3.312517 3.576585 4.037720 4.444731 , , Lag_1 3.053109 3.270405 3.765441 4.205794 2.830618 3.009076 3.520014 3.771935 2.262606 2.432067 2.839903 3.242108 1.928944 2.007498 2.285101 2.672126 , , Lag_2 1.754047 1.767143 2.068452 2.409498 1.430174 1.496301 1.828329 2.244051 1.298815 1.204518 1.458011 1.818073 1.238070 1.181317 1.385222 1.602964 , , Lag_3 1.3489948 1.2683819 1.4101905 1.573585 0.9844681 0.8640092 1.0299877 1.269531 0.9647423 0.9969533 0.9680465 1.158972 1.1158544 1.1012862 1.0621654 1.144140 , , Lag_4 1.0681173 1.1595254 1.0799309 1.1913186 0.8013338 0.9328923 0.7987529 0.8834352 0.8382119 0.9644516 0.8820007 0.8776038 0.9012098 1.0414786 1.0527977 0.9306610 , , Lag_5 0.8764845 1.0569533 1.0166630 0.9120474 0.8499661 1.0786949 0.8387545 0.7325839 0.6867834 0.9726713 0.8366954 0.8057214 0.8406734 1.0936087 0.8225248 0.8450239 , , Lag_6 0.9444448 1.1035309 0.8113775 0.8291835 1.1822682 1.2821839 1.0012574 0.8592283 0.8407831 0.8361079 0.6282596 0.6109829 0.8258035 0.7665833 0.6435341 0.6931841 , , Lag_7 0.8689502 0.7994249 0.7699847 0.7690557 1.0024370 0.9676477 0.9242707 0.9797624 0.6284261 0.5784530 0.5320890 0.5642380 0.5484201 0.5434399 0.4715212 0.5167750 , , Lag_8 0.3468684 0.4347957 0.4606310 0.4804946 0.6027137 0.5625705 0.6254156 0.6782344 0.4822539 0.4593642 0.4413930 0.4271425 0.4255004 0.4902419 0.4739370 0.3877285 , , Lag_9 0.2562200 0.3388748 0.2662562 0.2117790 0.3822483 0.4504162 0.3251202 0.3949501 0.1804663 0.3399479 0.2212054 0.3085179 0.1899286 0.3206453 0.1264308 0.1618857 , , Lag_10 0.15180484 0.1875179 -0.03011971 -0.01144414 0.05629723 0.1683812 -0.02502021 0.03307518 -0.08409547 0.1247324 -0.20909008 -0.16511840 -0.07978351 0.1421987 -0.13790670 -0.11767234 , , Lag_11 -0.11875727 0.136673414 -0.12715441 -0.1241331 -0.13047205 0.071926993 -0.12785582 -0.1132037 -0.08908832 -0.009374151 -0.14856401 -0.1563577 -0.04172053 0.093328912 0.04497078 -0.1002592 , , Lag_12 -0.0005362661 0.055885198 -0.06454129 -0.12617478 -0.0837065154 -0.030487010 -0.12492654 -0.05076665 -0.1603845066 -0.092526648 -0.18793024 -0.07192433 -0.0329581327 -0.002391903 -0.07344575 0.04800647 , , Lag_13 0.110795032 0.08497155 -0.10692939 0.039275700 0.067135202 0.08472719 -0.08162884 -0.013675882 0.003970013 0.07475564 -0.12919526 -0.199029101 0.117818973 0.25836952 0.01765533 0.005315572 , , Lag_14 0.2569690 0.4167017 0.1750001 0.099989082 0.2811720 0.3627738 0.2535473 0.142481793 0.2898364 0.3371195 0.1645728 0.008941963 0.2990899 0.3708633 0.1952323 0.025439383 , , Lag_15 0.3366081 0.3613924 0.3104424 0.1448003 0.4606357 0.4791444 0.4525622 0.2297306 0.3597465 0.3331262 0.3165522 0.1907237 0.3781567 0.3046630 0.2260963 0.2302541 , , Lag_16 0.3386886 0.2301517 0.1967166 0.2457013 0.4153102 0.2978708 0.3316045 0.3155847 0.3095268 0.2480752 0.2709355 0.3258925 0.2947141 0.2232702 0.2175240 0.3021335 , , Lag_17 0.3556765 0.2901412 0.2181435 0.3035475 0.3473894 0.3594809 0.3021085 0.3914716 0.3700382 0.4697207 0.3183025 0.4731177 0.2458445 0.4474799 0.2438784 0.4462941 Slot n: [1] 240 Slot varnames: [1] "Series 1" "Series 2" "Series 3" "Series 4" Slot objectname: x > > ##It is an error to have more columns than rows. > ## autocovariances(mx, maxlag = 6, nseasons = 4) > ## autocovariances(mx) > > num2pcpar(mx, c(1,1,1,1), period = 4) $mean [1] 0.2212892 0.2610529 0.2222639 0.1751942 $coef An object of class "slMatrix" Slot "m": lag season 0 1 1 1 -0.9462426 2 1 -0.8957722 3 1 -0.8421822 4 1 -0.8803319 $scale [1] 0.9800724 0.9837131 1.0433693 0.9435026 > num2pcpar(mx, c(3,3,3,3), period = 4) $mean [1] 0.2212892 0.2610529 0.2222639 0.1751942 $coef An object of class "slMatrix" Slot "m": lag season 0 1 2 3 1 1 -0.9962631 0.009726434 0.05118143 2 1 -0.9003005 0.144883523 -0.15588601 3 1 -0.7223822 -0.177308198 0.05138492 4 1 -0.9444632 0.052370207 0.01986882 $scale [1] 0.9768186 0.9723284 1.0339197 0.9404123 > > sipfm1 <- new("SiPeriodicArModel", iorder = 1, siorder = 1, pcmodel = pfm1) > sipfm1 An object of class "SiPeriodicArModel" iorder: 1, siorder: 1 PAR part of the model, An object of class "PeriodicArModel" Number of seasons: 4 Mean: 0 0 0 0 SigmaSq: 1 1 1 1 Periodic order: AR(3,3,3,3) ar1 ar2 ar3 S1 1 5 9 S2 2 6 10 S3 3 7 11 S4 4 8 12 > fitPM(sipfm1, mx) An object of class "SiPeriodicArModel" iorder: 1, siorder: 1 PAR part of the model, An object of class FittedPeriodicArModel Number of seasons: 4 Mean: 0 0 0 0 SigmaSq: 1.900178 2.014823 2.512701 1.919159 Periodic order: AR(3,3,3,3) ar1 ar2 ar3 S1 0.03633172 0.02831852 0.02492281 S2 -0.02263934 -0.21176922 0.09351833 S3 -0.17347841 0.01862405 0.13451737 S4 0.02770379 0.11071311 0.07843985 number of obs. for each season: 238 238 238 238 > pfm1 An object of class "PeriodicArModel" Number of seasons: 4 Mean: 0 0 0 0 SigmaSq: 1 1 1 1 Periodic order: AR(3,3,3,3) ar1 ar2 ar3 S1 1 5 9 S2 2 6 10 S3 3 7 11 S4 4 8 12 > > > ## experiments and testing > fit1 <- fitPM(c(3,3,3,3), simts1) > fit1_mf <- new("MultiFilter", coef = fit1@ar@coef) > vs <- mcompanion::mf_VSform(fit1_mf, form = "I") > tmp <- mcompanion::VAR2pcfilter(vs$Phi[ , -4], + Phi0inv = vs$Phi0inv, D = fit1@sigma2, what = "") > names(tmp) # "pcfilter" "var" "Uform" [1] "pcfilter" "var" "Uform" > tmp$var [1] 0.9074826 0.9903078 0.9714497 1.0608910 > zapsmall(tmp$pcfilter) [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.11396728 -0.12246918 0.00759003 0 0 0 [2,] -0.00450794 0.08337720 0.01641127 0 0 0 [3,] -0.04491259 -0.00527692 0.03962269 0 0 0 [4,] 0.03387766 -0.07038516 0.00013228 0 0 0 > fit1@ar@coef lag season 1 2 3 1 0.11396728 -0.122469184 0.0075900305 2 -0.00450794 0.083377197 0.0164112748 3 -0.04491259 -0.005276924 0.0396226884 4 0.03387766 -0.070385164 0.0001322766 > all.equal(tmp$pcfilter[ , 1:3], fit1@ar@coef, check.attributes = FALSE) # TRUE [1] TRUE > tmp$Uform $Sigma [1] 1.0608910 0.9714497 0.9903078 0.9074826 $U0 [,1] [,2] [,3] [,4] [1,] 1 -0.03387766 0.07038516 -0.0001322766 [2,] 0 1.00000000 0.04491259 0.0052769241 [3,] 0 0.00000000 1.00000000 0.0045079396 [4,] 0 0.00000000 0.00000000 1.0000000000 $U [,1] [,2] [,3] [1,] 1.224810e-18 7.453890e-20 -2.117582e-22 [2,] 3.962269e-02 0.000000e+00 -6.776264e-21 [3,] 8.337720e-02 1.641127e-02 0.000000e+00 [4,] 1.139673e-01 -1.224692e-01 7.590031e-03 $U0inv [,1] [,2] [,3] [,4] [1,] 1 0.03387766 -0.07190670 0.0002776578 [2,] 0 1.00000000 -0.04491259 -0.0050744608 [3,] 0 0.00000000 1.00000000 -0.0045079396 [4,] 0 0.00000000 0.00000000 1.0000000000 $perm [1] 4 3 2 1 > fit1@sigma2 [1] 1.0608910 0.9714497 0.9903078 0.9074826 > > ## both give the matrix Sigma for the "I" form > identical( + vs$Phi0inv %*% diag(fit1@sigma2) %*% t(vs$Phi0inv) + , + tmp$Uform$U0inv %*% diag(tmp$Uform$Sigma) %*% t(tmp$Uform$U0inv) + ) # TRUE [1] TRUE > > ## no, this is a different matrix > var1_mat <- cbind(vs$Phi0, # identity matrix + - vs$Phi) # drop trailing zero columns? > var1_mat <- mcompanion::mCompanion(var1_mat) > var1_Sigma <- vs$Phi0inv %*% diag(fit1@sigma2) %*% t(vs$Phi0inv) > abs(eigen(diag(nrow(var1_mat)) - var1_mat)$values) Error in getClassDef(x@superClass, package = packageSlot(x))@virtual : no applicable method for `@` applied to an object of class "NULL" Calls: eigen ... .selectSuperClasses -> vapply -> FUN -> isVirtualExt Execution halted Flavor: r-release-macos-x86_64

Version: 0.15.7
Check: examples
Result: ERROR Running examples in ‘pcts-Ex.R’ failed The error most likely occurred in: > ### Name: fitPM > ### Title: Fit periodic time series models > ### Aliases: fitPM fitPM-methods fitPM,ANY,ANY-method > ### fitPM,mcSpec,ANY-method fitPM,numeric,ANY-method > ### fitPM,PeriodicArModel,ANY-method > ### fitPM,PeriodicArModel,PeriodicMTS-method > ### fitPM,PeriodicArModel,PeriodicTS-method > ### fitPM,PiPeriodicArModel,ANY-method fitPM,SiPeriodicArModel,ANY-method > ### Keywords: pcts methods > > ### ** Examples > > ## newm1 <- list(phi = matrix(1:12, nrow=4), p=rep(3,4), period=4, si2 = rep(1,4)) > ## new_pfm1 <- PeriodicFilterModel(newm1, intercept=0) > > ## generate some data; > set.seed(1234) > simts1 <- pcts(rnorm(1024), nseasons = 4) > > fitPM(c(3,3,3,3), simts1) An object of class FittedPeriodicArModel Number of seasons: 4 Mean: -0.06076922 -0.002750496 -0.0114049 -0.05637432 SigmaSq: 1.060891 0.9714497 0.9903078 0.9074826 Periodic order: AR(3,3,3,3) ar1 ar2 ar3 S1 0.11396728 -0.122469184 0.0075900305 S2 -0.00450794 0.083377197 0.0164112748 S3 -0.04491259 -0.005276924 0.0396226884 S4 0.03387766 -0.070385164 0.0001322766 number of obs. for each season: 256 256 256 256 > fitPM(3, simts1) An object of class FittedPeriodicArModel Number of seasons: 4 Mean: -0.06076922 -0.002750496 -0.0114049 -0.05637432 SigmaSq: 1.060891 0.9714497 0.9903078 0.9074826 Periodic order: AR(3,3,3,3) ar1 ar2 ar3 S1 0.11396728 -0.122469184 0.0075900305 S2 -0.00450794 0.083377197 0.0164112748 S3 -0.04491259 -0.005276924 0.0396226884 S4 0.03387766 -0.070385164 0.0001322766 number of obs. for each season: 256 256 256 256 > ## the fit on the underlying data is equivalent. > fitPM(c(3,3,3,3), as.numeric(simts1)) An object of class FittedPeriodicArModel Number of seasons: 4 Mean: -0.06076922 -0.002750496 -0.0114049 -0.05637432 SigmaSq: 1.060891 0.9714497 0.9903078 0.9074826 Periodic order: AR(3,3,3,3) ar1 ar2 ar3 S1 0.11396728 -0.122469184 0.0075900305 S2 -0.00450794 0.083377197 0.0164112748 S3 -0.04491259 -0.005276924 0.0396226884 S4 0.03387766 -0.070385164 0.0001322766 number of obs. for each season: 256 256 256 256 > > ## equivalently, use a PAR(3,3,3,3) model for argument 'model' > ## here the coefficients of pfm1 are ignored, since the estimation is linear. > pfm1 <- PeriodicArModel(matrix(1:12, nrow = 4), order = rep(3,4), sigma2 = 1) > pfm1 An object of class "PeriodicArModel" Number of seasons: 4 Mean: 0 0 0 0 SigmaSq: 1 1 1 1 Periodic order: AR(3,3,3,3) ar1 ar2 ar3 S1 1 5 9 S2 2 6 10 S3 3 7 11 S4 4 8 12 > ## these give same results as above > fitPM(pfm1, simts1) An object of class FittedPeriodicArModel Number of seasons: 4 Mean: -0.06076922 -0.002750496 -0.0114049 -0.05637432 SigmaSq: 1.060891 0.9714497 0.9903078 0.9074826 Periodic order: AR(3,3,3,3) ar1 ar2 ar3 S1 0.11396728 -0.122469184 0.0075900305 S2 -0.00450794 0.083377197 0.0164112748 S3 -0.04491259 -0.005276924 0.0396226884 S4 0.03387766 -0.070385164 0.0001322766 number of obs. for each season: 256 256 256 256 > fitPM(pfm1, as.numeric(simts1)) An object of class FittedPeriodicArModel Number of seasons: 4 Mean: -0.06076922 -0.002750496 -0.0114049 -0.05637432 SigmaSq: 1.060891 0.9714497 0.9903078 0.9074826 Periodic order: AR(3,3,3,3) ar1 ar2 ar3 S1 0.11396728 -0.122469184 0.0075900305 S2 -0.00450794 0.083377197 0.0164112748 S3 -0.04491259 -0.005276924 0.0396226884 S4 0.03387766 -0.070385164 0.0001322766 number of obs. for each season: 256 256 256 256 > > fitPM(c(1,1,1,1), simts1) An object of class FittedPeriodicArModel Number of seasons: 4 Mean: -0.06076922 -0.002750496 -0.0114049 -0.05637432 SigmaSq: 1.075896 0.978132 0.9917217 0.91232 Periodic order: AR(1,1,1,1) ar1 S1 0.108486672 S2 0.001318166 S3 -0.041828251 S4 0.036776157 number of obs. for each season: 256 256 256 256 > fitPM(c(3,2,2,1), simts1) An object of class FittedPeriodicArModel Number of seasons: 4 Mean: -0.06076922 -0.002750496 -0.0114049 -0.05637432 SigmaSq: 1.060947 0.9717132 0.9917187 0.91232 Periodic order: AR(3,2,2,1) ar1 ar2 ar3 S1 0.113395504 -0.122778518 -0.0004315542 S2 -0.006365449 0.084234949 NA S3 -0.041825811 -0.001666751 NA S4 0.036776157 NA NA number of obs. for each season: 256 256 256 256 > fitPM(c(3,2,2,2), simts1) An object of class FittedPeriodicArModel Number of seasons: 4 Mean: -0.06076922 -0.002750496 -0.0114049 -0.05637432 SigmaSq: 1.060891 0.9717132 0.9917187 0.9074826 Periodic order: AR(3,2,2,2) ar1 ar2 ar3 S1 0.113967280 -0.122469184 0.007590031 S2 -0.006365449 0.084234949 NA S3 -0.041825811 -0.001666751 NA S4 0.033877417 -0.070384980 NA number of obs. for each season: 256 256 256 256 > > pdSafeParOrder(c(3,2,2,1)) [1] 3 2 2 2 > pdSafeParOrder(rev(c(3,2,2,1))) [1] 1 2 2 3 > > x <- arima.sim(list(ar = 0.9), n = 960) > pcx <- pcts(x, nseasons = 4) > mx <- matrix(x, nrow = 4) > > ##pc.acf(mx) > ##pc.acf(mx, maxlag=10) > ## TODO: avoid the warning when length ot the time series is not multiple > autocovariances(t(mx), maxlag = 6, nseasons = 4) An object of class "Lagged2d" Slot *data*: Lag_0 Lag_1 Lag_2 Lag_3 Lag_4 Lag_5 Lag_6 4.413696 3.698001 3.444325 3.083434 2.981296 2.740127 2.443547 5.256342 4.480398 3.791234 3.376241 2.959491 2.945734 2.704898 4.544553 4.226788 3.573730 2.787481 2.179323 1.972540 2.118425 4.744290 4.149401 3.620436 3.039397 2.267672 1.595720 1.419777 6.188442 4.913592 4.132992 3.413550 2.893992 1.944995 1.202820 5.079685 5.095852 4.020852 3.462512 2.909262 2.517747 1.724930 4.452634 4.097511 4.466851 3.581613 2.929054 2.568013 2.159905 4.028403 3.766262 3.375314 3.895400 3.027806 2.462040 2.266185 4.256483 3.789805 3.519559 3.181409 3.595804 2.723855 2.312791 5.064014 4.082757 3.780803 3.857862 3.271179 3.849951 2.962659 4.610889 4.241189 3.677709 3.378335 3.220566 2.679142 3.078473 4.492845 4.083564 3.715123 3.132441 2.782178 2.780713 2.430421 4.759835 4.221811 3.785254 3.334577 2.753388 2.379137 2.523684 4.176337 3.914353 3.379820 3.318057 2.895464 2.089529 1.813878 4.256341 3.795704 3.522276 3.120697 3.030260 2.548401 1.864357 4.123065 3.730340 3.387307 3.057720 2.614952 2.406073 2.003338 > autocovariances(t(mx)) An object of class "SampleAutocovariances" , , Lag_0 4.940244 4.425333 3.856613 3.312517 4.425333 4.931782 4.153459 3.576585 3.856613 4.153459 4.586589 4.037720 3.312517 3.576585 4.037720 4.444731 , , Lag_1 3.053109 3.270405 3.765441 4.205794 2.830618 3.009076 3.520014 3.771935 2.262606 2.432067 2.839903 3.242108 1.928944 2.007498 2.285101 2.672126 , , Lag_2 1.754047 1.767143 2.068452 2.409498 1.430174 1.496301 1.828329 2.244051 1.298815 1.204518 1.458011 1.818073 1.238070 1.181317 1.385222 1.602964 , , Lag_3 1.3489948 1.2683819 1.4101905 1.573585 0.9844681 0.8640092 1.0299877 1.269531 0.9647423 0.9969533 0.9680465 1.158972 1.1158544 1.1012862 1.0621654 1.144140 , , Lag_4 1.0681173 1.1595254 1.0799309 1.1913186 0.8013338 0.9328923 0.7987529 0.8834352 0.8382119 0.9644516 0.8820007 0.8776038 0.9012098 1.0414786 1.0527977 0.9306610 , , Lag_5 0.8764845 1.0569533 1.0166630 0.9120474 0.8499661 1.0786949 0.8387545 0.7325839 0.6867834 0.9726713 0.8366954 0.8057214 0.8406734 1.0936087 0.8225248 0.8450239 , , Lag_6 0.9444448 1.1035309 0.8113775 0.8291835 1.1822682 1.2821839 1.0012574 0.8592283 0.8407831 0.8361079 0.6282596 0.6109829 0.8258035 0.7665833 0.6435341 0.6931841 , , Lag_7 0.8689502 0.7994249 0.7699847 0.7690557 1.0024370 0.9676477 0.9242707 0.9797624 0.6284261 0.5784530 0.5320890 0.5642380 0.5484201 0.5434399 0.4715212 0.5167750 , , Lag_8 0.3468684 0.4347957 0.4606310 0.4804946 0.6027137 0.5625705 0.6254156 0.6782344 0.4822539 0.4593642 0.4413930 0.4271425 0.4255004 0.4902419 0.4739370 0.3877285 , , Lag_9 0.2562200 0.3388748 0.2662562 0.2117790 0.3822483 0.4504162 0.3251202 0.3949501 0.1804663 0.3399479 0.2212054 0.3085179 0.1899286 0.3206453 0.1264308 0.1618857 , , Lag_10 0.15180484 0.1875179 -0.03011971 -0.01144414 0.05629723 0.1683812 -0.02502021 0.03307518 -0.08409547 0.1247324 -0.20909008 -0.16511840 -0.07978351 0.1421987 -0.13790670 -0.11767234 , , Lag_11 -0.11875727 0.136673414 -0.12715441 -0.1241331 -0.13047205 0.071926993 -0.12785582 -0.1132037 -0.08908832 -0.009374151 -0.14856401 -0.1563577 -0.04172053 0.093328912 0.04497078 -0.1002592 , , Lag_12 -0.0005362661 0.055885198 -0.06454129 -0.12617478 -0.0837065154 -0.030487010 -0.12492654 -0.05076665 -0.1603845066 -0.092526648 -0.18793024 -0.07192433 -0.0329581327 -0.002391903 -0.07344575 0.04800647 , , Lag_13 0.110795032 0.08497155 -0.10692939 0.039275700 0.067135202 0.08472719 -0.08162884 -0.013675882 0.003970013 0.07475564 -0.12919526 -0.199029101 0.117818973 0.25836952 0.01765533 0.005315572 , , Lag_14 0.2569690 0.4167017 0.1750001 0.099989082 0.2811720 0.3627738 0.2535473 0.142481793 0.2898364 0.3371195 0.1645728 0.008941963 0.2990899 0.3708633 0.1952323 0.025439383 , , Lag_15 0.3366081 0.3613924 0.3104424 0.1448003 0.4606357 0.4791444 0.4525622 0.2297306 0.3597465 0.3331262 0.3165522 0.1907237 0.3781567 0.3046630 0.2260963 0.2302541 , , Lag_16 0.3386886 0.2301517 0.1967166 0.2457013 0.4153102 0.2978708 0.3316045 0.3155847 0.3095268 0.2480752 0.2709355 0.3258925 0.2947141 0.2232702 0.2175240 0.3021335 , , Lag_17 0.3556765 0.2901412 0.2181435 0.3035475 0.3473894 0.3594809 0.3021085 0.3914716 0.3700382 0.4697207 0.3183025 0.4731177 0.2458445 0.4474799 0.2438784 0.4462941 Slot n: [1] 240 Slot varnames: [1] "Series 1" "Series 2" "Series 3" "Series 4" Slot objectname: x > > ##It is an error to have more columns than rows. > ## autocovariances(mx, maxlag = 6, nseasons = 4) > ## autocovariances(mx) > > num2pcpar(mx, c(1,1,1,1), period = 4) $mean [1] 0.2212892 0.2610529 0.2222639 0.1751942 $coef An object of class "slMatrix" Slot "m": lag season 0 1 1 1 -0.9462426 2 1 -0.8957722 3 1 -0.8421822 4 1 -0.8803319 $scale [1] 0.9800724 0.9837131 1.0433693 0.9435026 > num2pcpar(mx, c(3,3,3,3), period = 4) $mean [1] 0.2212892 0.2610529 0.2222639 0.1751942 $coef An object of class "slMatrix" Slot "m": lag season 0 1 2 3 1 1 -0.9962631 0.009726434 0.05118143 2 1 -0.9003005 0.144883523 -0.15588601 3 1 -0.7223822 -0.177308198 0.05138492 4 1 -0.9444632 0.052370207 0.01986882 $scale [1] 0.9768186 0.9723284 1.0339197 0.9404123 > > sipfm1 <- new("SiPeriodicArModel", iorder = 1, siorder = 1, pcmodel = pfm1) > sipfm1 An object of class "SiPeriodicArModel" iorder: 1, siorder: 1 PAR part of the model, An object of class "PeriodicArModel" Number of seasons: 4 Mean: 0 0 0 0 SigmaSq: 1 1 1 1 Periodic order: AR(3,3,3,3) ar1 ar2 ar3 S1 1 5 9 S2 2 6 10 S3 3 7 11 S4 4 8 12 > fitPM(sipfm1, mx) An object of class "SiPeriodicArModel" iorder: 1, siorder: 1 PAR part of the model, An object of class FittedPeriodicArModel Number of seasons: 4 Mean: 0 0 0 0 SigmaSq: 1.900178 2.014823 2.512701 1.919159 Periodic order: AR(3,3,3,3) ar1 ar2 ar3 S1 0.03633172 0.02831852 0.02492281 S2 -0.02263934 -0.21176922 0.09351833 S3 -0.17347841 0.01862405 0.13451737 S4 0.02770379 0.11071311 0.07843985 number of obs. for each season: 238 238 238 238 > pfm1 An object of class "PeriodicArModel" Number of seasons: 4 Mean: 0 0 0 0 SigmaSq: 1 1 1 1 Periodic order: AR(3,3,3,3) ar1 ar2 ar3 S1 1 5 9 S2 2 6 10 S3 3 7 11 S4 4 8 12 > > > ## experiments and testing > fit1 <- fitPM(c(3,3,3,3), simts1) > fit1_mf <- new("MultiFilter", coef = fit1@ar@coef) > vs <- mcompanion::mf_VSform(fit1_mf, form = "I") > tmp <- mcompanion::VAR2pcfilter(vs$Phi[ , -4], + Phi0inv = vs$Phi0inv, D = fit1@sigma2, what = "") > names(tmp) # "pcfilter" "var" "Uform" [1] "pcfilter" "var" "Uform" > tmp$var [1] 0.9074826 0.9903078 0.9714497 1.0608910 > zapsmall(tmp$pcfilter) [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.11396728 -0.12246918 0.00759003 0 0 0 [2,] -0.00450794 0.08337720 0.01641127 0 0 0 [3,] -0.04491259 -0.00527692 0.03962269 0 0 0 [4,] 0.03387766 -0.07038516 0.00013228 0 0 0 > fit1@ar@coef lag season 1 2 3 1 0.11396728 -0.122469184 0.0075900305 2 -0.00450794 0.083377197 0.0164112748 3 -0.04491259 -0.005276924 0.0396226884 4 0.03387766 -0.070385164 0.0001322766 > all.equal(tmp$pcfilter[ , 1:3], fit1@ar@coef, check.attributes = FALSE) # TRUE [1] TRUE > tmp$Uform $Sigma [1] 1.0608910 0.9714497 0.9903078 0.9074826 $U0 [,1] [,2] [,3] [,4] [1,] 1 -0.03387766 0.07038516 -0.0001322766 [2,] 0 1.00000000 0.04491259 0.0052769241 [3,] 0 0.00000000 1.00000000 0.0045079396 [4,] 0 0.00000000 0.00000000 1.0000000000 $U [,1] [,2] [,3] [1,] -1.829718e-19 6.802028e-20 -3.263662e-22 [2,] 3.962269e-02 4.045944e-20 2.495333e-21 [3,] 8.337720e-02 1.641127e-02 -1.224348e-21 [4,] 1.139673e-01 -1.224692e-01 7.590031e-03 $U0inv [,1] [,2] [,3] [,4] [1,] 1 0.03387766 -0.07190670 0.0002776578 [2,] 0 1.00000000 -0.04491259 -0.0050744608 [3,] 0 0.00000000 1.00000000 -0.0045079396 [4,] 0 0.00000000 0.00000000 1.0000000000 $perm [1] 4 3 2 1 > fit1@sigma2 [1] 1.0608910 0.9714497 0.9903078 0.9074826 > > ## both give the matrix Sigma for the "I" form > identical( + vs$Phi0inv %*% diag(fit1@sigma2) %*% t(vs$Phi0inv) + , + tmp$Uform$U0inv %*% diag(tmp$Uform$Sigma) %*% t(tmp$Uform$U0inv) + ) # TRUE [1] TRUE > > ## no, this is a different matrix > var1_mat <- cbind(vs$Phi0, # identity matrix + - vs$Phi) # drop trailing zero columns? > var1_mat <- mcompanion::mCompanion(var1_mat) > var1_Sigma <- vs$Phi0inv %*% diag(fit1@sigma2) %*% t(vs$Phi0inv) > abs(eigen(diag(nrow(var1_mat)) - var1_mat)$values) Error in isVirtualExt(exti) : trying to get slot "virtual" from an object of a basic class ("NULL") with no slots Calls: eigen ... .selectSuperClasses -> vapply -> FUN -> isVirtualExt Execution halted Flavor: r-oldrel-macos-arm64

Version: 0.15.5
Check: package dependencies
Result: NOTE Package suggested but not available for checking: ‘partsm’ Flavor: r-oldrel-macos-x86_64