R Under development (unstable) (2023-11-26 r85638 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 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(grDevices, pos = "package:base", verbose = FALSE) > library( stats, pos = "package:base", verbose = FALSE) > library( utils, pos = "package:base", verbose = FALSE) > > library(fastbeta) > options(warn = 2L, error = recover) > > data(sir.e01, package = "fastbeta") > a <- attributes(sir.e01) > > series <- cbind(sir.e01[, c("Z.obs", "B")], mu = a[["mu"]](0)) > constants <- c(gamma = a[["gamma"]], + S0 = sir.e01[1L, "S"], + I0 = sir.e01[1L, "I"]) > > X <- fastbeta(series, constants, prob = a[["prob"]], delay = a[["delay"]]) > str(X) Time-Series [1:261, 1:3] from 0 to 260: 1.32e-05 1.05e-05 1.20e-05 1.09e-05 1.11e-05 ... - attr(*, "dimnames")=List of 2 ..$ : NULL ..$ : chr [1:3] "beta" "S" "I" > > stopifnot(exprs = { + is.double(X) + is.mts(X) + identical(dim(X), c(nrow(sir.e01), 3L)) + identical(dimnames(X), list(NULL, c("beta", "S", "I"))) + identical(tsp(X), tsp(sir.e01)) + !anyNA(X[-nrow(X), ]) + min(X, na.rm = TRUE) >= 0 + }) > > if (dev.interactive(TRUE)) + plot(X) > > unclass(proc.time()) user.self sys.self elapsed user.child sys.child 3.53 0.14 3.65 NA NA > > proc.time() user system elapsed 3.53 0.14 3.65