{"id":27646721,"url":"https://github.com/maxbiostat/truncation_tests","last_synced_at":"2025-04-24T01:22:51.093Z","repository":{"id":44701832,"uuid":"341569966","full_name":"maxbiostat/truncation_tests","owner":"maxbiostat","description":"Preliminary code to test truncation algorithms for infinite series and their applications in Statistics.","archived":false,"fork":false,"pushed_at":"2022-02-15T17:23:35.000Z","size":820,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2023-07-31T12:36:17.213Z","etag":null,"topics":["mathematics","statistics","summation","truncation"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxbiostat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-23T13:50:10.000Z","updated_at":"2023-07-31T12:36:17.214Z","dependencies_parsed_at":"2022-09-03T03:13:08.177Z","dependency_job_id":null,"html_url":"https://github.com/maxbiostat/truncation_tests","commit_stats":null,"previous_names":[],"tags_count":1,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxbiostat%2Ftruncation_tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxbiostat%2Ftruncation_tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxbiostat%2Ftruncation_tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxbiostat%2Ftruncation_tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxbiostat","download_url":"https://codeload.github.com/maxbiostat/truncation_tests/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250541751,"owners_count":21447574,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mathematics","statistics","summation","truncation"],"created_at":"2025-04-24T01:22:48.974Z","updated_at":"2025-04-24T01:22:51.078Z","avatar_url":"https://github.com/maxbiostat.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Test scripts for infinite series truncation algorithms\n\nAccompanying code to the paper [\"Adaptive truncation of infinite sums: applications to Statistics\"](https://arxiv.org/abs/2202.06121) by [Luiz Max Carvalho](https://github.com/maxbiostat) and [Guido A. Moreira](https://github.com/GuidoAMoreira).\n\nNote that the code provided here makes heavy use of our package [**sumR**](https://github.com/GuidoAMoreira/sumR) which is also on CRAN.\n\n- The importance of selecting the right algorithm: as [this](https://github.com/maxbiostat/truncation_tests/blob/main/tests/adaptive_versus_threshold.r) script demonstrates, when L \u003e 1/2 one really ought to use the error-bounding (\"adaptive\") algorithm or Batches with a suitably chosen `batch_size`. \n\n- Ever wondered how many iterations you would need to correctly approximate the normalising constant of the [Conway-Maxwell Poisson](https://en.wikipedia.org/wiki/Conway%E2%80%93Maxwell%E2%80%93Poisson_distribution) distribution? [This](https://github.com/maxbiostat/truncation_tests/blob/main/COMP_normalisingConstant_table.r) script computes it for a few values, extending the results in Figure 5 of [Benson \u0026 Friel (2021)](https://projecteuclid.org/journals/bayesian-analysis/volume-16/issue-3/Bayesian-Inference-Model-Selection-and-Likelihood-Estimation-using-Fast-Rejection/10.1214/20-BA1230.full) .\n\n- [This](https://github.com/maxbiostat/truncation_tests/blob/main/MMLE_Erlang_sumR.r) script implements the marginal maximum likelihood estimation (MMLE) example with a toy queuing model. The basic idea is that you have a Poisson number of calls with exponential duration, but you only observe the total call time (i.e. their sum). A simulation study is implemented [here](https://github.com/maxbiostat/truncation_tests/blob/main/MMLE_Erlang_sumR_simuStudy.r) and has a companion [script](https://github.com/maxbiostat/truncation_tests/blob/main/analyse_MMLE_Erlang.r) to analyse it.\n \n- Tests where the true answer is known in closed form can be found in [this](https://github.com/maxbiostat/truncation_tests/tree/main/tests) folder. In particular, we provide tests for the [factorial moments](https://en.wikipedia.org/wiki/Factorial_moment) of a Poisson random variable ([script](https://github.com/maxbiostat/truncation_tests/blob/main/tests/Poisson_factorial_moments.r)) and the marginal probability in a size-independent (binomial) observation error model with a negative binomial count-generating distribution ([script](https://github.com/maxbiostat/truncation_tests/blob/main/tests/Negative_binomial_obsError.r)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxbiostat%2Ftruncation_tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxbiostat%2Ftruncation_tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxbiostat%2Ftruncation_tests/lists"}