CreateFuncBoxPlot: Create functional boxplot using 'bagplot', 'KDE' or...

Description Usage Arguments Details References Examples

View source: R/CreateFuncBoxPlot.R

Description

Using an FPCA object create a functional box-plot based on the function scores. The green line corresponds to the functional median, the dark gray area to the area spanned by the curves within the 25th and 75-th percentile and the light gray to the area spanned by the curves within the 2.5th and 97.5-th percentile.

Usage

1
CreateFuncBoxPlot(fpcaObj, optns = list(), ...)

Arguments

fpcaObj

An object of class FPCA returned by the function FPCA().

optns

A list of options control parameters specified by list(name=value). See ‘Details’.

...

Additional arguments for the 'plot' function.

Details

Available control options are

ifactor

inflation ifactor for the bag-plot defining the loop of bag-plot or multiplying ifactor the KDE pilot bandwidth matrix. (see ?aplpack::compute.bagplot; ?ks::Hpi respectively; default: 2.58; 2 respectively).

variant

string defining the method used ('KDE', 'pointwise' or 'bagplot') (default: 'bagplot')

unimodal

logical specifying if the KDE estimate should be unimodal (default: FALSE, relevant only for variant='KDE')

addIndx

vector of indices corresponding to which samples one should overlay (Default: NULL)

K

integer number of the first K components used for the representation. (default: length(fpcaObj$lambda ))

References

P. J. Rousseeuw, I. Ruts, J. W. Tukey (1999): The bagplot: a bivariate boxplot, The American Statistician, vol. 53, no. 4, 382-387

Examples

1
2
3
4
5
6
7
8
set.seed(1)
n <- 20
pts <- seq(0, 1, by=0.05)
sampWiener <- Wiener(n, pts)
sampWiener <- Sparsify(sampWiener, pts, 10)
res <- FPCA(sampWiener$Ly, sampWiener$Lt, 
            list(dataType='Sparse', error=FALSE, kernel='epan', verbose=TRUE))
CreateFuncBoxPlot(res, list(addIndx=c(1:3)) )

Example output

Median of niis no more than 20! No binning is performed!

At most 29 number of PC can be selected, thresholded by `maxK` = 18. 

Warning message:
no DISPLAY variable so Tk is not available 

fdapace documentation built on Nov. 23, 2021, 1:06 a.m.