R Under development (unstable) (2024-04-23 r86473 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. > library(epigrowthfit) > options(warn = 2L, error = if (interactive()) recover) > > o.1 <- egf_cache( "egf-1.rds") > o.1s <- egf_cache("summary-egf-1.rds") List of 5 $ fitted : num [1:6, 1:2] -3.28 -3.18 -3.13 -3.09 -3.01 ... ..- attr(*, "dimnames")=List of 2 .. ..$ : chr [1:6] "Min." "1st Qu." "Median" "Mean" ... .. ..$ : chr [1:2] "log(r)" "log(c0)" $ convergence: int 0 $ value : num 1032 $ gradient : num [1:5] -1.63e-03 -4.25e-04 5.68e-05 2.73e-04 1.79e-04 $ hessian : logi TRUE - attr(*, "class")= chr "summary.egf" > o.1f <- egf_cache( "fitted-egf-1.rds") > > > ## object ############################################################## > > stopifnot(exprs = { + is.list(o.1s) + identical(oldClass(o.1s), "summary.egf") + length(o.1s) == 5L + identical(names(o.1s), c("fitted", "convergence", "value", "gradient", "hessian")) + identical(o.1s[["convergence"]], o.1[["optimizer_out"]][["convergence"]]) + identical(o.1s[["value"]], o.1[["value"]]) + identical(o.1s[["gradient"]], o.1[["gradient"]]) + identical(o.1s[["hessian"]], o.1[["hessian"]]) + all.equal(o.1s[["fitted"]], simplify2array(c(tapply(o.1f[["value"]], o.1f[["top"]], summary)))) + }) > > > ## print ############################################################### > > vv <- withVisible(print(o.1s)) Fitted values .......................................................... log(r) log(c0) Min. -3.280004 5.569983 1st Qu. -3.180285 6.026158 Median -3.127046 6.347277 Mean -3.094246 6.418744 3rd Qu. -3.006118 6.773228 Max. -2.818894 7.424955 Negative log marginal likelihood ....................................... convergence 0 value 1.032019e+03 range(abs(gradient)) 5.675084e-05 1.625871e-03 pos. def. Hessian TRUE > stopifnot(exprs = { + identical(vv[["value"]], o.1s) + identical(vv[["visible"]], FALSE) + }) > > proc.time() user system elapsed 1.57 0.17 1.73