R Under development (unstable) (2025-01-08 r87545) -- "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 <- "msBP" > source(file.path(R.home("share"), "R", "examples-header.R")) > options(warn = 1) > library('msBP') > > base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') > base::assign(".old_wd", base::getwd(), pos = 'CheckExEnv') > cleanEx() > nameEx("galaxy") > ### * galaxy > > flush(stderr()); flush(stdout()) > > ### Name: galaxy > ### Title: Galaxy velocities > ### Aliases: galaxy > > ### ** Examples > > data(galaxy) > str(galaxy) 'data.frame': 82 obs. of 1 variable: $ speed: num 9172 9350 9483 9558 9775 ... > > > > cleanEx() > nameEx("msBP.Gibbs") > ### * msBP.Gibbs > > flush(stderr()); flush(stdout()) > > ### Name: msBP.Gibbs > ### Title: Gibbs sampling for density estimation for msBP model > ### Aliases: msBP.Gibbs > > ### ** Examples > > ## Not run: > ##D data(galaxy) > ##D galaxy <- data.frame(galaxy) > ##D speeds <- galaxy$speed/1000 > ##D set.seed(1) > ##D #with fixed g0 and random a, b > ##D fit.msbp.1 <- msBP.Gibbs(speeds, a = 10, b = 5, g0 = "empirical", > ##D mcmc=list(nrep = 10000, nb = 5000, ndisplay = 1000), > ##D hyper=list(hyperprior=list(a = TRUE, b = TRUE, g0 = FALSE), > ##D hyperpar=list(beta=5,gamma = 1,delta = 1,lambda = 1)), > ##D printing = 0, maxS = 7, grid = list(n.points = 150, low = 5, upp = 38)) > ##D > ##D #with random a, b and hyperparameters of g0 > ##D fit.msbp.2 <- msBP.Gibbs(speeds, a = 10, b=5, g0 = "normal", > ##D mcmc=list(nrep = 10000, nb = 5000, ndisplay = 1000), > ##D hyper=list(hyperprior = list(a = TRUE, b = TRUE, g0 = TRUE), > ##D hyperpar = list(beta = 50, gamma = 5, delta = 10, lambda = 1, > ##D gridB = seq(0, 20, length = 30), > ##D mu0 = 21, kappa0 = 0.1, alpha0 = 1, beta0 = 20)), > ##D printing = 0, maxS = 7, grid = list(n.points = 150, lo w= 5, upp = 38)) > ##D > ##D hist(speeds, prob=TRUE,br=10, ylim=c(0,0.23), main="", col='grey') > ##D points(fit.msbp.1$density$postMeanDens~fit.msbp.1$density$xDens, ty='l', lwd=2) > ##D points(fit.msbp.1$density$postUppDens~fit.msbp.1$density$xDens, ty='l',lty=2, lwd=2) > ##D points(fit.msbp.1$density$postLowDens~fit.msbp.1$density$xDens, ty='l',lty=2, lwd=2) > ##D > ##D hist(speeds, prob=TRUE,br=10, ylim=c(0,0.23), main="", col='grey') > ##D points(fit.msbp.2$density$postMeanDens~fit.msbp.2$density$xDens, ty='l', lwd=2) > ##D points(fit.msbp.2$density$postUppDens~fit.msbp.2$density$xDens, ty='l',lty=2, lwd=2) > ##D points(fit.msbp.2$density$postLowDens~fit.msbp.2$density$xDens, ty='l',lty=2, lwd=2) > ##D > ## End(Not run) > > > > cleanEx() > nameEx("msBP.compute.prob") > ### * msBP.compute.prob > > flush(stderr()); flush(stdout()) > > ### Name: msBP.compute.prob > ### Title: Compute binary tree of probabilities > ### Aliases: msBP.compute.prob > > ### ** Examples > > S <-structure(list( T = list(1/8,c(1/3,1/3), c(1/4,1/4,1/4,1/4), + rep(1,8)), max.s=3), class = "binaryTree") > R <-structure(list( T = list(1/2,c(1/2,1/2), c(1/4,1/2,1/2,1/2), + rep(1,8)), max.s=3), class = "binaryTree") > RS <-structure(list(S = S, R = R), class = "msbpTree") > probabilities <- msBP.compute.prob(RS) wrapper.cpp:29:39: runtime error: load of misaligned address 0x000000000001 for type 'double', which requires 8 byte alignment 0x000000000001: note: pointer points here #0 0x7f8ab874d069 in computeprob_C /data/gannet/ripley/R/packages/tests-gcc-SAN/msBP/src/wrapper.cpp:29 #1 0x75bb04 in do_dotCode /data/gannet/ripley/R/svn/R-devel/src/main/dotcode.c:1986 #2 0x8a2ae3 in bcEval_loop /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:8122 #3 0x873caf in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7505 #4 0x83aa12 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1167 #5 0x8459e2 in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2393 #6 0x83938a in applyClosure_core /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2306 #7 0x83b096 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2328 #8 0x83b096 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1280 #9 0x85eb86 in do_set /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:3571 #10 0x83b4c6 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1232 #11 0x9c4e19 in Rf_ReplIteration /data/gannet/ripley/R/svn/R-devel/src/main/main.c:265 #12 0x9c4e19 in R_ReplConsole /data/gannet/ripley/R/svn/R-devel/src/main/main.c:317 #13 0x9c631b in run_Rmainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1219 #14 0x9d0892 in Rf_mainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1226 #15 0x4290cf in main /data/gannet/ripley/R/svn/R-devel/src/main/Rmain.c:29 #16 0x7f8ac422950f in __libc_start_call_main (/lib64/libc.so.6+0x2950f) (BuildId: 8257ee907646e9b057197533d1e4ac8ede7a9c5c) #17 0x7f8ac42295c8 in __libc_start_main_alias_2 (/lib64/libc.so.6+0x295c8) (BuildId: 8257ee907646e9b057197533d1e4ac8ede7a9c5c) #18 0x429ab4 in _start (/data/gannet/ripley/R/gcc-SAN3/bin/exec/R+0x429ab4) (BuildId: b25c18b29da9020de134f39d59f7dee05849d9e9) *** caught segfault *** address 0x1, cause 'memory not mapped' Traceback: 1: msBP.compute.prob(RS) An irrecoverable exception occurred. R is aborting now ...