tfromx

 

Find threshold from data

 

DESCRIPTION

 

Given a vector of data, find the threshold corresponding to the marginal maximum likelihood choice of weight.

 

USAGE

 

tfromx(w,prior,bayesfac,a)

 

REQUIRED ARGUMENTS

 

w a mixing weight

OPTIONAL ARGUMENTS

 

prior specification of the prior to be used; can be 'cauchy' or 'laplace'
a If the Laplace prior is used, a is the scale factor. If the Cauchy prior is used, a is ignored.
bayesfac If 1 the threshold is found using the Bayes factor method, so that the posterior probability of zero is exactly half if the data are equal to the threshold. If 0 (the default), the threshold is that of the posterior median function given the data value

 

VALUE 

 

The numerical value of the threshold is returned.

BACKGROUND

First, the routine wfromx is called to find the estimated weight. Then the routine tfromw is used to find the threshold.

 

SEE ALSO

 

tfromw, wfromx.

 

EXAMPLES

 

threshold=tfromx(x);