Skip to content
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

Consider adding feature to truncate delay to given percent of total mass #66

Open
athowes opened this issue Sep 13, 2024 · 5 comments
Open
Labels
enhancement New feature or request question Further information is requested

Comments

@athowes
Copy link
Contributor

athowes commented Sep 13, 2024

Similar to what I've done here:

cmf_cowling <- ppcens(
  q = 0:round(5 * gi_mean_cowling),
  pdist = pgamma,
  shape = gamma_shape(gi_mean_cowling, gi_sd_cowling),
  scale = gamma_scale(gi_mean_cowling, gi_sd_cowling),
  pwindow = 1
)

(D_cowling <- min(which(cmf_cowling > 0.99)) - 1)

pmf_cowling <- dpcens(
  x = 0:(D_cowling - 1),
  pdist = pgamma,
  shape = gamma_shape(gi_mean_cowling, gi_sd_cowling),
  scale = gamma_scale(gi_mean_cowling, gi_sd_cowling),
  pwindow = 1,
  swindow = 1,
  D = D_cowling
)

Of course the 0.99 can be a parameter. And I used q = 0:round(5 * gi_mean_cowling) as I thought that'd ensure 0.99 was in there, but might need another solution here.

This function could be useful for users who want a shorter delay PMF.

@seabbs seabbs added enhancement New feature or request question Further information is requested labels Sep 14, 2024
@seabbs
Copy link
Contributor

seabbs commented Sep 14, 2024

Thanks @athowes. I agree that I can see a use for this. I am not totally clear how this would be communicated (especially in light of #63) so do you have a suggestion?

I think this would definitely be something to restrict to the R side vs trying to extend it to the stan code.

@seabbs
Copy link
Contributor

seabbs commented Oct 4, 2024

I'm still not clear how to communicate or provide an interface for this. Perhaps via a helper function that does this vs including it directly?

@seabbs
Copy link
Contributor

seabbs commented Oct 4, 2024

@zsusswein, sbfnk, and @jamesmbaazam I imagine you might have some thoughts on what this should look like given you've all implemented this kind of thing in various places.

@zsusswein
Copy link

I may be missing something but this feels like a job for qpcens()?

@seabbs
Copy link
Contributor

seabbs commented Oct 7, 2024

Good point so the flow would be qpcens() for D and then use dpcens() vs what I think the request was which is a single wrapper function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants