{"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/conformal-prediction-intervals-with-temporal","title":"Conformal Prediction Intervals with Temporal Dependence","arxiv_id":"2205.12940","date":"2022-05-25","proceeding":null,"authors":["Zhen Lin","Shubhendu Trivedi","Jimeng Sun"],"abstract":"Cross-sectional prediction is common in many domains such as healthcare, including forecasting tasks using electronic health records, where different patients form a cross-section. We focus on the task of constructing valid prediction intervals (PIs) in time series regression with a cross-section. A prediction interval is considered valid if it covers the true response with (a pre-specified) high probability. We first distinguish between two notions of validity in such a setting: cross-sectional and longitudinal. Cross-sectional validity is concerned with validity across the cross-section of the time series data, while longitudinal validity accounts for the temporal dimension. Coverage guarantees along both these dimensions are ideally desirable; however, we show that distribution-free longitudinal validity is theoretically impossible. Despite this limitation, we propose Conformal Prediction with Temporal Dependence (CPTD), a procedure that is able to maintain strict cross-sectional validity while improving longitudinal coverage. CPTD is post-hoc and light-weight, and can easily be used in conjunction with any prediction model as long as a calibration set is available. We focus on neural networks due to their ability to model complicated data such as diagnosis codes for time series regression, and perform extensive experimental validation to verify the efficacy of our approach. We find that CPTD outperforms baselines on a variety of datasets by improving longitudinal coverage and often providing more efficient (narrower) PIs.","url_abs":"https://arxiv.org/abs/2205.12940v3","url_pdf":"https://arxiv.org/pdf/2205.12940v3.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":"conformal-prediction-intervals-with-temporal","repo_url":"https://github.com/zlin7/cptd","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"conformal-prediction","task_name":"Conformal Prediction"},{"task_slug":"prediction","task_name":"Prediction"},{"task_slug":"prediction-intervals","task_name":"Prediction Intervals"},{"task_slug":"time-series-1","task_name":"Time Series"},{"task_slug":"time-series","task_name":"Time Series Analysis"},{"task_slug":"time-series-regression","task_name":"Time Series Regression"},{"task_slug":"regression-1","task_name":"regression"},{"task_slug":null,"task_name":"valid"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2205.12940","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2205.12940"}},"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/zlin7/cptd","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":1,"unverified":7},"by_repo_kind":{"official":{"samples":8,"ran":1,"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":"dad8377818739ce0","entry":"merge_dict_inline","repo":"zlin7/cptd","repo_kind":"official","path":"utils/utils1.py","file_url":"https://github.com/zlin7/cptd/blob/HEAD/utils/utils1.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"dad8377818739ce0"}},{"code_sha256_prefix":"3f4e394a2fdfe4cf","entry":"get_lengths_mask","repo":"zlin7/cptd","repo_kind":"official","path":"models/training_utils.py","file_url":"https://github.com/zlin7/cptd/blob/HEAD/models/training_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":"3f4e394a2fdfe4cf"}},{"code_sha256_prefix":"12074aba0ce401f9","entry":"get_raw_df","repo":"zlin7/cptd","repo_kind":"official","path":"utils/evaluate.py","file_url":"https://github.com/zlin7/cptd/blob/HEAD/utils/evaluate.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":"12074aba0ce401f9"}},{"code_sha256_prefix":"ff9009899a6e7f5d","entry":"gpuid_to_device","repo":"zlin7/cptd","repo_kind":"official","path":"utils/utils1.py","file_url":"https://github.com/zlin7/cptd/blob/HEAD/utils/utils1.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":"ff9009899a6e7f5d"}},{"code_sha256_prefix":"f77066f61753a058","entry":"quantile_loss","repo":"zlin7/cptd","repo_kind":"official","path":"models/losses.py","file_url":"https://github.com/zlin7/cptd/blob/HEAD/models/losses.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":"f77066f61753a058"}},{"code_sha256_prefix":"739511d30390b80d","entry":"quantile_noreduction_loss","repo":"zlin7/cptd","repo_kind":"official","path":"models/losses.py","file_url":"https://github.com/zlin7/cptd/blob/HEAD/models/losses.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":"739511d30390b80d"}},{"code_sha256_prefix":"d686d27dc71879ed","entry":"scores_to_intervals","repo":"zlin7/cptd","repo_kind":"official","path":"models/CPTD.py","file_url":"https://github.com/zlin7/cptd/blob/HEAD/models/CPTD.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":"d686d27dc71879ed"}},{"code_sha256_prefix":"a66136df7c8dac01","entry":"sim_ideal_coverage_one","repo":"zlin7/cptd","repo_kind":"official","path":"utils/evaluate.py","file_url":"https://github.com/zlin7/cptd/blob/HEAD/utils/evaluate.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":"a66136df7c8dac01"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}