{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/counterfactual-temporal-point-processes","title":"Counterfactual Temporal Point Processes","arxiv_id":"2111.07603","date":"2021-11-15","proceeding":null,"authors":["Kimia Noorbakhsh","Manuel Gomez Rodriguez"],"abstract":"Machine learning models based on temporal point processes are the state of the art in a wide variety of applications involving discrete events in continuous time. However, these models lack the ability to answer counterfactual questions, which are increasingly relevant as these models are being used to inform targeted interventions. In this work, our goal is to fill this gap. To this end, we first develop a causal model of thinning for temporal point processes that builds upon the Gumbel-Max structural causal model. This model satisfies a desirable counterfactual monotonicity condition, which is sufficient to identify counterfactual dynamics in the process of thinning. Then, given an observed realization of a temporal point process with a given intensity function, we develop a sampling algorithm that uses the above causal model of thinning and the superposition theorem to simulate counterfactual realizations of the temporal point process under a given alternative intensity function. Simulation experiments using synthetic and real epidemiological data show that the counterfactual realizations provided by our algorithm may give valuable insights to enhance targeted interventions.","url_abs":"https://arxiv.org/abs/2111.07603v2","url_pdf":"https://arxiv.org/pdf/2111.07603v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"counterfactual-temporal-point-processes","repo_url":"https://github.com/networks-learning/counterfactual-ttp","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"counterfactual-temporal-point-processes","repo_url":"https://github.com/Networks-Learning/counterfactual-tpp","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"point-processes","task_name":"Point Processes"},{"task_slug":null,"task_name":"counterfactual"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2111.07603","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2111.07603"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/networks-learning/counterfactual-ttp","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Networks-Learning/counterfactual-tpp","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":12},"by_repo_kind":{"listed":{"samples":12,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"b561c7031ec5050f","entry":"combine","repo":"Networks-Learning/counterfactual-tpp","repo_kind":"listed","path":"src/counterfactual_tpp.py","file_url":"https://github.com/Networks-Learning/counterfactual-tpp/blob/HEAD/src/counterfactual_tpp.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b561c7031ec5050f"}},{"code_sha256_prefix":"305d3b26695afc35","entry":"extract_samples","repo":"Networks-Learning/counterfactual-tpp","repo_kind":"listed","path":"src/hawkes/hawkes.py","file_url":"https://github.com/Networks-Learning/counterfactual-tpp/blob/HEAD/src/hawkes/hawkes.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"305d3b26695afc35"}},{"code_sha256_prefix":"ae46f8062d539863","entry":"get_fig_dim","repo":"Networks-Learning/counterfactual-tpp","repo_kind":"listed","path":"src/utils.py","file_url":"https://github.com/Networks-Learning/counterfactual-tpp/blob/HEAD/src/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ae46f8062d539863"}},{"code_sha256_prefix":"9b4975a2c1647bdb","entry":"homogenous_poisson","repo":"Networks-Learning/counterfactual-tpp","repo_kind":"listed","path":"src/sampling_utils.py","file_url":"https://github.com/Networks-Learning/counterfactual-tpp/blob/HEAD/src/sampling_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9b4975a2c1647bdb"}},{"code_sha256_prefix":"066a3b144036fc37","entry":"posterior_A_star","repo":"Networks-Learning/counterfactual-tpp","repo_kind":"listed","path":"ebola/gumbel.py","file_url":"https://github.com/Networks-Learning/counterfactual-tpp/blob/HEAD/ebola/gumbel.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"066a3b144036fc37"}},{"code_sha256_prefix":"4c0242b98640be69","entry":"rejection","repo":"Networks-Learning/counterfactual-tpp","repo_kind":"listed","path":"src/gumbel.py","file_url":"https://github.com/Networks-Learning/counterfactual-tpp/blob/HEAD/src/gumbel.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4c0242b98640be69"}},{"code_sha256_prefix":"e70d64fe696e8f75","entry":"sampleHawkes","repo":"Networks-Learning/counterfactual-tpp","repo_kind":"listed","path":"src/hawkes/hawkes.py","file_url":"https://github.com/Networks-Learning/counterfactual-tpp/blob/HEAD/src/hawkes/hawkes.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e70d64fe696e8f75"}},{"code_sha256_prefix":"5ccb81d27d0e89ed","entry":"thinning","repo":"Networks-Learning/counterfactual-tpp","repo_kind":"listed","path":"src/sampling_utils.py","file_url":"https://github.com/Networks-Learning/counterfactual-tpp/blob/HEAD/src/sampling_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5ccb81d27d0e89ed"}},{"code_sha256_prefix":"e866cd50ae0b2e76","entry":"thinning_T","repo":"Networks-Learning/counterfactual-tpp","repo_kind":"listed","path":"src/sampling_utils.py","file_url":"https://github.com/Networks-Learning/counterfactual-tpp/blob/HEAD/src/sampling_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e866cd50ae0b2e76"}},{"code_sha256_prefix":"c97adef406707a7c","entry":"thinning_T","repo":"Networks-Learning/counterfactual-tpp","repo_kind":"listed","path":"ebola/sampling_utils.py","file_url":"https://github.com/Networks-Learning/counterfactual-tpp/blob/HEAD/ebola/sampling_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c97adef406707a7c"}},{"code_sha256_prefix":"c996261eca8f9acf","entry":"topdown","repo":"Networks-Learning/counterfactual-tpp","repo_kind":"listed","path":"src/gumbel.py","file_url":"https://github.com/Networks-Learning/counterfactual-tpp/blob/HEAD/src/gumbel.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c996261eca8f9acf"}},{"code_sha256_prefix":"10a43d28d99b5242","entry":"truncated_gumbel","repo":"Networks-Learning/counterfactual-tpp","repo_kind":"listed","path":"src/gumbel.py","file_url":"https://github.com/Networks-Learning/counterfactual-tpp/blob/HEAD/src/gumbel.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"10a43d28d99b5242"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}