-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathREADME.Rmd
138 lines (104 loc) · 4.69 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# roahd <a href='https://astamm.github.io/roahd/'><img src='man/figures/logo.png' align="right" height="139" /></a>
<!-- badges: start -->
[![check-standard](https://github.com/astamm/roahd/workflows/R-CMD-check/badge.svg)](https://github.com/astamm/roahd/actions)
[![test-coverage](https://github.com/astamm/roahd/workflows/test-coverage/badge.svg)](https://github.com/astamm/roahd/actions)
[![codecov](https://codecov.io/gh/astamm/roahd/branch/master/graph/badge.svg)](https://app.codecov.io/gh/astamm/roahd)
[![pkgdown](https://github.com/astamm/roahd/workflows/pkgdown/badge.svg)](https://github.com/astamm/roahd/actions)
[![CRAN status](https://www.r-pkg.org/badges/version/roahd)](https://CRAN.R-project.org/package=roahd)
[![downloads](https://cranlogs.r-pkg.org/badges/roahd)](https://cran.r-project.org/package=roahd)
<!-- badges: end -->
The __roahd__ (_Robust Analysis of High-dimensional Data_) package allows to use
a set of statistical tools for the _exploration_ and _robustification_ of
univariate and multivariate __functional datasets__ through the use of
depth-based statistical methods.
In the implementation of functions, special attention was put to their
efficiency, so that they can be profitably used also for the analysis of
high-dimensional datasets.
For a full-featured description of the package, please take a look at the
[roahd](https://astamm.github.io/roahd/articles/roahd.html) vignette.
## Installation
Install the released version of **roahd** from CRAN:
```{r cran-install, eval=FALSE}
install.packages("roahd")
```
Or install the development version from GitHub with:
```{r github-install, eval=FALSE}
# install.packages("remotes")
remotes::install_github("astamm/roahd")
```
## [`fData`](https://astamm.github.io/roahd/reference/fData.html) and [`mfData`](https://astamm.github.io/roahd/reference/mfData.html) objects
A simple `S3` representation of functional data object, [`fData`](https://astamm.github.io/roahd/reference/fData.html), allows to
encapsulate the important features of univariate functional datasets (like the
grid of the dependent variable, the pointwise observations, etc.):
```{r fData-constructor}
library(roahd)
# Grid representing the dependent variable
grid = seq( 0, 1, length.out = 100 )
# Pointwise measurements of the functional dataset
Data = matrix( c( sin( 2 * pi * grid ),
cos ( 2 * pi * grid ),
sin( 2 * pi * grid + pi / 4 ) ), ncol = 100, byrow = TRUE )
# S3 object encapsulating the univariate functional dataset
fD = fData( grid, Data )
# S3 representation of a multivariate functional dataset
mfD = mfData( grid, list( 'comp1' = Data, 'comp2' = Data ) )
```
Also, this allows to exploit simple calls to customized functions which
simplifies the exploratory analysis:
```{r fData-operations, eval=FALSE}
# Algebra of fData objects
fD + 1 : 100
fD * 4
fD + fD
# Subsetting fData objects (providing other fData objects)
fD[ 1, ]
fD[ 1, 2 : 4]
# Sample mean and (depth-based) median(s)
mean( fD )
mean( fD[ 1, 10 : 20 ] )
median_fData( fD, type = 'MBD' )
```
```{r fData-plot}
# Plotting functions
plot( fD )
plot( mean( fD ), lwd = 4, add = TRUE )
plot( fD[ 2:3, ] )
```
## Robust methods for functional data analysis
A part of the package is specifically devoted to the computation of depths and
other statistical indices for functional data:
- Band depths and modified band depths,
- Modified band depths for multivariate functional data,
- Epigraph and hypograph indexes,
- Spearman and Kendall's correlation indexes for functional data,
- Confidence intervals and tests on Spearman's correlation coefficients for
univariate and multivariate functional data.
These also are the core of the visualization / robustification tools like
functional boxplot
([`fbplot`](https://astamm.github.io/roahd/reference/fbplot.html)) and
outliergram
([`outliergram`](https://astamm.github.io/roahd/reference/outliergram.html)),
allowing the visualization and identification of amplitude and shape outliers.
Thanks to the functions for the simulation of synthetic functional datasets,
both [`fbplot`](https://astamm.github.io/roahd/reference/fbplot.html) and
[`outliergram`](https://astamm.github.io/roahd/reference/outliergram.html)
procedures can be auto-tuned to the dataset at hand, in order to control the
true positive outliers rate.
## Citation
If you use this package for your own research, please cite the corresponding R
Journal article:
```{r citation, echo=FALSE}
citation("roahd")
```