R: Find thresholds from data

tfromx {EbayesThresh} | R Documentation

## Find thresholds from data

### Description

Given a vector of data and standard deviations (sd equals 1 for Cauchy prior), find the value or vector (heterogeneous sampling standard deviation with Laplace prior) of thresholds corresponding to the marginal maximum likelihood choice of weight.

### Usage

      tfromx(x, s = 1, prior = "laplace", bayesfac = FALSE, a = 0.5,
             universalthresh = TRUE)

### Arguments

`x` | Vector of data.
`s` | A single value or a vector of standard deviations if the Laplace prior is used. If a vector, must have the same length as `x`. Ignored if Cauchy prior is used.
`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.
`universalthresh` | If `universalthresh = TRUE`, the thresholds will be upper bounded by universal threshold; otherwise, the thresholds can take any non-negative values.

### Details

First, the routine `wfromx` is called to find the estimated weight. Then the routine `tfromw` is used to find the threshold. See the documentation for these routines for more details.

### Value

The numerical value or vector of the estimated thresholds is returned.

### Author(s)

Bernard Silverman

### References

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

### See Also

`tfromw`, `wfromx`

### Examples

    tfromx(x = rnorm(100, c(rep(0,90),rep(5,10))), prior = "cauchy")

[Package EbayesThresh version 1.4-12 Index]