Why not use a binomial rather than Poisson in that case?
And are you explicitly looking at change-point models?
- Bob
> On Mar 1, 2017, at 6:48 AM, Eric Innocents EBOULET <
ericinnoce...@gmail.com> wrote:
>
>
> Hi users,
>
> I consider the stan code in page 203 in the manuel. This code is below :
>
> If I consider that lower of Dt is 0 and upper is 100, how should I write lp[s], including these constraints ?
> data {
> real<lower=0> r_e;
> real<lower=0> r_l;
> int<lower=1> T;
> int<lower=0, upper=100> D[T];
> }
>
> transformed data {
> real log_unif;
> log_unif = -log(T);
> }
>
> parameters {
> real<lower=0> e;
> real<lower=0> l;
> }
>
> transformed parameters {
> vector[T] lp;
> lp = rep_vector(log_unif, T);
> for (s in 1:T)
> for (t in 1:T)
> lp[s] = lp[s] + poisson_lpmf(D[t] | t < s ? e : l);
> }
>
> model {
>
> e ~ exponential(r_e);
> l ~ exponential(r_l);
> target += log_sum_exp(lp);
> }
>
>
>
>
>
>
>
>
> Bests.
>
> --
> 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.