alashworth / test-issue-import

0 stars 0 forks source link

trap improper posteriors #73

Open alashworth opened 5 years ago

alashworth commented 5 years ago

Issue by bob-carpenter Sunday Jul 19, 2015 at 15:08 GMT Originally opened as https://github.com/stan-dev/stan/issues/1555


We want to be able to trap improper posteriors. Daniel just demoed this model

data {
  int<lower=0> N;
  vector[N] x;
  vector[N] y;
}
parameters {
  real a;
  real b;
  real<lower=0> sigma;
}
model {
  y ~ normal(a + b * x, sigma);
}

and it samples and gives garbage (low n_eff for a and b, but high n_eff for err_sd).

alashworth commented 5 years ago

Comment by betanalpha Sunday Jul 19, 2015 at 15:11 GMT


Isn’t this proper for any N > 1?

On Jul 19, 2015, at 4:08 PM, Bob Carpenter notifications@github.com wrote:

We want to be able to trap improper posteriors. Daniel just demoed this model

data { int N; vector[N] x; vector[N] y; } parameters { real a; real b; real sigma; } model { y ~ normal(a + b * x, sigma); } and it samples and gives garbage (low n_eff for a and b, but high n_eff for err_sd).

— Reply to this email directly or view it on GitHub.

alashworth commented 5 years ago

Comment by syclik Sunday Jul 19, 2015 at 15:45 GMT


it was for N = 0.

data <- list(N = 0, x = numeric(0), y = numeric(0))

On Sun, Jul 19, 2015 at 11:11 AM, Michael Betancourt < notifications@github.com> wrote:

Isn’t this proper for any N > 1?

On Jul 19, 2015, at 4:08 PM, Bob Carpenter notifications@github.com wrote:

We want to be able to trap improper posteriors. Daniel just demoed this model

data { int N; vector[N] x; vector[N] y; } parameters { real a; real b; real sigma; } model { y ~ normal(a + b * x, sigma); } and it samples and gives garbage (low n_eff for a and b, but high n_eff for err_sd).

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/stan-dev/stan/issues/1555#issuecomment-122671099.