Package: shapleydecomp 1.0.0

shapleydecomp: Shapley Value Decomposition for Discrete-Time Simulation Models

Attributes changes in the outcomes of a discrete-time simulation model to its input factors using Shapley values (Shapley 1953) <doi:10.1515/9781400881970-018>, which for binary factors coincide with the symmetric standardization of Das Gupta (1993) <https://www2.census.gov/library/publications/1993/demographics/p23-186.pdf>. Any calibrated model can be decomposed by implementing four S3 methods that run the model, summarize its output, and construct counterfactual inputs. Counterfactuals either remove a factor entirely or hold it at its value in a baseline year, and a sequential decomposition attributes each year's policy conditional on the past.

Authors:Austin Carter [aut, cre]

shapleydecomp_1.0.0.tar.gz
shapleydecomp_1.0.0.zip(r-4.7-any)shapleydecomp_1.0.0.zip(r-4.6-any)shapleydecomp_1.0.0.zip(r-4.5-any)
shapleydecomp_1.0.0.tgz(r-4.6-any)shapleydecomp_1.0.0.tgz(r-4.5-any)
shapleydecomp_1.0.0.tar.gz(r-4.7-any)shapleydecomp_1.0.0.tar.gz(r-4.6-any)
shapleydecomp_1.0.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
shapleydecomp/json (API)

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

Bug tracker:https://github.com/aucarter/shapleydecomp/issues

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

On CRAN:

Conda:

5.20 score 2 stars 4 scripts 17 exports 1 dependencies

Last updated from:90a4659e5e. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK110
source / vignettesOK168
linux-releaseOK102
macos-releaseOK195
macos-oldrelOK204
windows-develOK69
windows-releaseOK70
windows-oldrelOK66
wasm-releaseOK84

Exports:build_counterfactualCF_CHANGE_SINCECF_TOTAL_IMPACTdecomp_algebradecomp_pairget_baseline_valueget_warm_start_statemake_run_tableprepare_decomprun_decomprun_from_warm_startrun_simulationsequential_totalsshapley_decomposesummarize_resultssupports_warm_startvalidate_model_interface

Dependencies:data.table

Methods
Setup | Factorial design | Shapley values | Das Gupta's standardization is the same thing | Counterfactual types | Counterfactuals in between on and off | Decomposing over time: sequential Shapley | Runs that are not simulated | References

Last update: 2026-10-21
Started: 2026-10-13

Get started
1. A model | 2. The interface | Registering the methods | 3. Validate | 4. Decompose | 5. Two questions, two counterfactuals | 6. Going further

Last update: 2026-10-14
Started: 2026-10-13