{"id":32200425,"url":"https://github.com/mfaymon/spinar","last_synced_at":"2025-10-22T03:48:05.325Z","repository":{"id":58436565,"uuid":"520425653","full_name":"MFaymon/spINAR","owner":"MFaymon","description":"Semiparametric and parametric estimation and bootstrapping of integer-valued autoregressive (INAR) models.","archived":false,"fork":false,"pushed_at":"2024-05-08T11:44:58.000Z","size":5253,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-22T03:47:54.402Z","etag":null,"topics":["bootstrapping","count-data","parametric-estimation","penalization","semiparametric-estimation","simulation","time-series","validation"],"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/MFaymon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-08-02T09:05:05.000Z","updated_at":"2024-05-09T16:05:39.000Z","dependencies_parsed_at":"2024-03-19T14:54:00.068Z","dependency_job_id":"b8169faa-6217-496f-861d-ee323938c673","html_url":"https://github.com/MFaymon/spINAR","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/MFaymon/spINAR","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MFaymon%2FspINAR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MFaymon%2FspINAR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MFaymon%2FspINAR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MFaymon%2FspINAR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MFaymon","download_url":"https://codeload.github.com/MFaymon/spINAR/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MFaymon%2FspINAR/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280376534,"owners_count":26320276,"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","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bootstrapping","count-data","parametric-estimation","penalization","semiparametric-estimation","simulation","time-series","validation"],"created_at":"2025-10-22T03:48:02.018Z","updated_at":"2025-10-22T03:48:05.316Z","avatar_url":"https://github.com/MFaymon.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# spINAR\n[![DOI](https://joss.theoj.org/papers/10.21105/joss.05386/status.svg)](https://doi.org/10.21105/joss.05386)\n[![CRAN](https://www.r-pkg.org/badges/version/spINAR)](https://cran.r-project.org/package=spINAR)\n[![R build status](https://github.com/MFaymon/spINAR/workflows/R-CMD-check/badge.svg)](https://github.com/MFaymon/spINAR/actions)\n[![codecov](https://codecov.io/gh/MFaymon/spINAR/branch/main/graph/badge.svg?token=U5KPFSY3XN)](https://app.codecov.io/gh/MFaymon/spINAR)\n[![DOI](https://zenodo.org/badge/520425653.svg)](https://zenodo.org/badge/latestdoi/520425653)\n\nSemiparametric and Parametric Estimation and Bootstrapping of Integer-Valued Autoregressive (INAR) Models.\n\nThe package provides flexible simulation of INAR data using a general pmf to define the innovations' distribution. It allows for semiparametric and parametric estimation of INAR models and includes a small sample refinement for the semiparametric setting. Additionally, it provides different procedures to appropriately bootstrap INAR data.\n\n## Citation\nPlease cite the [JOSS](https://doi.org/10.21105/joss.05386) paper using the BibTeX entry\n```\n@article{faymonville2024spinar,\n  doi = {10.21105/joss.05386},\n  url = {https://doi.org/10.21105/joss.05386},\n  year = {2024},\n  publisher = {The Open Journal},\n  volume = {9},\n  number = {97},\n  pages = {5386},\n  author = {Maxime Faymonville and Javiera Riffo and Jonas Rieger and Carsten Jentsch},\n  title = {{spINAR}: An {R} Package for Semiparametric and Parametric Estimation and Bootstrapping of Integer-Valued Autoregressive ({INAR}) Models},\n  journal = {Journal of Open Source Software}\n} \n\n```\nwhich is also obtained by the call ``citation(\"spINAR\")``.\n\n## References (related to the methodology)\n* Faymonville, M., Jentsch, C., Weiß, C.H. and Aleksandrov, B. (2022). \"Semiparametric Estimation of INAR Models using Roughness Penalization\". Statistical Methods \u0026 Applications. [DOI](https://doi.org/10.1007/s10260-022-00655-0)\n* Jentsch, C. and Weiß, C.H. (2017), “Bootstrapping INAR Models”. Bernoulli 25(3), pp. 2359-2408. [DOI](https://doi.org/10.3150/18-BEJ1057)\n* Drost, F., Van den Akker, R. and Werker, B. (2009), “Efficient estimation of auto-regression parameters and inovation distributions for semiparametric integer-valued AR(p) models”. Journal of the Royal Statistical Society. Series B 71(2), pp. 467-485. [DOI](https://doi.org/10.1111/j.1467-9868.2008.00687.x)\n\n## Contribution\nThis R package is licensed under the [GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html).\nFor bug reports (lack of documentation, misleading or wrong documentation, unexpected behaviour, ...) and feature requests please use the [issue tracker](https://github.com/MFaymon/spINAR/issues).\nPull requests are welcome and will be included at the discretion of the author.\n\n## Installation\n\nFor installation of the development version use [devtools](https://cran.r-project.org/package=devtools):\n\n``` r\ndevtools::install_github(\"MFaymon/spINAR\")\n```\n\n## Structure\n![](https://github.com/MFaymon/spINAR/blob/main/img_readme/cheat_sheet_spINAR.png)\n\n## Example\n\n```r\nlibrary(spINAR)\n```\n\nWe simulate two datasets. The first consists of n = 100 observations resulting from an INAR(1) model with coefficient alpha = 0.5 and Poi(1) distributed innovations. The second consists of n = 100 observations from an INAR(2) model with coefficients alpha_1 = 0.3, alpha_2 = 0.2 and a pmf equal to (0.3, 0.3, 0.2, 0.1, 0.1).\n\n```r\nset.seed(1234)\n\ndat1 \u003c- spinar_sim(100, 1, alpha = 0.5, pmf = dpois(0:20,1))\ndat2 \u003c- spinar_sim(100, 2, alpha = c(0.3, 0.2), pmf = c(0.3, 0.3, 0.2, 0.1, 0.1))\n```\n\nWe estimate an INAR(1) model on the first dataset.\n\n```r\n#semiparametrically\nspinar_est(dat1, 1)\n\n#parametrically (moment estimation, true Poisson assumption)\nspinar_est_param(dat1, 1, \"mom\", \"poi\")\n```\n\nWe estimate an INAR(2) model on the second dataset.\n\n```r\n#semiparametrically\nspinar_est(dat2, 2)\n```\n\nFor small samples, it can be beneficial to apply a penalized version of the semiparametric estimation. For illustration, we restrict ourselves to the first 50 observations of the first dataset and apply semiparametric, parametric and penalized semiparametric estimation. We choose a small L2 penalization as this showed to be most beneficial in the simulation study in Faymonville et al. (2022) (see references). Alternatively, one could also use the spinar_penal_val function which validates the two penalization parameters.\n\n```r\ndat1_50 \u003c- dat1[1:50]\nspinar_est(dat1_50, 1)\nspinar_est_param(dat1_50, 1, \"mom\", \"poi\")\nspinar_penal(dat1, 1, penal1 = 0, penal2 = 0.1)\n```\n\nFinally, we bootstrap INAR(1) data on the first data set. We perform a semiparametric and a parametric INAR bootstrap (moment estimation, true Poisson assumption). \n\n```r\nspinar_boot(dat1, 1, 500, setting = \"sp\")\nspinar_boot(dat1, 1, 500, setting = \"p\", type = \"mom\", distr = \"poi\")\n```\n\n## Application\nThe file vignette.md provides reproduced results from the literature for each provided functionality of the spINAR package.\n\n## Outlook\n\nA possible extension of the spINAR package is to not only cover INAR models but also the extension to GINAR (generalized INAR) models, see [Latour (1997)](https://doi.org/10.1017/s0001867800027865).  This model class does not only cover the binomial thinning but also allows for other thinning operations, e.g. thinning using geometrically distributed random variables. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmfaymon%2Fspinar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmfaymon%2Fspinar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmfaymon%2Fspinar/lists"}