Package: pitw 0.0.1

Rob Challen

pitw: PIT-Wasserstein Metrics for Diagnosing Dispersion Miscalibration

Implements the PIT-Wasserstein family of metrics for diagnosing dispersion miscalibration in probabilistic estimators. The package provides three nested metrics—B_pit (baseline), U_pit (bias-adjusted undirected), and D_pit (bias-adjusted signed, detecting overconfidence vs. underconfidence)—each with a significance test based on a large-sample reference distribution for independent predictions. Also provides batch scoring, CRPS calculation, simulation helpers, and diagnostic visualisation tools.

Authors:Rob Challen [aut, cre]

pitw_0.0.1.tar.gz
pitw_0.0.1.zip(r-4.7-any)pitw_0.0.1.zip(r-4.6-any)pitw_0.0.1.zip(r-4.5-any)
pitw_0.0.1.tgz(r-4.6-any)pitw_0.0.1.tgz(r-4.5-any)
pitw_0.0.1.tar.gz(r-4.7-any)pitw_0.0.1.tar.gz(r-4.6-any)
pitw_0.0.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION
card.svg |card.png
pitw/json (API)

# Install 'pitw' in R:
install.packages('pitw', repos = c('https://ai4ci.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/ai4ci/pit-wasserstein/issues

Pkgdown/docs site:https://ai4ci.github.io

On CRAN:

Conda:

4.32 score 1 stars 71 exports 109 dependencies

Last updated from:2dabde77a8 (on 0.0.1). Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK255
source / vignettesOK562
linux-releaseOK189
macos-releaseOK127
macos-oldrelOK134
windows-develOK120
windows-releaseOK111
windows-oldrelOK94
wasm-releaseOK191

Exports:%>%b_pit_significancecalibrated_locationscalibrated_locations_generalconfiguration_plotcrps_fn_generatord_pit_significancedbeta2dcgammaddistdgamma2dgamma4dlnorm2dlnorm4dlogitnormdlogitnorm2dnbinom2dnorm4dnulldwedgegenerate_simulationp_l1_bridgepbeta2pcgammapdistpgamma2pgamma4pit_wplnorm2plnorm4plogitnormplogitnorm2pnbinom2pnorm4pnullprediction_scorespwedgeq_l1_bridgeqbeta2qcgammaqdistqgamma2qgamma4qlnorm2qlnorm4qlogitnormqlogitnorm2qnbinom2qnorm4qnullqwedgerbernrbeta2rcategoricalrcgammardistreparam_fnrexpgrowthrexpgrowthI0rgamma2rgamma4rlnorm2rlnorm4rlogitnormrlogitnorm2rnbinom2rnorm4rnullrwedgestd_sizeu_pit_significance

Dependencies:askpassassertthatbase64encbitbit64brewbriobslibcachemcallrclicliprcommonmarkcpp11crayoncurldata.tabledescdiffobjdigestdplyrevaluatefansifarverfastmapflextablefontawesomefontBitstreamVerafontLiberationfontquiverforcatsfsgdtoolsgenericsggplot2gluegtablehighrhmshtmltoolshuxtableinterfacerisobandjquerylibjsonliteknitrlabelinglifecyclelobstrmagrittrMASSmemoisemimeofficeropensslotelpdftoolspillarpkgbuildpkgconfigpkgloadpraiseprettyunitsprocessxprogresspspurrrqpdfR6raggrappdirsRColorBrewerRcppRcppArmadillordtoolsreadrrlangrmarkdownroxygen2rprojrootrstudioapirsvgS7sassscalesscoringRulesstringistringrsvglitesyssystemfontstestthattextshapingtibbletidyrtidyselecttinytextzdbutf8uuidvctrsviridisLitevroomwaldowithrxfunxml2yamlzip

A PIT-Wasserstein study using SIR dynamics and EpiEstim
Purpose | 1. Simulation setup | Population sizes and observed counts | 2. Estimating $R_t$ with EpiEstim | 3. Scoring | 4. Results | Interpretation | Scope of the comparison

Last update: 2026-11-25
Started: 2026-11-18

Getting started with pitw
Score a set of forecasts | Read the vignettes in order

Last update: 2026-11-25
Started: 2026-11-20

Introduction to calibration and probability integral transforms
An estimator and its predictions | Location bias and predictive spread | Variation in predictive spread | The probability integral transform | Where next

Last update: 2026-11-25
Started: 2026-11-18

Model misspecification: what the metrics do when the predictive family is wrong
1. Matching the median and coefficient of variation | 2. Scores by predictive family | 3. Comparing changes in shape and width | 4. Bias adjustment with skewed errors | 5. Scope of the comparison

Last update: 2026-11-25
Started: 2026-11-19

PIT-Wasserstein metrics for miscalibration diagnosis
1. The simulation | 1.1 The error-function model | 1.2 The parameter sweep | 2. The metrics | 3. Figure 1 | 3.5 Comparison with interval coverage

Last update: 2026-11-25
Started: 2026-11-18

Significance testing for the PIT-Wasserstein metrics
1. The reference distribution for uniform PIT values | 1a. The empirical process | 1b. Comparing goodness-of-fit statistics | 1c. The effect of estimating a location shift | 2. The three metrics, and the three hypotheses | 3. The null of B_pit: an explicit formula | 4. The Gaussian limit of D_pit | 5. The reference distribution for adjusted PIT values | 6. Choosing a scale for the adjustment | 6a. Link-scale and probit adjustments | 6b. Directed scores after fitting the shift | 7. What exactly is the null hypothesis? | 8. Reading the three tests together | 9. In practice | 10. Caveats | Summary

Last update: 2026-11-25
Started: 2026-11-17

Testing for bias, dispersion miscalibration and skill spread decoupling
1. Separation at fixed sample sizes (Figure 2) | 2. Power against sample size (Figure 3)

Last update: 2026-11-25
Started: 2026-11-18

Readme and manuals

Help Manual

Help pageTopics
Significance test for the baseline PIT-Wasserstein metricb_pit_significance
Uniform predictions for testingcalibrated_locations
Uniform predictions for testing (general)calibrated_locations_general
Produce a summary plot of a experimental configuration.configuration_plot
Generate a CRPS calculating function based on a parametrised distribution namecrps_fn_generator
Significance test for the directed PIT-Wasserstein metricd_pit_significance
The Beta Distributiondbeta2
Density: gamma distribution constrained to have mean > sddcgamma
Density function a named distributionddist
The Gamma Distributiondgamma2
The Gamma Distributiondgamma4
The Log-Normal Distributiondlnorm2
The Log-Normal Distributiondlnorm4
Logit-normal distributiondlogitnorm
Logit-normal distributiondlogitnorm2
The Negative Binomial Distributiondnbinom2
The Normal Distributiondnorm4
Null distributions always returns NAdnull
Wedge distributiondwedge
Generate an set of scenarios for testing scoringgenerate_simulation
Distribution of the L1 norm of the Brownian bridgep_l1_bridge q_l1_bridge
The Beta Distributionpbeta2
Cumulative probability: gamma distribution constrained to have mean > sdpcgamma
Cumulative probability from a named distributionpdist
The Gamma Distributionpgamma2
The Gamma Distributionpgamma4
Calculate a pit-wasserstein value for a single estimatorpit_w
The Log-Normal Distributionplnorm2
The Log-Normal Distributionplnorm4
Logit-normal distributionplogitnorm
Logit-normal distributionplogitnorm2
The Negative Binomial Distributionpnbinom2
The Normal Distributionpnorm4
Null distributions always returns NApnull
Score a parametrised probability distributionprediction_scores
Wedge distributionpwedge
The Beta Distributionqbeta2
Quantile: gamma distribution constrained to have mean > sdqcgamma
Quantile function of a named distributionqdist
The Gamma Distributionqgamma2
The Gamma Distributionqgamma4
The Log-Normal Distributionqlnorm2
The Log-Normal Distributionqlnorm4
Logit-normal distributionqlogitnorm
Logit-normal distributionqlogitnorm2
The Negative Binomial Distributionqnbinom2
The Normal Distributionqnorm4
Null distributions always returns NAqnull
Wedge distributionqwedge
A random Bernoulli sample as a logical valuerbern
The Beta Distributionrbeta2
Sampling from the multinomial equivalent of the Bernoulli distributionrcategorical
Sampling: gamma distribution constrained to have median > sdrcgamma
Random sample from a named distributionrdist
Get a converter that maps an unusual parametrisation to a canonical one.reparam_fn
Randomly sample incident times in an exponentially growing processrexpgrowth
Randomly sample incident times in an exponentially growing process with initial case loadrexpgrowthI0
The Gamma Distributionrgamma2
The Gamma Distributionrgamma4
The Log-Normal Distributionrlnorm2
The Log-Normal Distributionrlnorm4
Logit-normal distributionrlogitnorm
Logit-normal distributionrlogitnorm2
The Negative Binomial Distributionrnbinom2
The Normal Distributionrnorm4
Null distributions always returns NArnull
Wedge distributionrwedge
Standard image and paper sizesstd_size
Significance test for the bias-adjusted undirected PIT-Wasserstein metricu_pit_significance
Wedge distributionwedge