Thoughts on prior for df in student_t?

32 views
Skip to first unread message

Mike Lawrence

unread,
Feb 22, 2017, 10:35:15 PM2/22/17
to stan-...@googlegroups.com
I'm modelling a scenario where I suspect that data are student-t distributed and I want to do inference not only on the mean & sd as is typical, but also on the df. So I might have a model like:

  data{
    int N;
    vector[N] y ;
  }
  parameters{
    real mu ;
    real<lower=0> sigma ;
    real<lower=0> nu ;
  }
  model{
    y ~ student_t( nu , mu , sigma ) ;
    mu ~ normal( 0 , 1 ) ;
    sigma ~ weibull( 2 , 1 ) ;
    nu ~ ?;
  }

What might be a reasonable prior on nu? 

One thought is that values for nu greater than about 30 really don't differentiate from each other in terms of the resulting form of the student-t, so should I put a hard upper bound at 30? 

And should the lower bound be 0, or 1? I know that nu=1 is the cauchy, but I don't know that values of nu less than one even make sense. 

Thanks in advance for your thoughts.

Mike

--
Mike Lawrence
Graduate Student
Department of Psychology & Neuroscience
Dalhousie University

~ Certainty is (possibly) folly ~

Bob Carpenter

unread,
Feb 22, 2017, 11:05:21 PM2/22/17
to stan-...@googlegroups.com
Artificial hard upper bounds are almost always a bad idea.
If you guess wrong and there's any measurable mass above
the bound, you essentially get both biased estimates and
a computational problem as you try to run off to infinity
on the unconstrained scale. But if the data's normal,
that's exactly what your estimate of nu is going to try to do.

Someone else probably knows how much data we need to estimate
nu, but you may want to do some experiments yourself by
simulating from a student t with various nu and seeing what
you get for estimates.

I'm also not sure what it means to have nu < 1. It seems
like the Cauchy is a reasonable lower-bound on fatness of
tails. Please let me know if that's not right! In Stan,
that constraint would be:

parameters {
real<lower = 1> nu;

But then it might also make sense to put a prior
on 1 / nu and transform (even a uniform) and transform:

parameters {
real<lower = 0, upper = 1> inv_nu;
...

transformed parameters {
real<lower = 1> nu = inv(inv_nu);
...

I never got a proper stats education, so I have to work out what we
get from first principles with the Jacobian adjustment to the transformed
uniform:

If

X ~ uniform(0, 1);

and

Y = 1 / X

then

Y in (1, infinity)

and

p_Y(y) = |d/dy 1/y| uniform(1/y | 0, 1)

= 1 / y^2

Now that looks familiar.

https://en.wikipedia.org/wiki/Pareto_distribution

It's just Pareto(1, 1). And the Wikipedia neatly summarizes that
if Y ~ Pareto(1, 1), then

Pr[Y > y] = 1 / y

In Stan you can code the Pareto up directly:

parameters {
real<lower = 1> nu;

model {
nu ~ pareto(1, 1);

No idea if that's a good idea, but it let me do some math
exercises on our mailing list. Hope I didn't botch something.

- Bob
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Aki Vehtari

unread,
Feb 23, 2017, 4:22:23 PM2/23/17
to Stan users mailing list
See our "Prior Choice Recommendations" wiki page and search for Prior for degrees of freedom in Student's t distribution, which says
A recommended easy default option is
nu ~ gamma(2,0.1);
This was proposed and anlysed by Juárez and Steel (2010) (Model-based clustering of non-Gaussian panel data based on skew-t distributions. Journal of Business & Economic Statistics 28, 52–66.). Juárez and Steel compare this to Jeffreys prior and report that the difference is small. Simpson et al (2014) (arXiv:1403.4630) propose a theoretically well justified "penalised complexity (PC) prior", which they show to have a good behavior for the degrees of freedom, too. PC prior might be the best choice, but requires numerical computation of the prior (which could computed in a grid and interpolated etc.). It is available as INLA:::inla.pc.ddof for dof>2 and a standardized Student's-t. It would be feasible to implement it in Stan, but it would require some work. Unfortunately no-one has compared PC prior and this gamma prior directly, but based on the discussion with Daniel Simpson, although PC prior would be better this gamma(2,0.1) prior is not a bad choice. Thus, I would use it until someone implements the PC prior for degrees of freedom of the Student's t in Stan.

Like Bob, I also recommend adding a lower limit with a constraint in the parameter declaration (and add this to wiki, too)

It's possible that Pareto with some parameters could be close to the gamma(2,0.1) recommended above

Aki

Mike Lawrence

unread,
Feb 23, 2017, 4:35:25 PM2/23/17
to stan-...@googlegroups.com
Thanks to you both, and sorry for not remembering to look at the prior recommendations wiki page in the first place! 


--
You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
To post to this group, send email to stan-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Andrew Gelman

unread,
Feb 23, 2017, 4:37:38 PM2/23/17
to stan-...@googlegroups.com, Daniel Simpson
The wiki will soon be a published paper, I hope!
A
Reply all
Reply to author
Forward
0 new messages