View source: R/TestFunctions.R
fEqDistrib.test | R Documentation |
Three tests for the equality of distributions of two populations are provided. The null hypothesis is that the two populations are the same
XYRP.test(X.fdata, Y.fdata, nproj = 10, npc = 5, test = c("KS", "AD")) MMD.test( X.fdata, Y.fdata, metric = "metric.lp", B = 1000, alpha = 0.95, kern = "RBF", ops.metric = list(lp = 2), draw = FALSE ) MMDA.test( X.fdata, Y.fdata, metric = "metric.lp", B = 1000, alpha = 0.95, kern = "RBF", ops.metric = list(lp = 2), draw = FALSE ) fEqDistrib.test( X.fdata, Y.fdata, metric = "metric.lp", method = c("Exch", "WildB"), B = 5000, ops.metric = list(lp = 2), iboot = FALSE )
X.fdata |
|
Y.fdata |
|
nproj |
Number of projections for |
npc |
The number of principal components employed for generating the random projections. |
test |
For |
metric |
Character with the metric function for computing distances among curves. |
B |
Number of bootstrap or Monte Carlo replicas. |
alpha |
Confidence level for computing the threshold. By default =0.95. |
kern |
For |
ops.metric |
List of parameters to be used with |
draw |
By default, FALSE. Plots the density of the bootstrap replicas jointly with the statistic. |
method |
In |
iboot |
In |
XYRP.test
computes the p-values using random projections. Requires kSamples
library.
MMD.test
computes Maximum Mean Discrepancy p-values using permutations (see Sejdinovic et al, (2013)) and MMDA.test
does the same using an asymptotic approximation.
fEqDistrib.test
checks the equality of distributions using an embedding in a RKHS and two bootstrap approximations for
calibration.
A list with the following components by function:
XYRP.test
: FDR.pv
: p-value using FDR, proj.pv
: Matrix of p-values obtained for projections.
MMD.test
,MMDA.test
: stat
: Statistic, p.value
: p-value, thresh
: Threshold at level alpha
.
fEqDistrib.test
: result
: data.frame
with columns Stat
and p.value
,
Boot
: data.frame
with bootstrap replicas if iboot=TRUE
.
Manuel Febrero-Bande, Manuel Oviedo de la Fuente manuel.febrero@usc.es
Sejdinovic, D., Sriperumbudur, B., Gretton, A., Fukumizu, K. Equivalence of distance-based and RKHS-based statistics in Hypothesis Testing The Annals of Statistics, 2013. DOI 10.1214/13-AOS1140.
fmean.test.fdata, cov.test.fdata
.
## Not run: tt=seq(0,1,len=51) bet=0 mu1=fdata(10*tt*(1-tt)^(1+bet),tt) mu2=fdata(10*tt^(1+bet)*(1-tt),tt) fsig=1 X=rproc2fdata(100,tt,mu1,sigma="vexponential",par.list=list(scale=0.2,theta=0.35)) Y=rproc2fdata(100,tt,mu2,sigma="vexponential",par.list=list(scale=0.2*fsig,theta=0.35)) fmean.test.fdata(X,Y,npc=-.98,draw=TRUE) cov.test.fdata(X,Y,npc=5,draw=TRUE) bet=0.1 mu1=fdata(10*tt*(1-tt)^(1+bet),tt) mu2=fdata(10*tt^(1+bet)*(1-tt),tt) fsig=1.5 X=rproc2fdata(100,tt,mu1,sigma="vexponential",par.list=list(scale=0.2,theta=0.35)) Y=rproc2fdata(100,tt,mu2,sigma="vexponential",par.list=list(scale=0.2*fsig,theta=0.35)) fmean.test.fdata(X,Y,npc=-.98,draw=TRUE) cov.test.fdata(X,Y,npc=5,draw=TRUE) XYRP.test(X,Y,nproj=15) MMD.test(X,Y,B=1000) fEqDistrib.test(X,Y,B=1000) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.