# MBD_relative: Relative Modified Band Depth of functions in a univariate functional dataset

### Description

This function computes Modified Band Depth (BD) of elements of a univariate functional dataset with respect to another univariate functional dataset.

### Usage

 1 2 3 4 5 6 7 MBD_relative(Data_target, Data_reference) ## S3 method for class 'fData' MBD_relative(Data_target, Data_reference) ## Default S3 method: MBD_relative(Data_target, Data_reference) 

### Arguments

 Data_target is the univariate functional dataset, provided either as an fData object or in matrix form (N observations as rows and P measurements as columns), whose MBD have to be computed with respect to the reference dataset. Data_reference is the dataset, provided either as an fData object or in matrix form (N observations as rows and P measurements as columns), containing the reference univariate functional data that must be used to compute the MBD of elements in Data_target. If Data_target is fData, it must be of class fData.

### Details

Given a univariate functional dataset of elements X_1(t), X_2(t), …, X_N(t), and another univariate functional dataset of elements Y_1(t), Y_2(t) …, Y_M(t), defined over the same compact interval I=[a,b], this function computes the MBD of elements of the former with respect to elements of the latter, i.e.:

MBD( X_i( t ) ) = {M \choose 2 }^{-1} ∑_{1 ≤q i_1 < i_2 ≤q M} \tilde{λ}\big( {t : \min( Y_{i_1}(t), Y_{i_2}(t) ) ≤q X_i(t) ≤q \max( Y_{i_1}(t), Y_{i_2}(t) ) } \big),

\forall i = 1, …, N, where \tilde{λ}(\cdot) is the normalised Lebesgue measure over I=[a,b], that is \tilde{λ(A)} = λ( A ) / ( b - a ).

### Value

The function returns a vector containing the MBD of elements in Data_target with respect to elements in Data_reference.

MBD, BD, BD_relative, fData
  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 grid = seq( 0, 1, length.out = 1e2 ) Data_ref = matrix( c( 0 + sin( 2 * pi * grid ), 1 + sin( 2 * pi * grid ), -1 + sin( 2 * pi * grid ) ), nrow = 3, ncol = length( grid ), byrow = TRUE ) Data_test_1 = matrix( c( 0.6 + sin( 2 * pi * grid ) ), nrow = 1, ncol = length( grid ), byrow = TRUE ) Data_test_2 = matrix( c( 0.6 + sin( 2 * pi * grid ) ), nrow = length( grid ), ncol = 1, byrow = TRUE ) Data_test_3 = 0.6 + sin( 2 * pi * grid ) Data_test_4 = array( 0.6 + sin( 2 * pi * grid ), dim = length( grid ) ) Data_test_5 = array( 0.6 + sin( 2 * pi * grid ), dim = c( 1, length( grid ) ) ) Data_test_6 = array( 0.6 + sin( 2 * pi * grid ), dim = c( length( grid ), 1 ) ) Data_test_7 = matrix( c( 0.5 + sin( 2 * pi * grid ), -0.5 + sin( 2 * pi * grid ), 1.1 + sin( 2 * pi * grid ) ), nrow = 3, ncol = length( grid ), byrow = TRUE ) fD_ref = fData( grid, Data_ref ) fD_test_1 = fData( grid, Data_test_1 ) fD_test_2 = fData( grid, Data_test_2 ) fD_test_3 = fData( grid, Data_test_3 ) fD_test_4 = fData( grid, Data_test_4 ) fD_test_5 = fData( grid, Data_test_5 ) fD_test_6 = fData( grid, Data_test_6 ) fD_test_7 = fData( grid, Data_test_7 ) MBD_relative( fD_test_1, fD_ref ) MBD_relative( Data_test_1, Data_ref ) MBD_relative( fD_test_2, fD_ref ) MBD_relative( Data_test_2, Data_ref ) MBD_relative( fD_test_3, fD_ref ) MBD_relative( Data_test_3, Data_ref ) MBD_relative( fD_test_4, fD_ref ) MBD_relative( Data_test_4, Data_ref ) MBD_relative( fD_test_5, fD_ref ) MBD_relative( Data_test_5, Data_ref ) MBD_relative( fD_test_6, fD_ref ) MBD_relative( Data_test_6, Data_ref ) MBD_relative( fD_test_7, fD_ref ) MBD_relative( Data_test_7, Data_ref )