Package: shapleydecomp 1.0.0

Austin Carter

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.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://cran.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:

3.00 score 4 scripts 17 exports 1 dependencies

Last updated from:62c08cfdd3. Checks:6 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK133
source / vignettesOK165
linux-releaseOK141
windows-develOK68
windows-releaseOK69
wasm-releaseOK94

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

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-11-03
Started: 2026-11-03

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-11-03
Started: 2026-11-03