Open
Conversation
Proper, scale-invariant ScalarDistribution on [lower, upper] with lower > 0. Density 1/(x log(upper/lower)); equivalent to Uniform on log(x). Intended as the defensible replacement for the improper OneOnX prior on strictly positive quantities (popSize, rates, variances), which was deliberately not migrated to the spec types (see existing comment in version.xml). Apache Commons Statistics has no reciprocal distribution, so ContinuousDistribution is implemented inline with closed-form density, CDF, inverse CDF, mean, variance, and inverse-CDF sampler. Registered in module-info.java and version.xml as a BEASTInterface service provider. 8 tests covering closed-form density, support, CDF/quantile round-trip, log-space median, mean, XML parse, and rejection of degenerate bounds.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
LogUniformas a proper, scale-invariantScalarDistributionfor strictly positive quantities — the defensible replacement for the improperOneOnXprior, which was deliberately not migrated to the spec types (see existing note inversion.xml:226).p(x) = 1 / (x * log(upper/lower))on[lower, upper], equivalent toUniformonlog(x).ContinuousDistributionis implemented inline with closed-form density, CDF, inverse CDF, mean, variance, and inverse-CDF sampler.lower,upperareRealScalar<PositiveReal>; the distribution validates0 < lower < upper < infinityinrefresh().BEASTInterfaceservice provider in bothmodule-info.javaandversion.xml.Motivation
FLC's beast3 migration (4ment/flc#10) uses
OneOnXon the coalescentpopSize; that block is currently commented out becauseOneOnXhas no spec-type counterpart.LogUniformon e.g.[1e-6, 1e6]gives twelve orders of magnitude of scale-invariant prior support — behaviourally equivalent for typical molecular-clock analyses, philosophically cleaner (proper, integrable, has a CDF and quantile), and usable anywhereScalarDistributionis expected.Test plan
LogUniformTest(8 tests): closed-form density, zero outside support, CDF/quantile round-trip (1000 random pairs), log-space median equals sqrt(ab), mean formula,calculateLogPvia param, XML parse, rejection of degenerate boundsbeast-basesuite: 399 tests, 0 failures, 0 errorsLogUniformforpopSizeprior in FLC example XML