This function computes the bootstrap estimates of standard error and bias of the Spearman's correlation coefficient for a multivariate functional dataset.

cor_spearman_accuracy(
  mfD,
  ordering = "MEI",
  bootstrap_iterations = 1000,
  verbose = FALSE
)

Arguments

mfD

a multivariate functional dataset whose Spearman's correlation coefficient must be computed, in form of multivariate mfData object.

ordering

the ordering relation to use on functional observations, either "MEI" for MEI or "MHI" for MHI (default is "MEI").

bootstrap_iterations

the number of bootstrap iterations to be used for estimation of bias and standard error.

verbose

a logical flag specifying whether to log information on the estimation progress.

Value

a list of three elements: mean, the mean of the matrix of correlation coefficients; bias, a matrix containing the estimated bias (mean - point estimate of correlation coefficients); sd, a matrix containing the estimated standard deviation of the coefficients' matrix. In case the multivariate functional dataset has only two components, the return type is scalar and not matrix.

Details

Given a multivariate functional dataset \(X_1^(i), \ldots, X_n^(i)\), \(i=0, \ldots, L\) defined over the grid \(I = t_0, \ldots, t_P\), having components \(i=1, \ldots, L\), and a chosen ordering strategy (MEI or MHI), the function computes the matrix of Spearman's correlation indices of the dataset components, as well as their bias and standard deviation estimates through a specified number of bootstrap iterations (bias and standard error are updated with on-line formulas).

See also

Examples

N <- 200
P <- 100

grid <- seq(0, 1, length.out = P)

# Creating an exponential covariance function to simulate Gaussian data
Cov <- exp_cov_function(grid, alpha = 0.3, beta = 0.4)

# Simulating (independent) Gaussian functional data with given center and covariance function

Data_1 <- generate_gauss_fdata(
  N = N,
  centerline = sin(2 * pi * grid),
  Cov = Cov
)

Data_2 <- generate_gauss_fdata(
  N = N,
  centerline = sin(2 * pi * grid),
  Cov = Cov
)

# Using the simulated data as (independent) components of a bivariate functional dataset
mfD <- mfData(grid, list(Data_1, Data_2))

# \donttest{
# Computes bootstrap estimate of Spearman correlation
cor_spearman_accuracy(mfD, ordering = "MEI")
#> $mean
#> [1] -0.07173426
#> 
#> $bias
#> [1] 0.002892717
#> 
#> $sd
#> [1] 0.07591705
#> 
cor_spearman_accuracy(mfD, ordering = "MHI")
#> $mean
#> [1] -0.07254222
#> 
#> $bias
#> [1] 0.002084762
#> 
#> $sd
#> [1] 0.07660277
#> 
# }