Skip to contents

Computation of the statistical power (i.e. risk to reject the null hypothesis when it is false) associated to any statistics described in the package based on simulation permutation-based p-values computations. See Smida et al (2022) for more details.

Usage

power_exp(
  n_simu = 100,
  alpha = 0.05,
  n_perm = 100,
  stat = c("mo", "med"),
  n_point = 100,
  n_obs1 = 50,
  n_obs2 = 50,
  c_val = 1,
  delta_shape = "constant",
  distrib = "normal",
  max_iter = 10000,
  verbose = FALSE
)

Arguments

n_simu

integer value, number of simulations to compute the statistical power.

alpha

numerical value, between 0 and 1, type I risk level to reject the null hypothesis in the simulation. Default value is 5%.

n_perm

integer, number of permutation to compute the p-values.

stat

character string or vector of character string, name of the statistics for which the p-values will be computed, among "mo", "med", "wmw", "hkr", "cff".

n_point

integer value, number of points in the trajectory.

n_obs1

integer value, number of trajectories in the first sample.

n_obs2

integer value, number of trajectories in the second sample.

c_val

numeric value, level of divergence between the two samples.

delta_shape

character string, shape of the divergence between the two samples, among "constant", "linear", "quadratic".

distrib

character string, type of probability distribution used to simulate the data among "normal", "cauchy", "dexp", "student".

max_iter

integer, maximum number of iteration for the iterative simulation process.

verbose

boolean, if TRUE, enable verbosity.

Value

a list with the following elements:

  • power_res: a list of named numeric value corresponding to the power values for each statistic listed in stat input.

  • pval_res: a list of named numeric values corresponding to the p-values for each simulation and each statistic listed in the stat input.

  • simu_config: information about input parameters used for simulation, including n_simu, c_val, distrib, delta_shape, n_point, n_obs1, n_obs2.

Details

The c_val input argument should be strictly positive so that the null hypothesis is not verified when simulating the data (i.e. so that the two sample are not generated from the same probability distribution).

References

Zaineb Smida, Lionel Cucala, Ali Gannoun & Ghislain Durif (2022) A median test for functional data, Journal of Nonparametric Statistics, 34:2, 520-553, doi:10.1080/10485252.2022.2064997 , hal-03658578

Examples

# simulate a few small data for the example
res <- power_exp(
    n_simu = 20, alpha = 0.05, n_perm = 100, 
    stat = c("mo", "med", "wmw", "hkr", "cff"), 
    n_point = 25, n_obs1 = 4, n_obs2 = 5, c_val = 10, delta_shape = "constant", 
    distrib = "normal", max_iter = 10000, verbose = FALSE
)
res$power_res
#> $mo
#> [1] 1
#> 
#> $med
#> [1] 1
#> 
#> $wmw
#> [1] 1
#> 
#> $hkr
#> T1 T2 
#>  1  1 
#> 
#> $cff
#> [1] 1
#>