R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 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 a HTML browser interface to help. Type 'q()' to quit R. > ### *
> ### > attach(NULL, name = "CheckExEnv") > assign(".CheckExEnv", as.environment(2), pos = length(search())) # base > ## add some hooks to label plot pages for base and grid graphics > setHook("plot.new", ".newplot.hook") > setHook("persp", ".newplot.hook") > setHook("grid.newpage", ".gridplot.hook") > > assign("cleanEx", + function(env = .GlobalEnv) { + rm(list = ls(envir = env, all.names = TRUE), envir = env) + RNGkind("default", "default") + set.seed(1) + options(warn = 1) + delayedAssign("T", stop("T used instead of TRUE"), + assign.env = .CheckExEnv) + delayedAssign("F", stop("F used instead of FALSE"), + assign.env = .CheckExEnv) + sch <- search() + newitems <- sch[! sch %in% .oldSearch] + for(item in rev(newitems)) + eval(substitute(detach(item), list(item=item))) + missitems <- .oldSearch[! .oldSearch %in% sch] + if(length(missitems)) + warning("items ", paste(missitems, collapse=", "), + " have been removed from the search path") + }, + env = .CheckExEnv) > assign("..nameEx", "__{must remake R-ex/*.R}__", env = .CheckExEnv) # for now > assign("ptime", proc.time(), env = .CheckExEnv) > grDevices::postscript("EbayesThresh-Examples.ps") > assign("par.postscript", graphics::par(no.readonly = TRUE), env = .CheckExEnv) > options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly")) > options(warn = 1) > library('EbayesThresh') > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "beta.cauchy" > > ### * beta.cauchy > > flush(stderr()); flush(stdout()) > > ### Name: beta.cauchy > ### Title: Function beta for the quasi-Cauchy prior > ### Aliases: beta.cauchy > ### Keywords: nonparametric > > ### ** Examples > > beta.cauchy(c(-2,1,0,-4,8,50)) [1] 5.972640e-01 -3.512787e-01 -5.000000e-01 1.852474e+02 1.233796e+12 [6] Inf > > > > cleanEx(); ..nameEx <- "beta.laplace" > > ### * beta.laplace > > flush(stderr()); flush(stdout()) > > ### Name: beta.laplace > ### Title: Function beta for the Laplace prior > ### Aliases: beta.laplace > ### Keywords: nonparametric > > ### ** Examples > > beta.laplace(c(-2,1,0,-4,8,50)) [1] 8.898520e-01 -3.800417e-01 -5.618178e-01 2.854595e+02 1.026981e+12 [6] Inf > beta.laplace(c(-2,1,0,-4,8,50), a=1) [1] 8.908211e-01 -1.626583e-01 -3.443205e-01 1.117639e+02 5.473621e+10 [6] Inf > > > > cleanEx(); ..nameEx <- "ebayesthresh" > > ### * ebayesthresh > > flush(stderr()); flush(stdout()) > > ### Name: ebayesthresh > ### Title: Empirical Bayes thresholding on a sequence > ### Aliases: ebayesthresh > ### Keywords: nonparametric > > ### ** Examples > > ebayesthresh(x=rnorm(100, c( rep(0,90), rep(5,10))), prior="cauchy", sdev=NA) [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [7] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [13] 0.0000000 -0.4290158 0.0000000 0.0000000 0.0000000 0.0000000 [19] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [25] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [31] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [37] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [43] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [49] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [55] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [61] 1.0488878 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [67] 0.0000000 0.0000000 0.0000000 0.2563102 0.0000000 0.0000000 [73] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [79] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [85] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [91] 4.0819038 5.9370291 5.8875039 5.4055977 6.3313948 5.2564720 [97] 3.2642290 4.0485316 3.3244300 4.1567699 > > > > cleanEx(); ..nameEx <- "postmean" > > ### * postmean > > flush(stderr()); flush(stdout()) > > ### Name: postmean > ### Title: Posterior mean estimator > ### Aliases: postmean postmean.laplace postmean.cauchy > ### Keywords: nonparametric > > ### ** Examples > > postmean(c(-2,1,0,-4,8,50), w=0.05, prior="cauchy") [1] -0.10182246 0.01787794 0.00000000 -3.17721877 7.75000000 49.96000000 > postmean(c(-2,1,0,-4,8,50), w=0.2, prior="laplace", a=0.3) [1] -0.48760316 0.08205447 0.00000000 -3.65861307 7.70000000 49.70000000 > > > > cleanEx(); ..nameEx <- "postmed" > > ### * postmed > > flush(stderr()); flush(stdout()) > > ### Name: postmed > ### Title: Posterior median estimator > ### Aliases: postmed postmed.laplace postmed.cauchy cauchy.medzero > ### Keywords: nonparametric > > ### ** Examples > > postmed(c(-2,1,0,-4,8,50), w=0.05, prior="cauchy") [1] 0.000000 0.000000 0.000000 -3.373474 7.751231 49.960000 > postmed(c(-2,1,0,-4,8,50), w=0.2, prior="laplace", a=0.3) [1] 0.00000 0.00000 0.00000 -3.68582 7.70000 49.70000 > > > > cleanEx(); ..nameEx <- "tfromw" > > ### * tfromw > > flush(stderr()); flush(stdout()) > > ### Name: tfromw > ### Title: Find threshold from mixing weight > ### Aliases: tfromw laplace.threshzero cauchy.threshzero > ### Keywords: nonparametric > > ### ** Examples > > tfromw(c(0.05, 0.1)) [1] 3.115212 2.816306 > > tfromw(c(0.05, 0.1), prior="cauchy", bayesfac=TRUE) [1] 3.259635 2.959740 > > > > > cleanEx(); ..nameEx <- "tfromx" > > ### * tfromx > > flush(stderr()); flush(stdout()) > > ### Name: tfromx > ### Title: Find threshold from data > ### Aliases: tfromx > ### Keywords: nonparametric > > ### ** Examples > > tfromx(x=rnorm(100, c( rep(0,90), rep(5,10))), prior="cauchy") [1] 2.379265 > > > > cleanEx(); ..nameEx <- "threshld" > > ### * threshld > > flush(stderr()); flush(stdout()) > > ### Name: threshld > ### Title: Threshold data with hard or soft thresholding > ### Aliases: threshld > ### Keywords: nonparametric > > ### ** Examples > > threshld(-5:5, 1.4, FALSE) [1] -3.6 -2.6 -1.6 -0.6 0.0 0.0 0.0 0.6 1.6 2.6 3.6 > > > > cleanEx(); ..nameEx <- "wandafromx" > > ### * wandafromx > > flush(stderr()); flush(stdout()) > > ### Name: wandafromx > ### Title: Find weight and scale factor from data if Laplace prior is used > ### Aliases: wandafromx negloglik.laplace > ### Keywords: nonparametric > > ### ** Examples > > wandafromx(rnorm(100, c( rep(0,90), rep(5,10)))) Warning in return(w, a) : multi-argument returns are deprecated $w [1] 0.1994025 $a [1] 0.3424383 > > > > cleanEx(); ..nameEx <- "wfromt" > > ### * wfromt > > flush(stderr()); flush(stdout()) > > ### Name: wfromt > ### Title: Mixing weight from posterior median threshold > ### Aliases: wfromt > ### Keywords: nonparametric > > ### ** Examples > > wfromt( c(2,3,5), prior="cauchy" ) [1] 4.229634e-01 9.337993e-02 9.315909e-05 > > > > cleanEx(); ..nameEx <- "wfromx" > > ### * wfromx > > flush(stderr()); flush(stdout()) > > ### Name: wfromx > ### Title: Find Empirical Bayes weight from data > ### Aliases: wfromx > ### Keywords: nonparametric > > ### ** Examples > > wfromx(x=rnorm(100, c( rep(0,90), rep(5,10))), prior="cauchy") [1] 0.2772026 > > > > ### *