# dlhyper: Tune the hyperparameter in the prior distribtuion In dlbayes: Use Dirichlet Laplace Prior to Solve Linear Regression Problem and Do Variable Selection

## Description

This function is to tune the value of hyperparameter in the prior, which can be [1/max(n,p),1/2]. We use the method proposed by Zhang et al. (2018). This method tune the hyperparameter by incorporating a prior on R^2. And they give a direct way to minimize KL directed divergence for special condition.

## Usage

 `1` ```dlhyper(x, y) ```

## Arguments

 `x` input matrix, each row is an observation vector, dimension n*p. Same as the argument in dlmain `y` Response variable, a n*1 vector. Same as the argument in dlmain

## Value

 `hyper` A value that can use in the following posterior computation

## Examples

 ```1 2 3 4 5 6 7 8 9``` ```p=50 n=6 #generate x x=matrix(rnorm(n*p),nrow=n) #generate beta beta=c(rep(0,10),runif(n=5,min=-1,max=1),rep(0,10),runif(n=5,min=-1,max=1),rep(0,p-30)) #generate y y=x%*%beta+rnorm(n) hyper=dlhyper(x,y) ```

dlbayes documentation built on May 2, 2019, 8:28 a.m.