Skip to content

Rejection Sampling - PMF Mean and Shift Bug #39

@danmcgraw94

Description

@danmcgraw94

Describe the bug
Incorrectly handles pmf_mean and pmf_shift.

To Reproduce

pmf_sigma <- 0.5
pmf_shift <- 239
pmf_mean  <- 241.9
pmf_mu    <- log(pmf_mean - pmf_shift) - (pmf_sigma^2 / 2)
pmf_stage_lognormal(pmf_shift, pmf_mean)
#> Error in `pmf_stage_lognormal()`:
#> ! could not find function "pmf_stage_lognormal"
pmf_stage_lognormal(pmf_mean, pmf_shift)
#> Error in `pmf_stage_lognormal()`:
#> ! could not find function "pmf_stage_lognormal"

Created on 2026-05-18 with reprex v2.1.1

Expected behavior
Error handling that prevents the log of a negative number

Actual behavior
Instead the functions only allow for pmf_shift > pmf_mean, only producing NaNs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions