-
Notifications
You must be signed in to change notification settings - Fork 37
deal with zeroes in estimate_truncation
#301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
estimate_truncation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
inst/stan/estimate_truncation.stan
Outdated
// log density of truncated latest data vs that observed | ||
for (i in 1:(obs_sets - 1)) { | ||
int start_t = t - obs_dist[i] - trunc_max[1]; | ||
for (j in 1:trunc_max[1]) { | ||
obs[start_t + j, i] ~ neg_binomial_2(trunc_obs[j, i], sqrt_phi); | ||
obs[start_t + j, i] ~ neg_binomial_2(trunc_obs[j, i] + sigma, sqrt_phi); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is initialised to a temporary variable it will be faster vs being done in the likelihood.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems mad but can just add it to trunc_obs
Merged in the (current) absence of a better solution. |
The
estimate_truncation
function currently can't deal with observed zeroes - this adds a small noise parameter to fix that