postmed {EbayesThresh} | R Documentation |
Given a data value or a vector of data, find the corresponding posterior median estimate(s) of the underlying signal value(s)
postmed(x, w, prior = "laplace", a = 0.5)
x |
a data value or a vector of data |
w |
the value of the prior probability that the signal is nonzero |
prior |
family of the nonzero part of the prior; can be "cauchy" or "laplace" |
a |
the scale parameter of the nonzero part of the prior if the Laplace prior is used |
The routine calls the relevant one of the routines postmed.laplace
or postmed.cauchy
.
In the Laplace case, the posterior median is found explicitly, without any need for the numerical solution of an equation.
In the quasi-Cauchy case, the posterior median is found by finding the zero,
component by component, of the vector function cauchy.medzero
.
If x is a scalar, the posterior median med(theta|x) where theta is the mean of the distribution from which x is drawn. If x is a vector with elements x_1, ... , x_n, then the vector returned has elements med(theta_i|x_i), where each x_i has mean theta_i, all with the given prior.
If the quasicauchy prior is used, the argument a
is ignored.
The routine calls the approprate one of postmed.laplace
or postmed.cauchy
.
Bernard Silverman
See ebayesthresh
and http://www.bernardsilverman.com
postmed(c(-2,1,0,-4,8,50), w=0.05, prior="cauchy") postmed(c(-2,1,0,-4,8,50), w=0.2, prior="laplace", a=0.3)