R/multivariate_depths.R
multiMHI.Rd
These functions compute the Modified Hypograph Index of elements of a multivariate functional dataset.
multiMHI(Data, weights = "uniform")
# S3 method for mfData
multiMHI(Data, weights = "uniform")
# S3 method for default
multiMHI(Data, weights = "uniform")
specifies the the multivariate functional dataset.
It is either an object of class mfData
or a list of 2-dimensional
matrices having as rows the elements of that component and as columns the
measurements of the functional data over the grid.
either a set of weights (of the same length of Data
) or the string "uniform"
specifying that a set of uniform weights
(of value \(1 / L\), where \(L\) is the number of dimensions of the
functional dataset and thus the length of Data
) is to be used.
The function returns a vector containing the values of MHI of each element of the multivariate functional dataset.
Given a multivariate functional dataset composed of \(N\) elements with \(L\) components each, \(\mathbf{X_1} =( X^1_1(t),\) \(X^2_1(t), \ldots, X^L_1(t))\), and a set of \(L\) non-negative weights,
$$ w_1, w_2, \ldots, w_L, \qquad \sum_{i=1}^L w_i = 1,$$
these functions compute the MHI of each element of the functional dataset, namely:
$$ MHI( \mathbf{X_j} ) = \sum_{i=1}^{L} w_i MHI( X^i_j ), \quad \forall j = 1, \ldots N.$$
N = 20
P = 1e3
grid = seq( 0, 10, length.out = P )
# Generating an exponential covariance function to be used to simulate gaussian
# functional data
Cov = exp_cov_function( grid, alpha = 0.2, beta = 0.8 )
# First component of the multivariate guassian functional dataset
Data_1 = generate_gauss_fdata( N, centerline = rep( 0, P ), Cov = Cov )
# First component of the multivariate guassian functional dataset
Data_2 = generate_gauss_fdata( N, centerline = rep( 0, P ), Cov = Cov )
mfD = mfData( grid, list( Data_1, Data_2 ) )
# Uniform weights
multiMHI( mfD, weights = 'uniform' )
#> [1] 0.508550 0.599975 0.532575 0.543450 0.499125 0.595325 0.450600 0.566575
#> [9] 0.473450 0.510500 0.662300 0.324650 0.450850 0.425575 0.694425 0.431325
#> [17] 0.637375 0.453175 0.530950 0.609250
# Non-uniform, custom weights
multiMHI( mfD, weights = c(2/3, 1/3) )
#> [1] 0.5284667 0.5915833 0.4847500 0.5567000 0.4866500 0.5467667 0.4461000
#> [8] 0.5997833 0.4619500 0.5591000 0.6759167 0.3116167 0.4522667 0.4352500
#> [15] 0.6506167 0.4267333 0.6572000 0.4591000 0.5674167 0.6020333