R Under development (unstable) (2024-02-26 r85990 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 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. > require("dse") Loading required package: dse Loading required package: tfplot Loading required package: tframe Attaching package: 'dse' The following objects are masked from 'package:stats': acf, simulate > Sys.info() sysname release version nodename machine "Windows" "Server x64" "build 20348" "CRANWIN3" "x86-64" login user effective_user "CRAN" "CRAN" "CRAN" > DSEversion() setRNG tframe dse "2024.2-1" "2015.12-1.1" "2024.2-2" > data("eg1.DSE.data.diff", package="dse") > > if (!is.TSdata(eg1.DSE.data.diff)) stop("Test data not found. Testing stopped.") > > fuzz.small <- 1e-14 > fuzz.large <- 1e-10 > digits <- 18 > all.ok <- TRUE > > > test.rng <- list(kind="Wichmann-Hill",seed=c(979,1479,1542),normal.kind="Box-Muller") > > VARmodel <- estVARXar(eg1.DSE.data.diff, re.add.means=FALSE, warn=FALSE) > > SSmodel <- toSS(VARmodel) > > cat("dse test 9 ...\n") dse test 9 ... > z <- simulate(SSmodel, input=inputData(eg1.DSE.data.diff)) > ok <- testEqual(z,simulate(SSmodel, rng=setRNG::getRNG(z), + input=inputData(eg1.DSE.data.diff))) > if (!ok) {all.ok <- FALSE ; cat(ok, "\n")} > > ok <- testEqual(summary(z)$estimates, + summary(z)$estimates, fuzz=fuzz.small) > if (!ok) {all.ok <- FALSE ; cat(ok, "\n")} > > > > cat("dse test 10...\n") dse test 10... > > ok <- stability(SSmodel, verbose=FALSE) > if (!ok) {all.ok <- FALSE ; cat(ok, "\n")} > > > cat("dse test 11...\n") dse test 11... > > scale.fac <- diag(1:3) > scale.fac[1,3] <-.5 > scale.pred <- VARmodel$estimates$pred %*% t(scale.fac) > scale.fac <- list(output=scale.fac) > > good <- scale.pred > tst <- l(scale(VARmodel$model, scale=scale.fac), + scale(eg1.DSE.data.diff, scale=scale.fac), warn=FALSE)$estimates$pred > error <- max(abs(good - tst)) > cat("max. error ", max(error), "\n") max. error 3.122502e-17 > > if (any(is.na(error)) || any(is.nan(error)) || fuzz.small < error) + {printTestValue(c(tst), digits=18) + all.ok <- FALSE + } > > > cat("dse test 12...\n") dse test 12... > > good <- scale.pred > tst <- l(scale(SSmodel, scale=scale.fac), + scale(eg1.DSE.data.diff, scale=scale.fac))$estimates$pred > error <- max(abs(good - tst)) > cat("max. error ", max(error), "\n") max. error 2.428613e-17 > > if (any(is.na(error)) || any(is.nan(error)) || fuzz.small < error) + {printTestValue(c(tst), digits=18) + all.ok <- FALSE + } > > > cat("dse test 13...\n") dse test 13... > > z <- eg1.DSE.data.diff > ok <- testEqual(z, + TSdata(output=outputData(combine(z,z), series=seq(nseriesOutput(z))), + input= inputData(combine(z,z), series=seq( nseriesInput(z))))) > > if (!ok) {all.ok <- FALSE ; cat(ok, "\n")} > > > if (! all.ok) stop("some tests FAILED") > > > proc.time() user system elapsed 0.25 0.07 0.31