Skip to content

scmBayesPost v0.4.7

Latest

Choose a tag to compare

@andrebonfrer andrebonfrer released this 03 Oct 20:20

scmBayesPost 0.4.7

Changes

  • prepare_data_general(): each treated unit's pseudo-panel now contains the
    unit plus only the donors that carry positive weight in its column of W,
    instead of every control. Zero-weight rows contribute nothing to the
    weighted likelihood, so posterior draws are unchanged, while the number of
    rows falls sharply when donor screening leaves many zero weights.
  • prepare_data_general() gains w_min (default 0). When w_min > 0, donors
    below that weight are dropped from each pseudo-panel and the remaining
    weights renormalised to the column's original mass. This is an
    approximation, intended for large donor pools (e.g. 4,000 stratified
    onboarders) whose pseudo-panels otherwise exceed memory and the 2^31-row
    limit. On simulated data w_min = 1e-3 shrank the panels about eightfold
    with unit effects correlated 0.9999 with the exact version.
  • Fix: the sigma2 update in every sampler used the number of pseudo-panel
    rows as degrees of freedom, so zero-weight donor rows inflated the
    precision whenever donor screening applied. Degrees of freedom now count
    rows with positive weight. Results with no zero-weight donors are
    unaffected; results that had zero-weight donors were over-precise and
    change.
  • testthat suite added (tests/testthat/test-prepare-data.R): verifies that
    the positive-weight pseudo-panels reproduce the all-controls draws, and
    that w_min drops donors, preserves weight mass and is inert at 0.

Compatibility

  • Default behaviour (w_min = 0) reproduces previous results exactly for any
    weights matrix without zeros.
  • budgetsc >= 0.4.7 passes post.w_min through to this version.