turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Specifying half-cauchy (hyper)prior in PROC MCMC

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-26-2013 09:19 AM

Dear all,

has someone tried to specify a half-cauchy hyperprior in PROC MCMC (I suppose it would likely be the same in any other procedure)?

I am trying to get something like this to work (in order to get a horseshoe shrinkage estimator):

hyperprior lambda ~ halfcauchy(0,1);

hyperprior tau ~ some other distribution;

hyperprior sigma ~ some other distribution;

prior theta ~ normal(0,sd=lambda*tau);

model y ~ normal( theta, sd=sigma);

The standard distributions do not seem to include the half-cauchy, so I tried to get it by specifying

hyperprior lambda ~ cauchy(0,1);

...

prior theta ~ normal(0,sd=abs(lambda)*tau);

...

But if I do that, I get (presumably because the support of lambda includes zero)

ERROR: The NORMAL distribution of beta1 is invalid. It has a nonpositive variance, standard deviation, or precision parameter 0. Use an appropriate parameter value instead.

How do I get something like this to work? If you happen to know the answer, your help would be appreciated.

Many thanks,

Björn

Accepted Solutions

Solution

05-02-2013
11:32 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-02-2013 11:32 AM

I asked someone smarter than I am about this. He informed me that the initial value for the PROC MCMC simulation is based on the mode of the prior distribution. For the Cauchy, the mode is zero, which leads to the error.

You can either explicitly set an initial value, such as

PARM lambda 1;

or you can move the lower limit of the Cauchy distribution away from zero by using an expression like

lambda ~ cauchy(0, 1, lower=1e-12);

The second choice will bound lambda away from zero, which might be a reasonable thing to do.

All Replies

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-26-2013 09:26 AM

It's strange that you encounter the error, since the probability that you would get an exact zero during a run is exceedingly small. Are you sure it isn't tau that is causing the problem?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-26-2013 10:50 AM

Thanks for the idea, I tried this with

hyperprior tau ~ igamma(1, scale = 1);

so I would have assumed that is not the issue.

I am not sure whether the error message means that you truly get =0 in a run, or whether it is related to some checking that SAS does regarding whether support of the prior includes 0 (with certain priors getting special handling with a >0 restriction)? I'm purely speculating in this respect as I do not really know how SAS handles that.

Solution

05-02-2013
11:32 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-02-2013 11:32 AM

I asked someone smarter than I am about this. He informed me that the initial value for the PROC MCMC simulation is based on the mode of the prior distribution. For the Cauchy, the mode is zero, which leads to the error.

You can either explicitly set an initial value, such as

PARM lambda 1;

or you can move the lower limit of the Cauchy distribution away from zero by using an expression like

lambda ~ cauchy(0, 1, lower=1e-12);

The second choice will bound lambda away from zero, which might be a reasonable thing to do.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-03-2013 05:05 AM

Thanks a lot, specifying a positive initial value using the PARM statement was indeed the solution!