elastes

Elastic full Procrustes means for sparse and irregular planar curves in R

https://github.com/mpff/elastes

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
    1 of 3 committers (33.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.6%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

Elastic full Procrustes means for sparse and irregular planar curves in R

Basic Info
Statistics
  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • Open Issues: 4
  • Releases: 0
Created over 4 years ago · Last pushed almost 3 years ago
Metadata Files
Readme License

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-"
)
```

# elastes


[![R-CMD-check](https://github.com/mpff/elastes/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/mpff/elastes/actions/workflows/R-CMD-check.yaml)
[![codecov](https://codecov.io/gh/mpff/elastes/branch/main/graph/badge.svg?token=p0xOHfDpnk)](https://app.codecov.io/gh/mpff/elastes)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)


elastes is a R package that provides functions for the computation of functional 
elastic shape means over sets of open planar curves. The package is particularly 
suitable for settings where these curves are only sparsely and irregularly observed. 
It uses a novel approach for elastic shape mean estimation, where planar curves are
treated as complex functions and a full Procrustes mean is estimated from the
corresponding smoothed Hermitian covariance surface. This is combined with the 
methods for elastic mean estimation proposed in 
[Steyer, Stöcker, Greven (2022)](https://doi.org/10.1111/biom.13706).
See [Stöcker et. al. (2022)](https://doi.org/10.48550/arXiv.2203.10522) for details.


## Installation

The simplest way to obtain elastes is to install it directly from CRAN. Type
the following command in your R console:

```{r, eval=FALSE}
install.packages("elastes")
```

You can install the development version from [GitHub](https://github.com/) with:

```{r, eval=FALSE}
# install.packages("devtools")
devtools::install_github("mpff/elastes")
```


## Example

Calculate a smooth elastic shape mean for sparse spirals.

```{r}
library(elastes)

# define spiral curve
curve <- function(t){
  rbind(t*cos(13*t), t*sin(13*t))
}

# randomly draw sparse spirals with noise
set.seed(18)
data_curves <- lapply(1:10, function(i){
  m <- sample(10:15, 1)
  delta <- abs(rnorm(m, mean = 1, sd = 0.05))
  t <- cumsum(delta)/sum(delta)
  data.frame(t(curve(t)) + 0.07*t*matrix(cumsum(rnorm(2*length(delta))),
             ncol = 2))
})

# apply random rotation and scaling to spiral curves
rand_scale <- function(curve){ ( 0.5 + runif(1) ) * curve }
rand_rotate <- function(curve){
  names <- colnames(curve)
  theta <- 2*pi*runif(1)
  mat <- matrix(c(cos(theta), sin(theta), -sin(theta), cos(theta)), nrow = 2, ncol = 2)
  curve.rot <- as.matrix(curve) %*% t(mat)
  curve.rot <- as.data.frame(curve.rot)
  colnames(curve.rot) <- names
  return(curve.rot)
}
data_curves <- lapply(data_curves, rand_scale)
data_curves <- lapply(data_curves, rand_rotate)

# compute smooth procrustes mean using a 2nd order penalty in the estimation
knots <- seq(0,1, length = 11)
elastic_shape_mean <- compute_elastic_shape_mean(
  data_curves,
  knots = knots,
  type = "smooth",
  penalty = 2
)
plot(elastic_shape_mean)
```

Owner

  • Name: Manuel Pfeuffer
  • Login: mpff
  • Kind: user
  • Location: Berlin, Germany
  • Company: Chair of Statistics, HU Berlin

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Committers

Last synced: over 3 years ago

All Time
  • Total Commits: 109
  • Total Committers: 3
  • Avg Commits per committer: 36.333
  • Development Distribution Score (DDS): 0.083
Top Committers
Name Email Commits
Manuel Pfeuffer m****r@g****m 100
Manuel Pfeuffer p****m@h****e 6
Almond Stöcker a****r@g****m 3
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: over 2 years ago

All Time
  • Total issues: 11
  • Total pull requests: 0
  • Average time to close issues: 15 days
  • Average time to close pull requests: N/A
  • Total issue authors: 2
  • Total pull request authors: 0
  • Average comments per issue: 3.09
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: about 23 hours
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • mpff (8)
  • Almond-S (3)
Pull Request Authors
Top Labels
Issue Labels
bug (5) enhancement (5)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 224 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
  • Total maintainers: 1
cran.r-project.org: elastes

Elastic Full Procrustes Means for Sparse and Irregular Planar Curves

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 224 Last month
Rankings
Forks count: 28.8%
Dependent packages count: 29.8%
Stargazers count: 35.2%
Dependent repos count: 35.5%
Average: 43.0%
Downloads: 85.9%
Last synced: 11 months ago

Dependencies

DESCRIPTION cran
  • elasdics * imports
  • graphics * imports
  • mgcv * imports
  • orthogonalsplinebasis * imports
  • sparseFLMM * imports
  • splines * imports
  • stats * imports
  • utils * imports
  • covr * suggests
  • knitr * suggests
  • rmarkdown * suggests
  • shapes * suggests
  • testthat >= 3.0.0 suggests