CDCgov / CDCgov/forecasttools

Handle probability mass at finite support boundaries in `quantiles_to_category_pmf()`

Open
#267 1 comment 1 reaction 1 assignee View on GitHub

@dylanhmorris is already working on this.

Since Sep 17, 2026.

Dominant language
R
Stars
5
Forks
2
Avg merge
2d 6m
Merged PRs (30d)
7

Description

library(forecasttools)
quantiles_to_category_pmf(
  quantile_levels = c(0.01, 0.25, 0.5),
  values = c(0, 0.3, 0.6),
  category_cutpoints = c(
    a = 0,
    b = 0.2,
    c = 1
  )
)
#> Error in `purrr::map()`:
#> ℹ In index: 1.
#> Caused by error in `seq.default()`:
#> ! 'from' must be a finite number

Created on 2026-09-17 with reprex v2.1.1

Here, Q(0.01)=0 implies at least (0.01) probability mass at the lower support boundary. The failure occurs because the scaled-logit transformation maps that boundary value to -Inf, which is then passed to the spline interpolation.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.