# fbplot: Functional boxplot of univariate and multivariate functional...

### Description

This function can be used to perform the functional boxplot of univariate or multivariate functional data.

### Usage

  1 2 3 4 5 6 7 8 9 10 11 fbplot(Data, Depths = "MBD", Fvalue = 1.5, adjust = FALSE, display = TRUE, xlab = NULL, ylab = NULL, main = NULL, ...) ## S3 method for class 'fData' fbplot(Data, Depths = "MBD", Fvalue = 1.5, adjust = FALSE, display = TRUE, xlab = NULL, ylab = NULL, main = NULL, ...) ## S3 method for class 'mfData' fbplot(Data, Depths = list(def = "MBD", weights = "uniform"), Fvalue = 1.5, adjust = FALSE, display = TRUE, xlab = NULL, ylab = NULL, main = NULL, ...) 

### References

Sun, Y., & Genton, M. G. (2012). Functional boxplots. Journal of Computational and Graphical Statistics.

Sun, Y., & Genton, M. G. (2012). Adjusted functional boxplots for spatio- temporal data visualization and outlier detection. Environmetrics, 23(1), 54-64.

fData, MBD, BD, mfData, multiMBD, multiBD

### Examples

  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 # UNIVARIATE FUNCTIONAL BOXPLOT - NO ADJUSTMENT N = 2 * 10 + 1 P = 2e2 grid = seq( 0, 1, length.out = P ) D = matrix( sin( 2 * pi * grid ), nrow = N, ncol = P, byrow = TRUE ) D = D + c( 0, 1 : (( N - 1 )/2), -( ( ( N - 1 ) / 2 ) : 1 ) ) fD = fData( grid, D ) dev.new() par( mfrow = c(1,2) ) plot( fD, lwd = 2, main = 'Functional dataset', xlab = 'time', ylab = 'values' ) fbplot( fD, main = 'Functional boxplot', xlab = 'time', ylab = 'values' ) # UNIVARIATE FUNCTIONAL BOXPLOT - WITH ADJUSTMENT set.seed( 161803 ) P = 2e2 grid = seq( 0, 1, length.out = P ) N = 1e2 # Generating a univariate synthetic gaussian dataset Data = generate_gauss_fdata( N, centerline = sin( 2 * pi * grid ), Cov = exp_cov_function( grid, alpha = 0.3, beta = 0.4 ) ) fD = fData( grid, Data ) dev.new() ## Not run: fbplot( fD, adjust = list( N_trials = 10, trial_size = 5 * N, VERBOSE = TRUE ), xlab = 'time', ylab = 'Values', main = 'My adjusted functional boxplot' ) ## End(Not run) # MULTIVARIATE FUNCTIONAL BOXPLOT - NO ADJUSTMENT set.seed( 1618033 ) P = 1e2 N = 1e2 L = 2 grid = seq( 0, 1, length.out = 1e2 ) C1 = exp_cov_function( grid, alpha = 0.3, beta = 0.4 ) C2 = exp_cov_function( grid, alpha = 0.3, beta = 0.4 ) # Generating a bivariate functional dataset of gaussian data with partially # correlated components Data = generate_gauss_mfdata( N, L, centerline = matrix( sin( 2 * pi * grid ), nrow = 2, ncol = P, byrow = TRUE ), correlations = rep( 0.5, 1 ), listCov = list( C1, C2 ) ) mfD = mfData( grid, Data ) dev.new() fbplot( mfD, Fvalue = 2.5, xlab = 'time', ylab = list( 'Values 1', 'Values 2' ), main = list( 'First component', 'Second component' ) ) 

Search within the roahd package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.