cor_spearman_accuracy {roahd} | R Documentation |
Bootstrap Spearman's correlation coefficient for multivariate functional data
Description
This function computes the bootstrap estimates of standard error and bias of the Spearman's correlation coefficient for a multivariate functional dataset.
Usage
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 |
ordering |
the ordering relation to use on functional observations,
either |
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. |
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).
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.
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))
# Computes bootstrap estimate of Spearman correlation
cor_spearman_accuracy(mfD, ordering = "MEI")
cor_spearman_accuracy(mfD, ordering = "MHI")