Your description of the model seems reasonable. As I understand it, there is
censoring both above and below, but no truncation.
The best thing to do to understand these models is to write out the
densities.
1. Censoring below.
For species with a survival time recorded as 1, the value might
be anywhere between 0 and 1. If there are N_censored_below observations,
you just need
increment_log_prob(N_censored_below * weibull_cdf_log(1, alpha, sigma));
Note this uses the CDF, not the CCDF, because it's the total probability from
0 (the lower bound of support for Weibull) to 1.
2. Censoring above.
For the species still alive, you need to know when they originated to know
what the censoring point is --- if species n arose (no idea what the
right term is here) at time t_origin[n] and is not yet
extinct at t_current, then you know the survival time is somewhere
above (t_current - t_origin[n]). For each such observation, you censor with
its own bounds. In Stan:
for (n in 1:N_censored_above)
increment_log_prob(weibull_ccdf_log(t_current - t_origin[n], alpha, sigma);
If t_origin is a vector of size N_truncated_above, you can vectorize to
just
increment_log_prob(weibull_ccdf_log(t_current - t_origin, alpha, sigma);
This uses the CCDF because it's 1 - CDF(U) to indicate the true value is
somewhere above U.
3. Uncensored
For species with survival time greater than 1 who are extinct, there's no
truncation needed. In Stan, in vector form, that's
dur_unc ~ weibull(alpha, sigma);
4. Priors
I have no idea what the scale of survival times is, but you want
the priors to be consistent with the expected posteriors. Especially
when you don't have a lot of data. There's a relevant section
in the regression chapter of the current (v2.5) Stan language manual that discusses
priors for scales --- the same arguments apply here. Also, with gamma, you
should double check the parameterization --- we use shape and inverse scale (aka rate).
- 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.
> For more options, visit
https://groups.google.com/d/optout.
> <minimal_data.txt><zero_weibull.stan>