beta.laplace: Function beta for the Laplace prior

Description Usage Arguments Value Note Author(s) References See Also Examples

View source: R/beta.laplace.R

Description

Given a single value or a vector of x and s, find the value(s) of the function beta(x;s,a) = g(x;s,a)/fn(x;0,s) - 1 , where fn(x;0,s) is the normal density with mean 0 and standard deviation s, and g is the convolution of the Laplace density with scale parameter a, gamma(mu; a), with the normal density fn(x;mu,s) with mean mu and standard deviation s.

Usage

1
beta.laplace(x, s = 1, a = 0.5)

Arguments

x

the value or vector of data values

s

the value or vector of standard deviations; if vector, must have the same length as x

a

the scale parameter of the Laplace distribution

Value

A vector of the same length as x is returned, containing the value(s) beta(x).

Note

The Laplace density is given by gamma(u) = (a/2) exp(-a|u|) and is also known as the double exponential density.

Author(s)

Bernard Silverman

References

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

See Also

beta.cauchy

Examples

1
2
beta.laplace(c(-2,1,0,-4,8,50), s=1)
beta.laplace(c(-2,1,0,-4,8,50), s=1:6, a=1)

Example output

[1]   8.898520e-01  -3.800417e-01  -5.618178e-01   2.854595e+02   1.026981e+12
[6]  6.344540e+265
[1]   0.890821055  -0.129919250  -0.086229104  -0.005203193   0.054213718
[6] 112.493576777

EbayesThresh documentation built on May 2, 2019, 8:36 a.m.