R Under development (unstable) (2024-03-14 r86117 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. > ## test the shrinkage sampling. > > library(bfp) > > n <- 1e+5 > R2 <- 0.7 > nObs <- 100 > p <- 20 > alpha <- 3.5 > > tVec <- bfp:::rshrinkage(n=n, + R2=R2, + nObs=nObs, + p=p, + alpha=alpha) > histRet <- hist(tVec, + nclass=50, + prob=TRUE) > > ## compare with unn density: > grid <- histRet$mids > > vals <- (1 - grid)^((p + alpha - 2) / 2 - 1) * (1 - R2 * grid)^(-(nObs - 1) / 2) > > ## scale > vals <- vals / max(vals) * max(histRet$density) > > lines(grid, + vals, + col=2) > > proc.time() user system elapsed 0.60 0.04 0.65