https://github.com/vinhtantran/puls
Partitioning Using Local Subregions
https://github.com/vinhtantran/puls
clustering functional-data-analysis monothetic
Last synced: 4 months ago
JSON representation
Partitioning Using Local Subregions
- Host: GitHub
- URL: https://github.com/vinhtantran/puls
- Owner: vinhtantran
- License: gpl-2.0
- Created: 2017-10-06T08:59:47.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2025-04-21T00:38:34.000Z (10 months ago)
- Last Synced: 2025-10-12T09:55:29.327Z (4 months ago)
- Topics: clustering, functional-data-analysis, monothetic
- Language: R
- Homepage: https://vinhtantran.github.io/puls/
- Size: 3.94 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE.md
- Codemeta: codemeta.json
Awesome Lists containing this project
README
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# puls
[](https://CRAN.R-project.org/package=puls)
[](https://cran.r-project.org/package=puls)
[](https://www.repostatus.org/#active)
[](https://github.com/vinhtantran/puls/actions/workflows/R-CMD-check.yaml)
Partitioning using local subregions (PULS) is a clustering technique designed to explore subregions of functional data for information to split the curves into clusters.
## Installation
You can install the released version of puls from [CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("puls")
```
And the development version from [GitHub](https://github.com/) with:
``` r
# install.packages("remotes")
remotes::install_github("vinhtantran/puls")
```
## Example
This is a basic example which shows you how to solve a common problem:
```{r example}
library(puls)
library(fda)
# Build a simple fd object from already smoothed smoothed_arctic
data(smoothed_arctic)
NBASIS <- 300
NORDER <- 4
y <- t(as.matrix(smoothed_arctic[, -1]))
splinebasis <- create.bspline.basis(rangeval = c(1, 365),
nbasis = NBASIS,
norder = NORDER)
fdParobj <- fdPar(fdobj = splinebasis,
Lfdobj = 2,
# No need for any more smoothing
lambda = .000001)
yfd <- smooth.basis(argvals = 1:365, y = y, fdParobj = fdParobj)
Jan <- c(1, 31); Feb <- c(31, 59); Mar <- c(59, 90)
Apr <- c(90, 120); May <- c(120, 151); Jun <- c(151, 181)
Jul <- c(181, 212); Aug <- c(212, 243); Sep <- c(243, 273)
Oct <- c(273, 304); Nov <- c(304, 334); Dec <- c(334, 365)
intervals <-
rbind(Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec)
PULS4_pam <- PULS(toclust.fd = yfd$fd, intervals = intervals,
nclusters = 4, method = "pam")
PULS4_pam
```
You can make a tree plot:
```{r tree}
plot(PULS4_pam)
```
Or, a wave plot:
```{r wave}
ggwave(toclust.fd = yfd$fd, intervals = intervals, puls = PULS4_pam)
```