tfromw {ebayesthresh}R Documentation

Find threshold from mixing weight

Description

Given a weight or vector of weights (i.e. prior probabilities that the parameter is nonzero), find the corresponding threshold(s) under the specified prior.

Usage

tfromw(w, prior = "laplace", bayesfac = FALSE, a = 0.5)

Arguments

w prior weight or vector of weights
prior specification of prior to be used; can be "cauchy" or "laplace"
bayesfac specifies whether Bayes factor threshold should be used instead of posterior median threshold
a scale factor if Laplace prior is used. Ignored if Cauchy prior is used.

Details

The Bayes factor method uses a threshold such that the posterior probability of zero is exactly half if the data value is equal to the threshold. If bayesfac is set to FALSE (the default) then the threshold is that of the posterior median function given the data value.

The routine carries out a binary search over an appropriate function, using the routine vecbinsolv. The function to be zeroed is beta.laplace or beta.cauchy if the Bayes factor threshold is to be found, and laplace.threshzero or cauchy.threshzero for the posterior median threshold.

Value

The value or vector of values of the estimated threshold(s).

Author(s)

Bernard Silverman

References

See ebayesthresh and http://www.bernardsilverman.com

See Also

wfromx,tfromx,wandafromx

Examples

tfromw(c(0.05, 0.1)) 

tfromw(c(0.05, 0.1), prior="cauchy", bayesfac=TRUE)


[Package Contents]