Skip to main content

No project description provided

Project description

PyPI Python GitHub Workflow Status GitHub

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_{1,...,k}$ be an aggregated measurement across groups ${g_1,...,g_k}$, where the population of each is $p_i,...,p_k$. Let $f_1,...,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_{1,...,k}$ with $f_1,...,f_k$ to make the estimates self consistent.

Mathematically, in the simpler rate multiplicative model, we find $\beta$ such that $$D_{1,...,k} = \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 LMO_model(m) with $T(x)=\log(\frac{x}{1-x^{m}})$ are implemented. Note that the LMO_model 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 LMO_model(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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydisagg-0.3.2.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

pydisagg-0.3.2-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file pydisagg-0.3.2.tar.gz.

File metadata

  • Download URL: pydisagg-0.3.2.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.12

File hashes

Hashes for pydisagg-0.3.2.tar.gz
Algorithm Hash digest
SHA256 9b1837bc5968c4dec940fad11307f63fb354aa3ad7bd0f278df3242864c7fae5
MD5 9588587ec8c34d3c8be723beb7ab7a77
BLAKE2b-256 1bbfda6df1e6ee63b616e7d818123ce91126aebbe1535699119d416244fc4722

See more details on using hashes here.

Provenance

File details

Details for the file pydisagg-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: pydisagg-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.12

File hashes

Hashes for pydisagg-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4cdc8ef7c11994ac50e9c089fb61c501bb532947033fdcd8ccad9911c36dde34
MD5 398ea2ace0c79583c5c8abebdec1fd2e
BLAKE2b-256 1837da607e42a88f3745cb9d5732ce7940b347c43fbc710314a6f11dd21fbb03

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page