View source: R/03-beta-bayes.R
ebCorrelation-class | R Documentation |
Fit an empirical Bayes model to detemine which values in a large collection of correlation coefficients are significant.
ebCorrelation(ss, nObs, nPoints = 500)
## S4 method for signature 'ebCorrelation'
hist(x,
xlab='Correlation', ylab='Prob(Different | Y)', main='',
highlight='purple', lowlight='blue', ...)
## S4 method for signature 'ebCorrelation,missing'
plot(x,
prior=1, significance=0.9, ylim=c(-0.5, 1),
xlab='Correlation', ylab='Prob(Unusual | Rho)',
highlight='purple', ...)
## S4 method for signature 'ebCorrelation'
summary(object, prior=1, significance=0.9, ...)
## S4 method for signature 'ebCorrelation'
cutoffSignificant(object, prior, significance, ...)
## S4 method for signature 'ebCorrelation'
selectSignificant(object, prior, significance, ...)
## S4 method for signature 'ebCorrelation'
countSignificant(object, prior, significance, ...)
ss |
A numerical vector containing correlation coefficinets between -1 and 1. |
nObs |
A numerical vector of length one, the number of objects used in every computation of correlation coefficients. |
nPoints |
the number of points at which to estimate the distribution. |
object |
object of class |
x |
object of class |
xlab |
Graphical parameter. |
ylab |
Graphical parameter. |
ylim |
Graphical parameter. |
main |
Graphical parameter. |
... |
Optional extra parameters, either graphical or for the significance functions. |
prior |
A real number between 0 and 1; the prior probability that a correlation coefficinet is not significant. |
significance |
A real number between 0 and 1; the posterior probability betyond which a correlation coefficinet will be called significant. |
highlight |
Character string denoting a color. |
lowlight |
Character string denoting a color. |
TBD
The ebCorrelation
constructor returns an object of the indicated
class.
TBD
Although objects can be created directly using new
, the most
common usage will be to pass a vector of correlation coefficients to the
ebCorrelation
function.
correlation
:numeric vector of correlation coefficients.
nObservation
:the number of sample observations used to compute correlations.
xvals
:vector of the x-axis grid points at which to compute the posterior probability; see Details.
pdf
:vector of the ermpirically estimated probability densities
at xvals
; see Details.
theoretical.pdf
:vector of the theoretical probability densities
at xvals
; see Details.
unravel
:Matrix of posterior probabilities.
call
:A call
object recording how the
constructior function was invoked.
Prints a summary of the ebCorrelation object. This includes (1) the maximum a posterior coordinates on x-y-space, (2) the usual alpha-beta parameters for the Beta distribution, and (3) the mean and variance.
Plots an ikmage of the posterior probabilities using te specified color map. The point with the maximum posterior probability is marked in red.
Kevin R. Coombes krc@silicovore.com
Efron's paper on empirical Bayes for differential exprewssion.
showClass("ebCorrelation")
set.seed(12345)
cc <- c(rbeta(4600, 24, 24), rbeta(400, 8, 8))
rr <- 2*cc-1
fit <- ebCorrelation(rr, 51)
hist(fit)
plot(fit, prior = 0.85)
countSignificant(fit, prior = 0.85, significance = 0.8)
cutoffSignificant(fit, prior = 0.85, significance = 0.8)
summary(fit)
summary(fit, prior = 0.85, significance = 0.8)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.