R: Compute a rectangular simultaneous confidence set from a...
SCSrank
R Documentation
Compute a rectangular simultaneous confidence set from a sample of a joint empirical distribution.
Description
Given a large sample of N values from an M dimensional joint empirical distribution, the rank based method of Besag et al. (1995) is used to compute a rectangular M-dimensional 'confidence' set
that includes N*conf.level values of the sample.
Usage
SCSrank(x, conf.level = 0.95, alternative = "two.sided", ...)
Arguments
x
an N x M matrix containg N sampled values of the M dimensional distribution of interest
conf.level
the simultaneous confidence level, a single numeric value between 0 and 1, defaults to 0.95 for simultaneous 95 percent sets
alternative
a single character string related to hypotheses testing, "two.sided" invokes two-sided confidence sets, "less" invokes sets with upper limits only and "greater" invokes sets with lower limits only,
...
currently ignored
Value
an Mx2 (alternative="two.sided") matrix containing the lower and upper confidence limist for the M dimensions,
in case of alternative="less", alternative="greater" the lower and upper bounds are replaced by -Inf and Inf, respectively.
Author(s)
Frank Schaarschmidt
References
Besag J, Green P, Higdon D, Mengersen K (1995). Bayesian Computation and Stochastic Systems. Statistical Science 10, 3-66.
Mandel M, Betensky RA. Simultaneous confidence intervals based on the percentile bootstrap approach. Computational Statistics and Data Analysis 2008; 52(4): 2158-2165.
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
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(MCPAN)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/MCPAN/SCSrank.Rd_%03d_medium.png", width=480, height=480)
> ### Name: SCSrank
> ### Title: Compute a rectangular simultaneous confidence set from a sample
> ### of a joint empirical distribution.
> ### Aliases: SCSrank
> ### Keywords: htest
>
> ### ** Examples
>
>
> x <- cbind(rnorm(1000,1,2), rnorm(1000,0,2), rnorm(1000,0,0.5), rnorm(1000,2,1))
> dim(x)
[1] 1000 4
> cm <- rbind(c(-1,1,0,0), c(-1,0,1,0), c(-1, 0,0,1))
> xd <- t(apply(x, 1, function(x){crossprod(t(cm), matrix(x))}))
> pairs(xd)
>
> SCSrank(xd, conf.level=0.9)
$conf.int
lower upper
[1,] -6.709783 4.539878
[2,] -5.456775 3.006684
[3,] -3.628381 5.210104
attr(,"k")
[1] 900
attr(,"N")
[1] 1000
$conf.level
[1] 0.9
$alternative
[1] "two.sided"
>
>
>
>
>
>
> dev.off()
null device
1
>