boxplot.fdawarp: Functional Boxplot

View source: R/boxplot.R

boxplot.fdawarpR Documentation

Functional Boxplot

Description

This function computes the required statistics for building up a boxplot of the aligned functional data. Since the process of alignment provides separation of phase and amplitude variability, the computed boxplot can focus either on amplitude variability or phase variability.

Usage

## S3 method for class 'fdawarp'
boxplot(
  x,
  variability_type = c("amplitude", "phase"),
  alpha = 0.05,
  range = 1,
  what = c("plot", "stats", "plot+stats"),
  ...
)

## S3 method for class 'ampbox'
boxplot(x, ...)

## S3 method for class 'phbox'
boxplot(x, ...)

Arguments

x

An object of class fdawarp typically produced by time_warping() or of class ampbox or phbox typically produced by boxplot.fdawarp().

variability_type

A string specifying which kind of variability should be displayed in the boxplot. Choices are "amplitude" or "phase". Defaults to "amplitude".

alpha

A numeric value specifying the quantile value. Defaults to 0.05 which uses the 95\% quantile.

range

A positive numeric value specifying how far the plot whiskers extend out from the box. The whiskers extend to the most extreme data point which is no more than range times the interquartile range from the box. Defaults to 1.0.

what

A string specifying what the function should return. Choices are "plot", "stats" or "plot+stats". Defaults to "plot".

...

Unused here.

Details

The function boxplot.fdawarp() returns optionally an object of class either ampbox if variability_type = "amplitude" or phbox if variability_type = "phase". S3 methods specialized for objects of these classes are provided as well to avoid re-computation of the boxplot statistics.

Value

If what contains stats, a list containing the computed statistics necessary for drawing the boxplot. Otherwise, the function simply draws the boxplot and no object is returned.

Examples

## Not run: 
out <- time_warping(simu_data$f, simu_data$time)
boxplot(out, what = "stats")

## End(Not run)

fdasrvf documentation built on Nov. 19, 2023, 1:09 a.m.