Package: datafsm 0.2.4

datafsm: Estimating Finite State Machine Models from Data

Automatic generation of finite state machine models of dynamic decision-making that both have strong predictive power and are interpretable in human terms. We use an efficient model representation and a genetic algorithm-based estimation process to generate simple deterministic approximations that explain most of the structure of complex stochastic processes. We have applied the software to empirical data, and demonstrated it's ability to recover known data-generating processes by simulating data with agent-based models and correctly deriving the underlying decision models for multiple agent models and degrees of stochasticity.

Authors:John J. Nay [aut], Jonathan M. Gilligan [cre, aut]

datafsm_0.2.4.tar.gz
datafsm_0.2.4.zip(r-4.5)datafsm_0.2.4.zip(r-4.4)datafsm_0.2.4.zip(r-4.3)
datafsm_0.2.4.tgz(r-4.5-x86_64)datafsm_0.2.4.tgz(r-4.5-arm64)datafsm_0.2.4.tgz(r-4.4-x86_64)datafsm_0.2.4.tgz(r-4.4-arm64)datafsm_0.2.4.tgz(r-4.3-x86_64)datafsm_0.2.4.tgz(r-4.3-arm64)
datafsm_0.2.4.tar.gz(r-4.5-noble)datafsm_0.2.4.tar.gz(r-4.4-noble)
datafsm_0.2.4.tgz(r-4.4-emscripten)datafsm_0.2.4.tgz(r-4.3-emscripten)
datafsm.pdf |datafsm.html
datafsm/json (API)
NEWS

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

Bug tracker:https://github.com/jonathan-g/datafsm/issues

Pkgdown site:https://jonathan-g.github.io

Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:
  • NV_games - Empirical prisoner's dilemma games from Nay and Vorobeychik

On CRAN:

Conda:

machine-learningcpp

5.52 score 11 stars 30 scripts 208 downloads 22 exports 79 dependencies

Last updated 4 years agofrom:d1fb94e077. Checks:11 OK. Indexed: yes.

TargetResultLatest binary
Doc / VignettesOKFeb 12 2025
R-4.5-win-x86_64OKFeb 12 2025
R-4.5-mac-x86_64OKFeb 12 2025
R-4.5-mac-aarch64OKFeb 12 2025
R-4.5-linux-x86_64OKFeb 12 2025
R-4.4-win-x86_64OKFeb 12 2025
R-4.4-mac-x86_64OKFeb 12 2025
R-4.4-mac-aarch64OKFeb 12 2025
R-4.3-win-x86_64OKFeb 12 2025
R-4.3-mac-x86_64OKFeb 12 2025
R-4.3-mac-aarch64OKFeb 12 2025

Exports:action_vecadd_interact_numbarplotbest_performancebuild_bitstringcompare_fsmdecode_action_vecdecode_state_matdegeneracy_checkdotchartestimation_detailsevolve_modelevolve_model_cvevolve_model_ntimesfind_wildcardsfitnessCPPperformanceplotpredictstatesvar_impvarImp

Dependencies:caretclasscliclockcodetoolscolorspacecpp11crayondata.tablediagramdigestdplyre1071fansifarverforeachfuturefuture.applyGAgenericsggplot2globalsgluegowergtablehardhatipredisobanditeratorsKernSmoothlabelinglatticelavalifecyclelistenvlubridatemagrittrMASSMatrixmgcvModelMetricsmunsellnlmennetnumDerivparallellypillarpkgconfigplyrpROCprodlimprogressrproxypurrrR6RColorBrewerRcppRcppArmadillorecipesreshape2rlangrpartscalesshapesparsevctrsSQUAREMstringistringrsurvivaltibbletidyrtidyselecttimechangetimeDatetzdbutf8vctrsviridisLitewithr

Example with real data

Rendered fromFRD_vignette.Rmdusingknitr::rmarkdown_notangleon Feb 12 2025.

Last update: 2021-05-25
Started: 2018-08-05

Introduction to datafsm

Rendered fromdatafsm_introduction.Rmdusingknitr::rmarkdownon Feb 12 2025.

Last update: 2021-05-25
Started: 2018-08-05

Readme and manuals

Help Manual

Help pageTopics
Extracts slot of action_vecaction_vec
Add interaction numbers for panel dataadd_interact_num
Extracts performancebest_performance
Builds Bitstringbuild_bitstring
Compares FSMscompare_fsm
datafsm: A package for estimating FSM models.datafsm-package datafsm
Decodes Action Vectordecode_action_vec
Decodes State Matrixdecode_state_mat
Determines if State Matrix is Degenerate for Given Data Set.degeneracy_check
Extracts slot relevant to estimating the fsmestimation_details
Use a Genetic Algorithm to Estimate a Finite-state Machine Modelevolve_model
Estimate Optimal Number of States of a Finite-state Machine Modelevolve_model_cv
Use a Genetic Algorithm to Estimate a Finite-state Machine Model n-timesevolve_model_ntimes
Find Indices for Non-identifiable Elements of State Matrix.find_wildcards
Fitness Function in C++fitnessCPP
An S4 class to return the results of using a GA to estimate a FSM with 'evolve_model'.action_vec,ga_fsm-method barplot,ga_fsm-method best_performance,ga_fsm-method dotchart,ga_fsm-method estimation_details,ga_fsm-method ga_fsm-class plot,ga_fsm,ANY-method plot,ga_fsm-method predict,ga_fsm-method print,ga_fsm-method show,ga_fsm-method states,ga_fsm-method summary,ga_fsm-method varImp,ga_fsm-method
Empirical prisoner's dilemma games from Nay and VorobeychikNV_games
Measure Model Performanceperformance
Extracts number of statesstates
Variable Importance Measure for A FSM Modelvar_imp
Extracts slot of variable importancesvarImp