Learn R Programming

gren (version 0.0.1)

denet: The elastic net prior distribution

Description

Density function and random number generator for the elastic net prior distribution.

Usage

denet(x, lambda1=1, lambda2=1, log=FALSE)

renet(n, lambda1=1, lambda2=1)

Arguments

x

vector of quantiles

n

number of samples

lambda1

lambda1 parameter value

lambda2

lambda2 parameter value

log

should the logarithm of the density be returned

Value

denet gives the density of the input x. renet gives a vector of length n of random values.

Details

The elastic net prior density has density: $$f(x)=g(\lambda_1,\lambda_2) e^[-0.5*(\lambda_1 |x| + \lambda_2 x^2)]$$

References

M<U+00FC>nch, M.M., Peeters, C.F.W., van der Vaart, A.W., and van de Wiel, M.A. (2018). Adaptive group-regularized logistic elastic net regression. arXiv:1805.00389v1 [stat.ME].

Examples

Run this code
# NOT RUN {
## Create data
n <- 100
x <- renet(n)
hist(x)

## Calculate density
dens <- denet(x)
plot(sort(x), dens[order(x)])
# }

Run the code above in your browser using DataLab