How zvez-t/ddcm works
ddcm is an R package for specifying, solving, estimating, and analyzing dynamic discrete-choice models and dynamic games. The principal workflow runs from a user's formula and data through state-space and transition construction, utility specification, algorithm dispatch, model solution, and parameter estimation, ending in fitted-model summaries and predictions. The package also documents Bayesian, HMM, mixture, approximate-value-function, SBI, synthetic-data, and game-estimation capabilities. README statements establish most feature-level links; sampled C++ excerpts clarify the Bellman, likelihood, HMM, and shared-primitive layers, but many R-level calls were not sampled.
Main entry points: ddcm_api.R DDC interface · solver_nfxp.R NFXP solver · dispatch.R Algorithm dispatch · bellman.cpp Bellman iteration
Components 27
Model specification
- DDC interface
R/ddcm_api.R - State space
R/state_space.R - Transitions
R/transition_model.R - Utility specification
R/utility.R
Solving and estimation
- Algorithm dispatch
R/dispatch.R - NFXP solver
R/solver_nfxp.R - CCP solver
R/solver_ccp.R - MPEC solver
R/solver_mpec.R - SMM and GMM
R/solver_smm.R - Model results
R/methods_ddcm_summary.R - Approximate values
R/approx_vf.R
Specialized inference
- Latent-state HMM
R/hmm.R - Finite mixtures
R/mixture.R - Bayesian inference
R/bayes.R - Simulation inference
R/sbi.R
Games and simulation
- Dynamic games
R/game.R - Equilibrium methods
R/equilibrium.R - DGP laboratory
R/dgp.R
Computation engine
- Bellman iteration
src/bellman.cpp - Bellman accelerators
src/bellman_accel.cpp - Shared C++ primitives
src/ddcm_internal.cpp - Emax functions
src/emax.cpp - Likelihood kernel
src/loglik.cpp - HMM engine
src/hmm_filter.cpp - MPEC kernels
src/mpec.cpp - SMM simulation kernel
src/smm.cpp
Other components
- R analyst
Connections 27
- R analyst → DDC interface: specifies model
README.md - DDC interface → State space: builds states
README.md - DDC interface → Transitions: uses transitions
README.md - DDC interface → Utility specification: specifies utility
README.md - DDC interface → Algorithm dispatch: selects algorithm
README.md - Algorithm dispatch → NFXP solver: dispatches NFXP
README.md - Algorithm dispatch → CCP solver: dispatches CCP
README.md - DDC interface → MPEC solver: supports MPEC
README.md - DDC interface → SMM and GMM: supports moments
README.md - NFXP solver → Model results: returns estimates
README.md - CCP solver → Model results: returns estimates
README.md - NFXP solver → Bellman iteration: solves Bellman
README.md - Bellman iteration → Shared C++ primitives: uses primitives
src/bellman.cpp - Bellman accelerators → Shared C++ primitives: uses primitives
src/bellman_accel.cpp - Bellman iteration → Emax functions: computes Emax
src/bellman.cpp - NFXP solver → Likelihood kernel: evaluates likelihood
src/loglik.cpp - MPEC solver → MPEC kernels: uses kernels
README.md - SMM and GMM → SMM simulation kernel: simulates moments
README.md - DDC interface → Latent-state HMM: supports hidden states
README.md - Latent-state HMM → HMM engine: filters sequences
README.md - DDC interface → Finite mixtures: supports heterogeneity
README.md - DDC interface → Bayesian inference: offers posterior inference
README.md - DDC interface → Simulation inference: offers SBI
README.md - DDC interface → Approximate values: supports approximate values
README.md - R analyst → Dynamic games: specifies game
README.md - Dynamic games → Equilibrium methods: estimates equilibrium
README.md - R analyst → DGP laboratory: builds synthetic data
README.md