R Under development (unstable) (2023-12-09 r85665 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 = if (interactive()) recover) > > data(sir.e02, package = "fastbeta") > a <- attributes(sir.e02) > > series <- cbind(sir.e02[, c("Z.obs", "B")], mu = a[["mu"]](0)) > colnames(series) <- c("Z.obs", "B", "mu") > constants <- c(S0 = sir.e02[1L, "S"], + I0 = sir.e02[1L, "I"], + R0 = sir.e02[1L, "R"], + gamma = a[["gamma"]], + delta = a[["delta"]]) > > X <- fastbeta(series, constants, + prob = a[["prob"]], delay = a[["delay"]]) > str(X) Time-Series [1:261, 1:4] from 0 to 260: 58566 58157 57690 56631 55732 ... - attr(*, "dimnames")=List of 2 ..$ : NULL ..$ : chr [1:4] "S" "I" "R" "beta" > > stopifnot(exprs = { + is.double(X) + is.mts(X) + identical(dim(X), c(nrow(sir.e02), 4L)) + identical(dimnames(X), list(NULL, c("S", "I", "R", "beta"))) + identical(tsp(X), tsp(sir.e02)) + !anyNA(X[-nrow(X), ]) + min(X, 0, na.rm = TRUE) >= 0 + }) > > if (dev.interactive(TRUE)) + plot(X) > > proc.time() user system elapsed 2.98 0.06 3.03 > > proc.time() user system elapsed 2.98 0.06 3.03