Skip to main content

PyPI Python Downloads GitHub Workflow Status GitHub codecov DOI

Dissaggregation under Generalized Proportionality Assumptions

This package disaggregates an estimated count observation into buckets based on the assumption that the rate (in a suitably transformed space) is proportional to some baseline rate.

The most basic functionality is to perform disaggregation under the rate multiplicative model that is currently in use.

The setup is as follows:

Let $D$ be an aggregated measurement across groups $1,\ldots,k$, where the population of each is $p_i,\ldots,p_k$. Let $f_1,\ldots,f_k$ be the baseline pattern of the rates across groups, which could have potentially been estimated on a larger dataset or a population in which have higher quality data on. Using this data, we generate estimates for $D_i$, the number of events in group $g_i$ and $\hat{f_{i}}$, the rate in each group in the population of interest by combining $D$ with $f_1,...,f_k$ to make the estimates self consistent.

Mathematically, in the simpler rate multiplicative model, we find $\beta$ such that

$$D = \sum_{i=1}^{k}\hat{f}_i \cdot p_i $$

Where

$$\hat{f_i} = T^{-1}(\beta + T(f_i)) $$

This yields the estimates for the per-group event count,

$$D_i = \hat f_i \cdot p_i $$

For the current models in use, T is just a logarithm, and this assumes that each rate is some constant muliplied by the overall rate pattern level. Allowing a more general transformation T, such as a log-odds transformation, assumes multiplicativity in the associated odds, rather than the rate, and can produce better estimates statistically (potentially being a more realistic assumption in some cases) and practically, restricting the estimated rates to lie within a reasonable interval.

Current Package Capabilities and Models

Currently, the multiplicative-in-rate model RateMultiplicativeModel with $T(x)=\log(x)$ and the Log Modified Odds model LMOModel(m) with $T(x)=\log(\frac{x}{1-x^{m}})$ are implemented. Note that the LMOModel with m=1 gives a multiplicative in odds model.

A useful (but slightly wrong) analogy is that the multiplicative-in-rate is to the multiplicative-in-odds model as ordinary least squares is to logistic regression in terms of the relationship between covariates and output (not in terms of anything like the likelihood)

Increasing m in the model LMOModel(m) gives results that are more similar to the multiplicative-in-rate model currently in use, while preserving the property that rate estimates are bounded by 1.

Metadata

Release files for pydisagg 0.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydisagg 0.6.2
File Size Uploaded
pydisagg-0.6.2.tar.gz 29.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pydisagg 0.6.2
File Interpreter ABI Platform
pydisagg-0.6.2-py3-none-any.whl Python 3 none any Details

Total release size: 56.8 kB

Release files / pydisagg-0.6.2.tar.gz

Download URL pydisagg-0.6.2.tar.gz
Size 29.7 kB
Tags Source
SHA-256 checksum
How to use checksums
71383ed7dc732a8f1691772465a323e0ae40308771e3cda3fc80caea536b05c4
BLAKE2b-256 checksum
How to use checksums
e97879e4d379030d231562296b7808882244179a2c2408aa5382d50a36e9cf32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / pydisagg-0.6.2-py3-none-any.whl

Download URL pydisagg-0.6.2-py3-none-any.whl
Size 27.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
738d4e675ad069a0ba16dde532c512fa3311232a16487b0df4122578bb42625e
BLAKE2b-256 checksum
How to use checksums
3d3dcd0f2d972004608913b55d2a2f51c8b114e48e879b04ee7a4dff8baddcf0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

0.6.2 This release

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page