{"id":32207796,"url":"https://github.com/euanmcgonigle/cptnonpar","last_synced_at":"2025-10-22T05:59:29.705Z","repository":{"id":164466503,"uuid":"639913618","full_name":"EuanMcGonigle/CptNonPar","owner":"EuanMcGonigle","description":"Development version of the CptNonPar R package","archived":false,"fork":false,"pushed_at":"2025-08-23T07:17:09.000Z","size":136,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-22T05:59:27.298Z","etag":null,"topics":["change-point-detection","cran","moving-sum","nonparametric","package","r","segmentation","time-series"],"latest_commit_sha":null,"homepage":"https://CRAN.R-project.org/package=CptNonPar","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EuanMcGonigle.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-05-12T14:08:15.000Z","updated_at":"2025-08-23T07:17:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"5736386b-448a-42b5-89f9-2f03017c8d76","html_url":"https://github.com/EuanMcGonigle/CptNonPar","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/EuanMcGonigle/CptNonPar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EuanMcGonigle%2FCptNonPar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EuanMcGonigle%2FCptNonPar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EuanMcGonigle%2FCptNonPar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EuanMcGonigle%2FCptNonPar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EuanMcGonigle","download_url":"https://codeload.github.com/EuanMcGonigle/CptNonPar/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EuanMcGonigle%2FCptNonPar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280389300,"owners_count":26322507,"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":["change-point-detection","cran","moving-sum","nonparametric","package","r","segmentation","time-series"],"created_at":"2025-10-22T05:59:25.046Z","updated_at":"2025-10-22T05:59:29.697Z","avatar_url":"https://github.com/EuanMcGonigle.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# CptNonPar\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/EuanMcGonigle/CptNonPar/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/EuanMcGonigle/CptNonPar/actions/workflows/R-CMD-check.yaml)\n[![Codecov test coverage](https://codecov.io/gh/EuanMcGonigle/CptNonPar/branch/main/graph/badge.svg)](https://app.codecov.io/gh/EuanMcGonigle/CptNonPar?branch=main)\n\u003c!-- badges: end --\u003e\n\n\nNonparametric change point detection for multivariate time series. Implements the NP-MOJO methodology proposed in [McGonigle and Cho (2025)](https://doi.org/doi:10.1093/biomet/asaf024).\n\n## Installation\n\nYou can install the released version of `CptNonPar` from [CRAN](https://CRAN.R-project.org) with:\n\n```\ninstall.packages(\"CptNonPar\")\n```\n\n\nYou can install the development version of `CptNonPar` from [GitHub](https://github.com/) with:\n\n```\ndevtools::install_github(\"https://github.com/EuanMcGonigle/CptNonPar\")\n```\n\n\n## Usage\n\nFor further examples, see the help files within the package. We can generate an example for change point detection as follows.\n\nWe generate a univariate time series of length 1000, with a mean change at time 300, and an autocovariance (but not marginal) change at time 650. Then, we perform the multi-lag NP-MOJO algorithm with lags 0 and 1, and print the estimated change points and the associated clusters:\n\n```{r example}\nlibrary(CptNonPar)\n\nn \u003c- 1000\nset.seed(123)\n\nnoise1 \u003c- stats::arima.sim(model = list(ar = -0.5), n = n, sd = sqrt(1 - 0.5^2))\nnoise2 \u003c- stats::arima.sim(model = list(ar = 0.5), n = n, sd = sqrt(1 - 0.5^2))\n\nnoise \u003c- c(noise1[1:650], noise2[651:n])\n\nsignal \u003c- c(rep(0, 300), rep(0.7, 700))\n\nx \u003c- signal + noise\n\nx.c \u003c- np.mojo.multilag(x, G = 166, lags = c(0, 1))\n\nx.c$cpts\n\nx.c$cpt.clusters\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feuanmcgonigle%2Fcptnonpar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feuanmcgonigle%2Fcptnonpar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feuanmcgonigle%2Fcptnonpar/lists"}