R Under development (unstable) (2025-12-12 r89163) -- "Unsuffered Consequences" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu 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. Natural language support but running in an English locale 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. > pkgname <- "bayestransmission" > source(file.path(R.home("share"), "R", "examples-header.R")) > options(warn = 1) > library('bayestransmission') > > base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') > base::assign(".old_wd", base::getwd(), pos = 'CheckExEnv') > cleanEx() > nameEx("AbxParams") > ### * AbxParams > > flush(stderr()); flush(stdout()) > > ### Name: AbxParams > ### Title: Antibiotic Parameters > ### Aliases: AbxParams > > ### ** Examples > > AbxParams() $onoff [1] FALSE $delay [1] 0 $life [1] 1 > > > > cleanEx() > nameEx("AbxRateParams") > ### * AbxRateParams > > flush(stderr()); flush(stdout()) > > ### Name: AbxRateParams > ### Title: Antibiotic Administration Rate Parameters > ### Aliases: AbxRateParams > > ### ** Examples > > AbxRateParams() $uncolonized $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $colonized $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $latent $init [1] 0 $update [1] FALSE $prior [1] 0 $weight [1] 0 attr(,"class") [1] "Param" > > > > cleanEx() > nameEx("ClearanceParams") > ### * ClearanceParams > > flush(stderr()); flush(stdout()) > > ### Name: ClearanceParams > ### Title: Clearance Parameters > ### Aliases: ClearanceParams > > ### ** Examples > > ClearanceParams() $rate $init [1] 0.01 $update [1] TRUE $prior [1] 0.01 $weight [1] 1 attr(,"class") [1] "Param" $abx $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $ever_abx $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" > > > > cleanEx() > nameEx("CodeToEvent") > ### * CodeToEvent > > flush(stderr()); flush(stdout()) > > ### Name: CodeToEvent > ### Title: Convert coded events to string events > ### Aliases: CodeToEvent > > ### ** Examples > > CodeToEvent(c(-1:19, 21:23, 31:33, -999)) [1] "nullevent" "admission" "negsurvtest" "possurvtest" [5] "discharge" "negclintest" "posclintest" "insitu" [9] "postest" "negtest" "abxdose" "abxon" [13] "abxoff" "isolon" "isoloff" "admission0" [17] "admission1" "admission2" "insitu0" "insitu1" [21] "insitu2" "start" "marker" "stop" [25] "acquisition" "progression" "clearance" "EVENT_TYPE_ERROR" > > > > cleanEx() > nameEx("EventToCode") > ### * EventToCode > > flush(stderr()); flush(stdout()) > > ### Name: EventToCode > ### Title: Convert string events to coded events > ### Aliases: EventToCode > > ### ** Examples > > EventToCode(c("admission", "discharge", "postest", "negtest")) [1] 0 3 7 8 > EventToCode(c("abxon", "abxoff", "isolon", "isoloff")) [1] 10 11 12 13 > > > > cleanEx() > nameEx("InUnitParams") > ### * InUnitParams > > flush(stderr()); flush(stdout()) > > ### Name: InUnitParams > ### Title: In Unit Parameters > ### Aliases: InUnitParams ABXInUnitParams > > ### ** Examples > > InUnitParams( + acquisition = LinearAbxAcquisitionParams(), + progression = ProgressionParams(), + clearance = ClearanceParams() + ) $acquisition $acquisition$base $init [1] 0.001 $update [1] TRUE $prior [1] 0.001 $weight [1] 1 attr(,"class") [1] "Param" $acquisition$time $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $acquisition$mass $init [1] 1 $update [1] TRUE $prior [1] 1 $weight [1] 1 attr(,"class") [1] "Param" $acquisition$freq $init [1] 1 $update [1] TRUE $prior [1] 1 $weight [1] 1 attr(,"class") [1] "Param" $acquisition$col_abx $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $acquisition$suss_abx $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $acquisition$suss_ever $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $progression $progression$rate $init [1] 0.01 $update [1] TRUE $prior [1] 0.01 $weight [1] 1 attr(,"class") [1] "Param" $progression$abx $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $progression$ever_abx $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $clearance $clearance$rate $init [1] 0.01 $update [1] TRUE $prior [1] 0.01 $weight [1] 1 attr(,"class") [1] "Param" $clearance$abx $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $clearance$ever_abx $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" > ABXInUnitParams( + acquisition = LinearAbxAcquisitionParams(), + progression = ProgressionParams(), + clearance = ClearanceParams() + ) $acquisition $acquisition$base $init [1] 0.001 $update [1] TRUE $prior [1] 0.001 $weight [1] 1 attr(,"class") [1] "Param" $acquisition$time $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $acquisition$mass $init [1] 1 $update [1] TRUE $prior [1] 1 $weight [1] 1 attr(,"class") [1] "Param" $acquisition$freq $init [1] 1 $update [1] TRUE $prior [1] 1 $weight [1] 1 attr(,"class") [1] "Param" $acquisition$col_abx $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $acquisition$suss_abx $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $acquisition$suss_ever $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $progression $progression$rate $init [1] 0.01 $update [1] TRUE $prior [1] 0.01 $weight [1] 1 attr(,"class") [1] "Param" $progression$abx $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $progression$ever_abx $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $clearance $clearance$rate $init [1] 0.01 $update [1] TRUE $prior [1] 0.01 $weight [1] 1 attr(,"class") [1] "Param" $clearance$abx $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $clearance$ever_abx $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" > > > > cleanEx() > nameEx("InsituParams") > ### * InsituParams > > flush(stderr()); flush(stdout()) > > ### Name: InsituParams > ### Title: InSitu Parameters > ### Aliases: InsituParams > > ### ** Examples > > InsituParams() $probs [1] 0.9 0.0 0.1 $priors [1] 0.9 1.0 0.1 $doit [1] TRUE FALSE TRUE > InsituParams(nstates = 2) # c(0.9, 0.0, 0.1) $probs [1] 0.9 0.0 0.1 $priors [1] 0.9 1.0 0.1 $doit [1] TRUE FALSE TRUE > InsituParams(nstates = 3) # c(0.98, 0.01, 0.01) $probs [1] 0.98 0.01 0.01 $priors [1] 0.98 0.01 0.01 $doit [1] TRUE TRUE TRUE > > > > cleanEx() > nameEx("LinearAbxAcquisitionParams") > ### * LinearAbxAcquisitionParams > > flush(stderr()); flush(stdout()) > > ### Name: LinearAbxAcquisitionParams > ### Title: Linear Antibiotic Acquisition Parameters > ### Aliases: LinearAbxAcquisitionParams > > ### ** Examples > > LinearAbxAcquisitionParams() $base $init [1] 0.001 $update [1] TRUE $prior [1] 0.001 $weight [1] 1 attr(,"class") [1] "Param" $time $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $mass $init [1] 1 $update [1] TRUE $prior [1] 1 $weight [1] 1 attr(,"class") [1] "Param" $freq $init [1] 1 $update [1] TRUE $prior [1] 1 $weight [1] 1 attr(,"class") [1] "Param" $col_abx $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $suss_abx $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $suss_ever $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" > > > > cleanEx() > nameEx("LogNormalAcquisitionParams") > ### * LogNormalAcquisitionParams > > flush(stderr()); flush(stdout()) > > ### Name: LogNormalAcquisitionParams > ### Title: Log-Normal Acquisition Parameters > ### Aliases: LogNormalAcquisitionParams > > ### ** Examples > > LogNormalAcquisitionParams() [[1]] $init [1] 0 $update [1] FALSE $prior [1] 0 $weight [1] 0 attr(,"class") [1] "Param" [[2]] $init [1] 0.001 $update [1] TRUE $prior [1] 0.001 $weight [1] 1 attr(,"class") [1] "Param" [[3]] $init [1] -1 $update [1] FALSE $prior [1] -1 $weight [1] 0 attr(,"class") [1] "Param" [[4]] $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" [[5]] $init [1] 0 $update [1] FALSE $prior [1] 0 $weight [1] 0 attr(,"class") [1] "Param" [[6]] $init [1] 0 $update [1] FALSE $prior [1] 0 $weight [1] 0 attr(,"class") [1] "Param" [[7]] $init [1] 0 $update [1] FALSE $prior [1] 0 $weight [1] 0 attr(,"class") [1] "Param" [[8]] $init [1] 0 $update [1] FALSE $prior [1] 0 $weight [1] 0 attr(,"class") [1] "Param" > > > > cleanEx() > nameEx("LogNormalModelParams") > ### * LogNormalModelParams > > flush(stderr()); flush(stdout()) > > ### Name: LogNormalModelParams > ### Title: Model Parameters for a Log Normal Model > ### Aliases: LogNormalModelParams LinearAbxModel > > ### ** Examples > > LogNormalModelParams("LogNormalModel") $modname [1] "LogNormalModel" $nstates [1] 2 $nmetro [1] 1 $forward [1] TRUE $cheat [1] FALSE $Insitu $Insitu$probs [1] 0.9 0.0 0.1 $Insitu$priors [1] 0.9 1.0 0.1 $Insitu$doit [1] TRUE FALSE TRUE $SurveillanceTest $SurveillanceTest$colonized $init [1] 0.8 $update [1] TRUE $prior [1] 0.8 $weight [1] 1 attr(,"class") [1] "Param" $SurveillanceTest$uncolonized $init [1] 1e-10 $update [1] FALSE $prior [1] 1e-10 $weight [1] 0 attr(,"class") [1] "Param" $SurveillanceTest$latent $init [1] 0 $update [1] FALSE $prior [1] 0 $weight [1] 0 attr(,"class") [1] "Param" $ClinicalTest $ClinicalTest$uncolonized $ClinicalTest$uncolonized$param $init [1] 0.5 $update [1] FALSE $prior [1] 0.5 $weight [1] 0 attr(,"class") [1] "Param" $ClinicalTest$uncolonized$rate $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $ClinicalTest$colonized $ClinicalTest$colonized$param $init [1] 0.5 $update [1] FALSE $prior [1] 0.5 $weight [1] 0 attr(,"class") [1] "Param" $ClinicalTest$colonized$rate $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $ClinicalTest$latent $ClinicalTest$latent$param $init [1] 0 $update [1] FALSE $prior [1] 0 $weight [1] 0 attr(,"class") [1] "Param" $ClinicalTest$latent$rate $init [1] 0 $update [1] FALSE $prior [1] 0 $weight [1] 0 attr(,"class") [1] "Param" $OutCol $OutCol$acquisition $init [1] 0.05 $update [1] TRUE $prior [1] 0.05 $weight [1] 1 attr(,"class") [1] "Param" $OutCol$clearance $init [1] 0.01 $update [1] TRUE $prior [1] 0.01 $weight [1] 1 attr(,"class") [1] "Param" $OutCol$progression $init [1] 0 $update [1] FALSE $prior [1] 0 $weight [1] 0 attr(,"class") [1] "Param" $InCol $InCol$acquisition $InCol$acquisition[[1]] $init [1] 0 $update [1] FALSE $prior [1] 0 $weight [1] 0 attr(,"class") [1] "Param" $InCol$acquisition[[2]] $init [1] 0.001 $update [1] TRUE $prior [1] 0.001 $weight [1] 1 attr(,"class") [1] "Param" $InCol$acquisition[[3]] $init [1] -1 $update [1] FALSE $prior [1] -1 $weight [1] 0 attr(,"class") [1] "Param" $InCol$acquisition[[4]] $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $InCol$acquisition[[5]] $init [1] 0 $update [1] FALSE $prior [1] 0 $weight [1] 0 attr(,"class") [1] "Param" $InCol$acquisition[[6]] $init [1] 0 $update [1] FALSE $prior [1] 0 $weight [1] 0 attr(,"class") [1] "Param" $InCol$acquisition[[7]] $init [1] 0 $update [1] FALSE $prior [1] 0 $weight [1] 0 attr(,"class") [1] "Param" $InCol$acquisition[[8]] $init [1] 0 $update [1] FALSE $prior [1] 0 $weight [1] 0 attr(,"class") [1] "Param" $InCol$progression $InCol$progression$rate $init [1] 0.01 $update [1] TRUE $prior [1] 0.01 $weight [1] 1 attr(,"class") [1] "Param" $InCol$progression$abx $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $InCol$progression$ever_abx $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $InCol$clearance $InCol$clearance$rate $init [1] 0.01 $update [1] TRUE $prior [1] 0.01 $weight [1] 1 attr(,"class") [1] "Param" $InCol$clearance$abx $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $InCol$clearance$ever_abx $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $Abx $Abx$onoff [1] FALSE $Abx$delay [1] 0 $Abx$life [1] 1 $AbxRate $AbxRate$uncolonized $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $AbxRate$colonized $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $AbxRate$latent $init [1] 0 $update [1] FALSE $prior [1] 0 $weight [1] 0 attr(,"class") [1] "Param" > > > > cleanEx() > nameEx("OutOfUnitInfectionParams") > ### * OutOfUnitInfectionParams > > flush(stderr()); flush(stdout()) > > ### Name: OutOfUnitInfectionParams > ### Title: Out of Unit Infection Parameters > ### Aliases: OutOfUnitInfectionParams > > ### ** Examples > > OutOfUnitInfectionParams() $acquisition $init [1] 0.05 $update [1] TRUE $prior [1] 0.05 $weight [1] 1 attr(,"class") [1] "Param" $clearance $init [1] 0.01 $update [1] TRUE $prior [1] 0.01 $weight [1] 1 attr(,"class") [1] "Param" $progression $init [1] 0 $update [1] FALSE $prior [1] 0 $weight [1] 0 attr(,"class") [1] "Param" > > > > cleanEx() > nameEx("Param") > ### * Param > > flush(stderr()); flush(stdout()) > > ### Name: Param > ### Title: Construct a parameter with a prior, weight and an update flag. > ### Aliases: Param > > ### ** Examples > > # Fully specified parameter. > Param(init = 0, weight = 1, update = TRUE, prior = 0.5) $init [1] 0 $update [1] TRUE $prior [1] 0.5 $weight [1] 1 attr(,"class") [1] "Param" > # Fixed parameter > # Weight = 0 implies update=FALSE and prior is ignored. > Param(0, 0) $init [1] 0 $update [1] FALSE $prior [1] 0 $weight [1] 0 attr(,"class") [1] "Param" > # Update parameter that starts at zero. > Param(0, weight =1, update=TRUE) $init [1] 0 $update [1] TRUE $prior [1] 0 $weight [1] 1 attr(,"class") [1] "Param" > # Parameters specified at zero implies fixed. > Param(0) $init [1] 0 $update [1] FALSE $prior [1] 0 $weight [1] 0 attr(,"class") [1] "Param" > > > > cleanEx() > nameEx("ParamWRate") > ### * ParamWRate > > flush(stderr()); flush(stdout()) > > ### Name: ParamWRate > ### Title: Specify a random testing parameter with a rate. > ### Aliases: ParamWRate > > ### ** Examples > > ParamWRate(Param(0.5, 0), rate = Param(1, 0)) $param $init [1] 0.5 $update [1] FALSE $prior [1] 0.5 $weight [1] 0 attr(,"class") [1] "Param" $rate $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" > > > > cleanEx() > nameEx("ProgressionParams") > ### * ProgressionParams > > flush(stderr()); flush(stdout()) > > ### Name: ProgressionParams > ### Title: Progression Parameters > ### Aliases: ProgressionParams > > ### ** Examples > > ProgressionParams() $rate $init [1] 0.01 $update [1] TRUE $prior [1] 0.01 $weight [1] 1 attr(,"class") [1] "Param" $abx $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $ever_abx $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" > > > > cleanEx() > nameEx("RandomTestParams") > ### * RandomTestParams > > flush(stderr()); flush(stdout()) > > ### Name: RandomTestParams > ### Title: Random Testing Parameter Set > ### Aliases: RandomTestParams ClinicalTestParams > > ### ** Examples > > RandomTestParams() $uncolonized $uncolonized$param $init [1] 0.5 $update [1] FALSE $prior [1] 0.5 $weight [1] 0 attr(,"class") [1] "Param" $uncolonized$rate $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $colonized $colonized$param $init [1] 0.5 $update [1] FALSE $prior [1] 0.5 $weight [1] 0 attr(,"class") [1] "Param" $colonized$rate $init [1] 1 $update [1] FALSE $prior [1] 1 $weight [1] 0 attr(,"class") [1] "Param" $latent $latent$param $init [1] 0 $update [1] FALSE $prior [1] 0 $weight [1] 0 attr(,"class") [1] "Param" $latent$rate $init [1] 0 $update [1] FALSE $prior [1] 0 $weight [1] 0 attr(,"class") [1] "Param" > > > > cleanEx() > nameEx("SurveillanceTestParams") > ### * SurveillanceTestParams > > flush(stderr()); flush(stdout()) > > ### Name: SurveillanceTestParams > ### Title: Surveillance Test Parameters > ### Aliases: SurveillanceTestParams > > ### ** Examples > > SurveillanceTestParams() $colonized $init [1] 0.8 $update [1] TRUE $prior [1] 0.8 $weight [1] 1 attr(,"class") [1] "Param" $uncolonized $init [1] 1e-10 $update [1] FALSE $prior [1] 1e-10 $weight [1] 0 attr(,"class") [1] "Param" $latent $init [1] 0 $update [1] FALSE $prior [1] 0 $weight [1] 0 attr(,"class") [1] "Param" > > > > cleanEx() > nameEx("getCppModelParams") > ### * getCppModelParams > > flush(stderr()); flush(stdout()) > > ### Name: getCppModelParams > ### Title: Extract Model Parameters from C++ Model Object > ### Aliases: getCppModelParams > > ### ** Examples > > > > > cleanEx() > nameEx("mcmc_to_dataframe") > ### * mcmc_to_dataframe > > flush(stderr()); flush(stdout()) > > ### Name: mcmc_to_dataframe > ### Title: Convert MCMC Parameters to Data Frame > ### Aliases: mcmc_to_dataframe > > ### ** Examples > > results <- runMCMC(data = simulated.data, + modelParameters = LinearAbxModel(), + nsims = 10, + nburn = 0, + outputparam = TRUE, + outputfinal = FALSE) lognormal/LinearAbxModel.h:14:12: runtime error: downcast of address 0x7bf9b1c47f50 which does not point to an object of type 'LinearAbxICP' 0x7bf9b1c47f50: note: object is of type 'lognormal::LogNormalAbxICP' 00 00 00 00 10 1c ac 9f 49 7b 00 00 d8 03 01 00 00 00 00 00 02 00 00 00 be be be be 10 72 ca b1 ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'lognormal::LogNormalAbxICP' #0 0x7b499e5b0ed4 in lognormal::LinearAbxModel::getInColParams() const lognormal/LinearAbxModel.h:14 #1 0x7b499e5b0ed4 in lognormal::LinearAbxModel::LinearAbxModel(int, int, int, int) lognormal/lognormal_LinearAbxModel.cpp:7 #2 0x7b499ec6f60f in newModel(Rcpp::Vector<19, Rcpp::PreserveStorage>, bool) /data/gannet/ripley/R/packages/tests-gcc-SAN/bayestransmission/src/runMCMC.cpp:36 #3 0x7b499ec79067 in runMCMC(Rcpp::DataFrame_Impl, Rcpp::Vector<19, Rcpp::PreserveStorage>, unsigned int, unsigned int, bool, bool, bool) /data/gannet/ripley/R/packages/tests-gcc-SAN/bayestransmission/src/runMCMC.cpp:185 #4 0x7b499ec63088 in _bayestransmission_runMCMC /data/gannet/ripley/R/packages/tests-gcc-SAN/bayestransmission/src/RcppExports.cpp:59 #5 0x00000074c360 in R_doDotCall /data/gannet/ripley/R/svn/R-devel/src/main/dotcode.c:775 #6 0x0000008e2d3a in bcEval_loop /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:8664 #7 0x0000008b957b in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7497 #8 0x0000008598f2 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1167 #9 0x00000086f63a in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2389 #10 0x0000008736fa in applyClosure_core /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2302 #11 0x000000859f93 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2324 #12 0x000000859f93 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1280 #13 0x00000088838e in do_set /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:3563 #14 0x00000085a3b6 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1232 #15 0x0000009fff08 in Rf_ReplIteration /data/gannet/ripley/R/svn/R-devel/src/main/main.c:264 #16 0x0000009fff08 in R_ReplConsole /data/gannet/ripley/R/svn/R-devel/src/main/main.c:317 #17 0x000000a0533a in run_Rmainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1235 #18 0x000000a0f552 in Rf_mainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1242 #19 0x0000004131af in main /data/gannet/ripley/R/svn/R-devel/src/main/Rmain.c:29 #20 0x7f49b52115f4 in __libc_start_call_main (/lib64/libc.so.6+0x35f4) (BuildId: a1dda014206b55b07f58fe8db80121b752dc3d03) #21 0x7f49b52116a7 in __libc_start_main@@GLIBC_2.34 (/lib64/libc.so.6+0x36a7) (BuildId: a1dda014206b55b07f58fe8db80121b752dc3d03) #22 0x000000413b74 in _start (/data/gannet/ripley/R/gcc-SAN3/bin/exec/R+0x413b74) (BuildId: 162da4155cf0b7e57a4e8bd0b5eda527e8633566) lognormal/lognormal_LogNormalModel.cpp:66:12: runtime error: downcast of address 0x7bf9b1c482c0 which does not point to an object of type 'LogNormalAbxICP' 0x7bf9b1c482c0: note: object is of type 'lognormal::LinearAbxICP' 00 00 00 00 f0 1d ac 9f 49 7b 00 00 db 03 01 00 00 00 00 00 02 00 00 00 be be be be 90 72 ca b1 ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'lognormal::LinearAbxICP' #0 0x7b499e5ba68b in lognormal::LogNormalModel::getInColParams() const lognormal/lognormal_LogNormalModel.cpp:66 #1 0x7b499ec79203 in runMCMC(Rcpp::DataFrame_Impl, Rcpp::Vector<19, Rcpp::PreserveStorage>, unsigned int, unsigned int, bool, bool, bool) /data/gannet/ripley/R/packages/tests-gcc-SAN/bayestransmission/src/runMCMC.cpp:189 #2 0x7b499ec63088 in _bayestransmission_runMCMC /data/gannet/ripley/R/packages/tests-gcc-SAN/bayestransmission/src/RcppExports.cpp:59 #3 0x00000074c360 in R_doDotCall /data/gannet/ripley/R/svn/R-devel/src/main/dotcode.c:775 #4 0x0000008e2d3a in bcEval_loop /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:8664 #5 0x0000008b957b in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7497 #6 0x0000008598f2 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1167 #7 0x00000086f63a in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2389 #8 0x0000008736fa in applyClosure_core /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2302 #9 0x000000859f93 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2324 #10 0x000000859f93 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1280 #11 0x00000088838e in do_set /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:3563 #12 0x00000085a3b6 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1232 #13 0x0000009fff08 in Rf_ReplIteration /data/gannet/ripley/R/svn/R-devel/src/main/main.c:264 #14 0x0000009fff08 in R_ReplConsole /data/gannet/ripley/R/svn/R-devel/src/main/main.c:317 #15 0x000000a0533a in run_Rmainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1235 #16 0x000000a0f552 in Rf_mainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1242 #17 0x0000004131af in main /data/gannet/ripley/R/svn/R-devel/src/main/Rmain.c:29 #18 0x7f49b52115f4 in __libc_start_call_main (/lib64/libc.so.6+0x35f4) (BuildId: a1dda014206b55b07f58fe8db80121b752dc3d03) #19 0x7f49b52116a7 in __libc_start_main@@GLIBC_2.34 (/lib64/libc.so.6+0x36a7) (BuildId: a1dda014206b55b07f58fe8db80121b752dc3d03) #20 0x000000413b74 in _start (/data/gannet/ripley/R/gcc-SAN3/bin/exec/R+0x413b74) (BuildId: 162da4155cf0b7e57a4e8bd0b5eda527e8633566) > param_df <- mcmc_to_dataframe(results) > head(param_df) iteration insitu_uncolonized insitu_colonized surv_test_uncol_neg 1 1 1.0000000 8.245229e-14 1e-10 2 2 1.0000000 6.282793e-16 1e-10 3 3 1.0000000 2.792072e-09 1e-10 4 4 0.9998681 1.319081e-04 1e-10 5 5 1.0000000 3.480713e-08 1e-10 6 6 0.9993958 6.042324e-04 1e-10 surv_test_col_neg surv_test_uncol_pos surv_test_col_pos clin_test_uncol 1 0.2132384 1e-10 0.9956517 0.5 2 0.2292093 1e-10 0.9197081 0.5 3 0.2220614 1e-10 0.9363038 0.5 4 0.2473637 1e-10 0.8732580 0.5 5 0.2325939 1e-10 0.9998211 0.5 6 0.2421837 1e-10 0.9999975 0.5 clin_test_col clin_rate_uncol clin_rate_col outunit_acquisition 1 0.5 1 1 0.05000000 2 0.5 1 1 0.02744316 3 0.5 1 1 0.02744316 4 0.5 1 1 0.02744316 5 0.5 1 1 0.02744316 6 0.5 1 1 0.09183673 outunit_clearance inunit_base inunit_time inunit_mass inunit_freq 1 0.010000000 0.0009910432 1 1 1 2 0.007471682 0.0009910432 1 1 1 3 0.007471682 0.0008807005 1 1 1 4 0.007471682 0.0008149156 1 1 1 5 0.007471682 0.0010508022 1 1 1 6 0.036062673 0.0012354957 1 1 1 inunit_colabx inunit_susabx inunit_susever inunit_clr inunit_clrAbx 1 1 1 1 0.010000000 1 2 1 1 1 0.010000000 1 3 1 1 1 0.010000000 1 4 1 1 1 0.009739162 1 5 1 1 1 0.010470208 1 6 1 1 1 0.010470208 1 inunit_clrEver abxrate_uncolonized abxrate_colonized loglikelihood 1 1 1 1 -16089.71 2 1 1 1 -15814.73 3 1 1 1 -15799.84 4 1 1 1 -15739.00 5 1 1 1 -15755.65 6 1 1 1 -15520.02 > > > > cleanEx() > nameEx("newCppModel") > ### * newCppModel > > flush(stderr()); flush(stdout()) > > ### Name: newCppModel > ### Title: Create a new C++ model object with parameters > ### Aliases: newCppModel > > ### ** Examples > > > > > > cleanEx() > nameEx("runMCMC") > ### * runMCMC > > flush(stderr()); flush(stdout()) > > ### Name: runMCMC > ### Title: Run Bayesian Transmission MCMC > ### Aliases: runMCMC > > ### ** Examples > > # Minimal example: create parameters and run a very short MCMC > params <- LinearAbxModel(nstates = 2) > data(simulated.data_sorted, package = "bayestransmission") > results <- runMCMC( + data = simulated.data_sorted, + modelParameters = params, + nsims = 3, + nburn = 0, + outputparam = TRUE, + outputfinal = FALSE, + verbose = FALSE + ) > str(results) List of 6 $ Parameters :List of 3 ..$ :List of 6 .. ..$ Insitu : Named num [1:2] 1.00 8.25e-14 .. .. ..- attr(*, "names")= chr [1:2] "Insit.P(unc)" "Insit.P(col)" .. ..$ SurveillanceTest: Named num [1:4] 1.00e-10 2.13e-01 1.00e-10 9.96e-01 .. .. ..- attr(*, "names")= chr [1:4] "ATest.P(+|unc-)" "ATest.P(+|col-)" "ATest.P(+|unc+)" "ATest.P(+|col+)" .. ..$ ClinicalTest : Named num [1:4] 0.5 0.5 1 1 .. .. ..- attr(*, "names")= chr [1:4] "RTest.P(+|unc)" "RTest.P(+|col)" "RTest.rateUnc" "RTest.rateCol" .. ..$ OutCol : Named num [1:2] 0.05 0.01 .. .. ..- attr(*, "names")= chr [1:2] "Out.acq" "Out.clr" .. ..$ InCol : Named num [1:10] 0.000991 1 1 1 1 ... .. .. ..- attr(*, "names")= chr [1:10] "LABX.base" "LABX.time" "LABX.mass.mx" "LABX.freq.mx" ... .. ..$ Abx : Named num [1:2] 1 1 .. .. ..- attr(*, "names")= chr [1:2] "Abx.rateUnc" "Abx.rateCol" ..$ :List of 6 .. ..$ Insitu : Named num [1:2] 1.00 6.28e-16 .. .. ..- attr(*, "names")= chr [1:2] "Insit.P(unc)" "Insit.P(col)" .. ..$ SurveillanceTest: Named num [1:4] 1.00e-10 2.29e-01 1.00e-10 9.20e-01 .. .. ..- attr(*, "names")= chr [1:4] "ATest.P(+|unc-)" "ATest.P(+|col-)" "ATest.P(+|unc+)" "ATest.P(+|col+)" .. ..$ ClinicalTest : Named num [1:4] 0.5 0.5 1 1 .. .. ..- attr(*, "names")= chr [1:4] "RTest.P(+|unc)" "RTest.P(+|col)" "RTest.rateUnc" "RTest.rateCol" .. ..$ OutCol : Named num [1:2] 0.02744 0.00747 .. .. ..- attr(*, "names")= chr [1:2] "Out.acq" "Out.clr" .. ..$ InCol : Named num [1:10] 0.000991 1 1 1 1 ... .. .. ..- attr(*, "names")= chr [1:10] "LABX.base" "LABX.time" "LABX.mass.mx" "LABX.freq.mx" ... .. ..$ Abx : Named num [1:2] 1 1 .. .. ..- attr(*, "names")= chr [1:2] "Abx.rateUnc" "Abx.rateCol" ..$ :List of 6 .. ..$ Insitu : Named num [1:2] 1.00 2.79e-09 .. .. ..- attr(*, "names")= chr [1:2] "Insit.P(unc)" "Insit.P(col)" .. ..$ SurveillanceTest: Named num [1:4] 1.00e-10 2.22e-01 1.00e-10 9.36e-01 .. .. ..- attr(*, "names")= chr [1:4] "ATest.P(+|unc-)" "ATest.P(+|col-)" "ATest.P(+|unc+)" "ATest.P(+|col+)" .. ..$ ClinicalTest : Named num [1:4] 0.5 0.5 1 1 .. .. ..- attr(*, "names")= chr [1:4] "RTest.P(+|unc)" "RTest.P(+|col)" "RTest.rateUnc" "RTest.rateCol" .. ..$ OutCol : Named num [1:2] 0.02744 0.00747 .. .. ..- attr(*, "names")= chr [1:2] "Out.acq" "Out.clr" .. ..$ InCol : Named num [1:10] 0.000881 1 1 1 1 ... .. .. ..- attr(*, "names")= chr [1:10] "LABX.base" "LABX.time" "LABX.mass.mx" "LABX.freq.mx" ... .. ..$ Abx : Named num [1:2] 1 1 .. .. ..- attr(*, "names")= chr [1:2] "Abx.rateUnc" "Abx.rateCol" $ LogLikelihood : num [1:3] -16090 -15815 -15800 $ MCMCParameters :List of 4 ..$ nsims : num 3 ..$ nburn : num 0 ..$ outputparam: logi TRUE ..$ outputfinal: logi FALSE $ ModelParameters:List of 12 ..$ modname : chr "LinearAbxModel" ..$ nstates : int 2 ..$ nmetro : int 1 ..$ forward : logi TRUE ..$ cheat : logi FALSE ..$ Insitu :List of 3 .. ..$ probs : num [1:3] 0.9 0 0.1 .. ..$ priors: num [1:3] 0.9 1 0.1 .. ..$ doit : logi [1:3] TRUE FALSE TRUE ..$ SurveillanceTest:List of 3 .. ..$ colonized :List of 4 .. .. ..$ init : num 0.8 .. .. ..$ update: logi TRUE .. .. ..$ prior : num 0.8 .. .. ..$ weight: num 1 .. .. ..- attr(*, "class")= chr "Param" .. ..$ uncolonized:List of 4 .. .. ..$ init : num 1e-10 .. .. ..$ update: logi FALSE .. .. ..$ prior : num 1e-10 .. .. ..$ weight: num 0 .. .. ..- attr(*, "class")= chr "Param" .. ..$ latent :List of 4 .. .. ..$ init : num 0 .. .. ..$ update: logi FALSE .. .. ..$ prior : num 0 .. .. ..$ weight: num 0 .. .. ..- attr(*, "class")= chr "Param" ..$ ClinicalTest :List of 3 .. ..$ uncolonized:List of 2 .. .. ..$ param:List of 4 .. .. .. ..$ init : num 0.5 .. .. .. ..$ update: logi FALSE .. .. .. ..$ prior : num 0.5 .. .. .. ..$ weight: num 0 .. .. .. ..- attr(*, "class")= chr "Param" .. .. ..$ rate :List of 4 .. .. .. ..$ init : num 1 .. .. .. ..$ update: logi FALSE .. .. .. ..$ prior : num 1 .. .. .. ..$ weight: num 0 .. .. .. ..- attr(*, "class")= chr "Param" .. ..$ colonized :List of 2 .. .. ..$ param:List of 4 .. .. .. ..$ init : num 0.5 .. .. .. ..$ update: logi FALSE .. .. .. ..$ prior : num 0.5 .. .. .. ..$ weight: num 0 .. .. .. ..- attr(*, "class")= chr "Param" .. .. ..$ rate :List of 4 .. .. .. ..$ init : num 1 .. .. .. ..$ update: logi FALSE .. .. .. ..$ prior : num 1 .. .. .. ..$ weight: num 0 .. .. .. ..- attr(*, "class")= chr "Param" .. ..$ latent :List of 2 .. .. ..$ param:List of 4 .. .. .. ..$ init : num 0 .. .. .. ..$ update: logi FALSE .. .. .. ..$ prior : num 0 .. .. .. ..$ weight: num 0 .. .. .. ..- attr(*, "class")= chr "Param" .. .. ..$ rate :List of 4 .. .. .. ..$ init : num 0 .. .. .. ..$ update: logi FALSE .. .. .. ..$ prior : num 0 .. .. .. ..$ weight: num 0 .. .. .. ..- attr(*, "class")= chr "Param" ..$ OutCol :List of 3 .. ..$ acquisition:List of 4 .. .. ..$ init : num 0.05 .. .. ..$ update: logi TRUE .. .. ..$ prior : num 0.05 .. .. ..$ weight: num 1 .. .. ..- attr(*, "class")= chr "Param" .. ..$ clearance :List of 4 .. .. ..$ init : num 0.01 .. .. ..$ update: logi TRUE .. .. ..$ prior : num 0.01 .. .. ..$ weight: num 1 .. .. ..- attr(*, "class")= chr "Param" .. ..$ progression:List of 4 .. .. ..$ init : num 0 .. .. ..$ update: logi FALSE .. .. ..$ prior : num 0 .. .. ..$ weight: num 0 .. .. ..- attr(*, "class")= chr "Param" ..$ InCol :List of 3 .. ..$ acquisition:List of 7 .. .. ..$ base :List of 4 .. .. .. ..$ init : num 0.001 .. .. .. ..$ update: logi TRUE .. .. .. ..$ prior : num 0.001 .. .. .. ..$ weight: num 1 .. .. .. ..- attr(*, "class")= chr "Param" .. .. ..$ time :List of 4 .. .. .. ..$ init : num 1 .. .. .. ..$ update: logi FALSE .. .. .. ..$ prior : num 1 .. .. .. ..$ weight: num 0 .. .. .. ..- attr(*, "class")= chr "Param" .. .. ..$ mass :List of 4 .. .. .. ..$ init : num 1 .. .. .. ..$ update: logi TRUE .. .. .. ..$ prior : num 1 .. .. .. ..$ weight: num 1 .. .. .. ..- attr(*, "class")= chr "Param" .. .. ..$ freq :List of 4 .. .. .. ..$ init : num 1 .. .. .. ..$ update: logi TRUE .. .. .. ..$ prior : num 1 .. .. .. ..$ weight: num 1 .. .. .. ..- attr(*, "class")= chr "Param" .. .. ..$ col_abx :List of 4 .. .. .. ..$ init : num 1 .. .. .. ..$ update: logi FALSE .. .. .. ..$ prior : num 1 .. .. .. ..$ weight: num 0 .. .. .. ..- attr(*, "class")= chr "Param" .. .. ..$ suss_abx :List of 4 .. .. .. ..$ init : num 1 .. .. .. ..$ update: logi FALSE .. .. .. ..$ prior : num 1 .. .. .. ..$ weight: num 0 .. .. .. ..- attr(*, "class")= chr "Param" .. .. ..$ suss_ever:List of 4 .. .. .. ..$ init : num 1 .. .. .. ..$ update: logi FALSE .. .. .. ..$ prior : num 1 .. .. .. ..$ weight: num 0 .. .. .. ..- attr(*, "class")= chr "Param" .. ..$ progression:List of 3 .. .. ..$ rate :List of 4 .. .. .. ..$ init : num 0.01 .. .. .. ..$ update: logi TRUE .. .. .. ..$ prior : num 0.01 .. .. .. ..$ weight: num 1 .. .. .. ..- attr(*, "class")= chr "Param" .. .. ..$ abx :List of 4 .. .. .. ..$ init : num 1 .. .. .. ..$ update: logi FALSE .. .. .. ..$ prior : num 1 .. .. .. ..$ weight: num 0 .. .. .. ..- attr(*, "class")= chr "Param" .. .. ..$ ever_abx:List of 4 .. .. .. ..$ init : num 1 .. .. .. ..$ update: logi FALSE .. .. .. ..$ prior : num 1 .. .. .. ..$ weight: num 0 .. .. .. ..- attr(*, "class")= chr "Param" .. ..$ clearance :List of 3 .. .. ..$ rate :List of 4 .. .. .. ..$ init : num 0.01 .. .. .. ..$ update: logi TRUE .. .. .. ..$ prior : num 0.01 .. .. .. ..$ weight: num 1 .. .. .. ..- attr(*, "class")= chr "Param" .. .. ..$ abx :List of 4 .. .. .. ..$ init : num 1 .. .. .. ..$ update: logi FALSE .. .. .. ..$ prior : num 1 .. .. .. ..$ weight: num 0 .. .. .. ..- attr(*, "class")= chr "Param" .. .. ..$ ever_abx:List of 4 .. .. .. ..$ init : num 1 .. .. .. ..$ update: logi FALSE .. .. .. ..$ prior : num 1 .. .. .. ..$ weight: num 0 .. .. .. ..- attr(*, "class")= chr "Param" ..$ Abx :List of 3 .. ..$ onoff: logi FALSE .. ..$ delay: num 0 .. ..$ life : num 1 ..$ AbxRate :List of 3 .. ..$ uncolonized:List of 4 .. .. ..$ init : num 1 .. .. ..$ update: logi FALSE .. .. ..$ prior : num 1 .. .. ..$ weight: num 0 .. .. ..- attr(*, "class")= chr "Param" .. ..$ colonized :List of 4 .. .. ..$ init : num 1 .. .. ..$ update: logi FALSE .. .. ..$ prior : num 1 .. .. ..$ weight: num 0 .. .. ..- attr(*, "class")= chr "Param" .. ..$ latent :List of 4 .. .. ..$ init : num 0 .. .. ..$ update: logi FALSE .. .. ..$ prior : num 0 .. .. ..$ weight: num 0 .. .. ..- attr(*, "class")= chr "Param" $ waic1 : num 0.463 $ waic2 : num 0.554 > > > > ### *