{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,3,27]],"date-time":"2026-03-27T21:10:53Z","timestamp":1774645853659,"version":"3.50.1"},"reference-count":40,"publisher":"Springer Science and Business Media LLC","issue":"6","license":[{"start":{"date-parts":[[2023,12,1]],"date-time":"2023-12-01T00:00:00Z","timestamp":1701388800000},"content-version":"tdm","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0"},{"start":{"date-parts":[[2023,12,1]],"date-time":"2023-12-01T00:00:00Z","timestamp":1701388800000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0"}],"funder":[{"DOI":"10.13039\/501100001824","name":"Grantov\u00e1 Agentura Cesk\u00e9 Republiky","doi-asserted-by":"publisher","award":["21-03085S"],"award-info":[{"award-number":["21-03085S"]}],"id":[{"id":"10.13039\/501100001824","id-type":"DOI","asserted-by":"publisher"}]}],"content-domain":{"domain":["link.springer.com"],"crossmark-restriction":false},"short-container-title":["Comput Stat"],"published-print":{"date-parts":[[2024,9]]},"abstract":"<jats:title>Abstract<\/jats:title><jats:p>Without writing a single line of code by a human, an example Monte Carlo simulation-based application for stochastic dependence modeling with copulas is developed through pair programming involving a human partner and a large language model (LLM) fine-tuned for conversations. This process encompasses interacting with ChatGPT using both natural language and mathematical formalism. Under the careful supervision of a human expert, this interaction facilitated the creation of functioning code in MATLAB, Python, and . The code performs a variety of tasks including sampling from a given copula model, evaluating the model\u2019s density, conducting maximum likelihood estimation, optimizing for parallel computing on CPUs and GPUs, and visualizing the computed results. In contrast to other emerging studies that assess the accuracy of LLMs like ChatGPT on tasks from a selected area, this work rather investigates ways how to achieve a successful solution of a standard statistical task in a collaboration of a human expert and artificial intelligence (AI). Particularly, through careful prompt engineering, we separate successful solutions generated by ChatGPT from unsuccessful ones, resulting in a comprehensive list of related pros and cons. It is demonstrated that if the typical pitfalls are avoided, we can substantially benefit from collaborating with an AI partner. For example, we show that if ChatGPT is not able to provide a correct solution due to a lack of or incorrect knowledge, the human-expert can feed it with the correct knowledge, e.g., in the form of mathematical theorems and formulas, and make it to apply the gained knowledge in order to provide a correct solution. Such ability presents an attractive opportunity to achieve a programmed solution even for users with rather limited knowledge of programming techniques.<\/jats:p>","DOI":"10.1007\/s00180-023-01437-2","type":"journal-article","created":{"date-parts":[[2023,12,1]],"date-time":"2023-12-01T03:02:01Z","timestamp":1701399721000},"page":"3231-3261","update-policy":"https:\/\/doi.org\/10.1007\/springer_crossmark_policy","source":"Crossref","is-referenced-by-count":9,"title":["Pair programming with ChatGPT for sampling and estimation of copulas"],"prefix":"10.1007","volume":"39","author":[{"ORCID":"https:\/\/orcid.org\/0000-0001-5263-8637","authenticated-orcid":false,"given":"Jan","family":"G\u00f3recki","sequence":"first","affiliation":[]}],"member":"297","published-online":{"date-parts":[[2023,12,1]]},"reference":[{"key":"1437_CR1","doi-asserted-by":"crossref","unstructured":"Bang Y, Cahyawijaya S, Lee N, Dai W, Su D, Wilie B et al. (2023) A multitask, multilingual, multimodal evaluation of chatgpt on reasoning, hallucination, and interactivity. arXiv:2302.04023","DOI":"10.18653\/v1\/2023.ijcnlp-main.45"},{"key":"1437_CR2","unstructured":"Boulin A (2022) Sample from copula: a coppy module. arXiv:2203.17177"},{"key":"1437_CR3","first-page":"1877","volume":"33","author":"T Brown","year":"2020","unstructured":"Brown T, Mann B, Ryder N, Subbiah M, Kaplan JD, Dhariwal P et al (2020) Language models are few-shot learners. Adv Neural Inf Process Syst 33:1877\u20131901","journal-title":"Adv Neural Inf Process Syst"},{"key":"1437_CR4","unstructured":"Chen M, Tworek J, Jun H, Yuan Q, Pinto HPdO, Kaplan J et al (2021) Evaluating large language models trained on code. arXiv:2107.03374"},{"key":"1437_CR5","unstructured":"Chowdhery A, Narang S, Devlin J, Bosma M, Mishra G, Roberts A et al (2022) Palm: scaling language modeling with pathways. arXiv:2204.02311"},{"key":"1437_CR6","unstructured":"Christiano PF, Leike J, Brown T, Martic M, Legg S, Amodei D (2017) Deep reinforcement learning from human preferences. In: Advances in neural information processing systems, vol 30"},{"key":"1437_CR7","doi-asserted-by":"publisher","first-page":"141","DOI":"10.1093\/biomet\/65.1.141","volume":"65","author":"DG Clayton","year":"1978","unstructured":"Clayton DG (1978) A model for association in bivariate life tables and its application in epidemiological studies of familial tendency in chronic disease incidence. Biometrika 65:141\u2013151. https:\/\/doi.org\/10.1093\/biomet\/65.1.141","journal-title":"Biometrika"},{"key":"1437_CR8","unstructured":"Clinton D (2022) Pair Programming with the ChatGPT AI\u2014Does GPT-3.5 Understand Bash?\u2014freecodecamp.org. https:\/\/www.freecodecamp.org\/news\/pair-programming-with-the-chatgpt-ai-how-well-does-gpt-3-5-understand-bash\/. Accessed 04 Apr 2023"},{"key":"1437_CR9","unstructured":"Devlin J, Chang M-W, Lee K, Toutanova K (2018) BERT: pre-training of deep bidirectional transformers for language understanding. arXiv:1810.04805"},{"key":"1437_CR10","unstructured":"Frieder S, Pinchetti L, Griffiths R-R, Salvatori T, Lukasiewicz T, Petersen PC, Chevalier A, Berner J (2023) Mathematical capabilities of chatgpt. arXiv:2301.13867"},{"key":"1437_CR11","unstructured":"GitHub (2021) GitHub Copilot. Your AI pair programmer\u2014github.com. https:\/\/github.com\/features\/copilot. Accessed 04 Apr 2023"},{"issue":"2","key":"1437_CR12","doi-asserted-by":"publisher","first-page":"462","DOI":"10.3150\/12-BEJ413","volume":"19","author":"IH Haff","year":"2013","unstructured":"Haff IH (2013) Parameter estimation for pair-copula constructions. Bernoulli 19(2):462\u2013491. https:\/\/doi.org\/10.3150\/12-BEJ413","journal-title":"Bernoulli"},{"key":"1437_CR13","doi-asserted-by":"publisher","unstructured":"Hofert M (2010) Sampling nested Archimedean copulas with applications to CDO pricing. Universit\u00e4t Ulm. https:\/\/doi.org\/10.18725\/OPARU-1787","DOI":"10.18725\/OPARU-1787"},{"issue":"1","key":"1437_CR14","first-page":"25","volume":"154","author":"M Hofert","year":"2013","unstructured":"Hofert M, M\u00e4chler M, McNeil AJ (2013) Archimedean copulas in high dimensions: estimators and numerical challenges motivated by financial applications. J Soc Fr Stat 154(1):25\u201363","journal-title":"J Soc Fr Stat"},{"key":"1437_CR15","doi-asserted-by":"publisher","first-page":"195","DOI":"10.1016\/j.jmva.2018.05.001","volume":"167","author":"M Hofert","year":"2018","unstructured":"Hofert M, Huser R, Prasad A (2018) Hierarchical Archimax copulas. J Multivar Anal 167:195\u2013211. https:\/\/doi.org\/10.1016\/j.jmva.2018.05.001","journal-title":"J Multivar Anal"},{"key":"1437_CR16","doi-asserted-by":"publisher","first-page":"526","DOI":"10.1016\/j.renene.2022.04.055","volume":"192","author":"Y Huang","year":"2022","unstructured":"Huang Y, Zhang B, Pang H, Wang B, Lee KY, Xie J, Jin Y (2022) Spatio-temporal wind speed prediction based on Clayton Copula function with deep learning fusion. Renew Energy 192:526\u2013536. https:\/\/doi.org\/10.1016\/j.renene.2022.04.055","journal-title":"Renew Energy"},{"key":"1437_CR17","doi-asserted-by":"publisher","DOI":"10.1201\/b17116","volume-title":"Dependence modeling with copulas","author":"H Joe","year":"2014","unstructured":"Joe H (2014) Dependence modeling with copulas. CRC Press, Boca Raton"},{"key":"1437_CR18","unstructured":"Kalliamvakou E (2022) Research: quantifying GitHub Copilot\u2019s impact on developer productivity and happiness\u2014the GitHub Blog. https:\/\/github.blog\/2022-09-07-research-quantifying-github-copilots-impact-ondeveloper-productivity-and-happiness\/. Accessed 04 Apr 2023"},{"key":"1437_CR19","doi-asserted-by":"crossref","unstructured":"Katz DM, Bommarito MJ, Gao S, Arredondo P (2023) GPT-4 passes the bar exam. SSRN 4389233","DOI":"10.2139\/ssrn.4389233"},{"key":"1437_CR20","unstructured":"Lample G, Charton F (2019) Deep learning for symbolic mathematics. arXiv:1912.01412"},{"key":"1437_CR21","unstructured":"Lewkowycz A, Andreassen A, Dohan D, Dyer E, Michalewski H, Ramasesh V et al (2022) Solving quantitative reasoning problems with language models. arXiv:2206.14858"},{"issue":"6624","key":"1437_CR22","doi-asserted-by":"publisher","first-page":"1092","DOI":"10.1126\/science.abq1158","volume":"378","author":"Y Li","year":"2022","unstructured":"Li Y, Choi D, Chung J, Kushman N, Schrittwieser J, Leblond R et al (2022) Competition-level code generation with alphacode. Science 378(6624):1092\u20131097. https:\/\/doi.org\/10.1126\/science.abq1158","journal-title":"Science"},{"key":"1437_CR23","unstructured":"Liu Y, Ott M, Goyal N, Du J, Joshi M, Chen D, Stoyanov V (2019) RoBERTa: a robustly optimized bert pretraining approach. arXiv:1907.11692"},{"key":"1437_CR24","doi-asserted-by":"crossref","unstructured":"Maddigan P, Susnjak T (2023) Chat2vis: generating data visualisations via natural language using chatgpt, codex and gpt-3 large language models. arXiv:2302.02094","DOI":"10.1109\/ACCESS.2023.3274199"},{"issue":"403","key":"1437_CR25","doi-asserted-by":"publisher","first-page":"834","DOI":"10.1080\/01621459.1988.10478671","volume":"83","author":"AW Marshall","year":"1988","unstructured":"Marshall AW, Olkin I (1988) Families of multivariate distributions. J Am Stat Assoc 83(403):834\u2013841. https:\/\/doi.org\/10.1080\/01621459.1988.10478671","journal-title":"J Am Stat Assoc"},{"key":"1437_CR26","volume-title":"Quantitative risk management: concepts, techniques and tools","author":"A McNeil","year":"2015","unstructured":"McNeil A, Frey R, Embrechts P (2015) Quantitative risk management: concepts, techniques and tools. Princeton University Press, Princeton"},{"issue":"13","key":"1437_CR27","doi-asserted-by":"publisher","first-page":"2163","DOI":"10.3390\/math10132163","volume":"10","author":"H Michimae","year":"2022","unstructured":"Michimae H, Emura T (2022) Likelihood inference for copula models based on left-truncated and competing risks data from field studies. Mathematics 10(13):2163. https:\/\/doi.org\/10.3390\/math10132163","journal-title":"Mathematics"},{"key":"1437_CR28","volume-title":"An introduction to copulas","author":"RB Nelsen","year":"2006","unstructured":"Nelsen RB (2006) An introduction to copulas, 2nd edn. Springer, Berlin","edition":"2"},{"key":"1437_CR29","unstructured":"OpenAI (2022a) Introducing ChatGPT\u2014openai.com. https:\/\/openai.com\/blog\/chatgpt\/. Accessed 04 Apr 2023"},{"key":"1437_CR30","unstructured":"OpenAI (2022b) Techniques to improve reliability. https:\/\/github.com\/openai\/openai-cookbook\/blob\/main\/techniques_to_improve_reliability.md. Accessed 04 Apr 2023"},{"key":"1437_CR31","unstructured":"OpenAI (2023a) ChatGPT plugins\u2014openai.com. https:\/\/openai.com\/blog\/chatgpt-plugins. Accessed 04 Apr 2023"},{"key":"1437_CR32","unstructured":"OpenAI (2023b) GPT-4 technical report. arXiv:2303.08774"},{"key":"1437_CR33","unstructured":"OpenAI (2023c) OpenAI API\u2014platform.openai.com. https:\/\/platform.openai.com\/docs\/models\/gpt-3-5. Accessed 04 Apr 2023"},{"key":"1437_CR34","unstructured":"Ouyang L, Wu J, Jiang X, Almeida D, Wainwright CL, Mishkin P et al (2022) Training language models to follow instructions with human feedback. arXiv:2203.02155"},{"key":"1437_CR35","unstructured":"Peng S, Yuan K, Gao L, Tang Z (2021) Mathbert: a pretrained model for mathematical formula understanding. arXiv:2105.00377"},{"key":"1437_CR36","unstructured":"Ruby D (2023) ChatGPT statistics for 2023 (New Data +GPT-4 facts). https:\/\/www.demandsage.com\/chatgptstatistics\/"},{"key":"1437_CR37","doi-asserted-by":"publisher","first-page":"387","DOI":"10.1007\/s11222-017-9737-7","volume":"28","author":"C Schellhase","year":"2018","unstructured":"Schellhase C, Spanhel F (2018) Estimating non-simplified vine copulas using penalized splines. Stat Comput 28:387\u2013409. https:\/\/doi.org\/10.1007\/s11222-017-9737-7","journal-title":"Stat Comput"},{"key":"1437_CR38","first-page":"229","volume":"8","author":"A Sklar","year":"1959","unstructured":"Sklar A (1959) Fonctions de r\u00e9partition a n dimensions et leurs marges. Publ l\u2019Inst Stat l\u2019Univ Paris 8:229\u2013231","journal-title":"Publ l\u2019Inst Stat l\u2019Univ Paris"},{"key":"1437_CR39","first-page":"3008","volume":"33","author":"N Stiennon","year":"2020","unstructured":"Stiennon N, Ouyang L, Wu J, Ziegler D, Lowe R, Voss C, Christiano PF (2020) Learning to summarize with human feedback. Adv Neural Inf Process Syst 33:3008\u20133021","journal-title":"Adv Neural Inf Process Syst"},{"key":"1437_CR40","doi-asserted-by":"publisher","unstructured":"Williams L (2001) Integrating pair programming into a software development process. In: Proceedings 14th conference on software engi-neering education and training. \u2019In search of a software engineering profession\u2019 (Cat. No. PR01059), pp 27\u201336. https:\/\/doi.org\/10.1109\/CSEE.2001.913816","DOI":"10.1109\/CSEE.2001.913816"}],"container-title":["Computational Statistics"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/link.springer.com\/content\/pdf\/10.1007\/s00180-023-01437-2.pdf","content-type":"application\/pdf","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/link.springer.com\/article\/10.1007\/s00180-023-01437-2\/fulltext.html","content-type":"text\/html","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/link.springer.com\/content\/pdf\/10.1007\/s00180-023-01437-2.pdf","content-type":"application\/pdf","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2024,9,13]],"date-time":"2024-09-13T08:16:49Z","timestamp":1726215409000},"score":1,"resource":{"primary":{"URL":"https:\/\/link.springer.com\/10.1007\/s00180-023-01437-2"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2023,12,1]]},"references-count":40,"journal-issue":{"issue":"6","published-print":{"date-parts":[[2024,9]]}},"alternative-id":["1437"],"URL":"https:\/\/doi.org\/10.1007\/s00180-023-01437-2","relation":{},"ISSN":["0943-4062","1613-9658"],"issn-type":[{"value":"0943-4062","type":"print"},{"value":"1613-9658","type":"electronic"}],"subject":[],"published":{"date-parts":[[2023,12,1]]},"assertion":[{"value":"6 April 2023","order":1,"name":"received","label":"Received","group":{"name":"ArticleHistory","label":"Article History"}},{"value":"2 November 2023","order":2,"name":"accepted","label":"Accepted","group":{"name":"ArticleHistory","label":"Article History"}},{"value":"1 December 2023","order":3,"name":"first_online","label":"First Online","group":{"name":"ArticleHistory","label":"Article History"}},{"order":1,"name":"Ethics","group":{"name":"EthicsHeading","label":"Declarations"}},{"value":"The author declares that they have no conflict of interest.","order":2,"name":"Ethics","group":{"name":"EthicsHeading","label":"Conflict of interest"}}]}}