energyStats: Compute difference between two multivariate samples

View source: R/energyStats.R

energyStatsR Documentation

Compute difference between two multivariate samples

Description

Compute difference between two multivariate samples

Usage

energyStats(
  sample1 = NULL,
  sample2 = NULL,
  edist_method = "original",
  edist_replicates = 199
)

Arguments

sample1

Numeric. Matrix or data.frame with values sampled from a multivariate distribution.

sample2

Numeric. Matrix or data.frame with a second example of values sampled from a multivariate distribution.

edist_method

Character. Selects the method used in a call to function eqdist.etest in the package energy.

edist_replicates

Numeric (integer). Number of replicates used in energy statistics calculation. Default is 199 which appears to give reliable results without significant computational cost.

Details

This function is a wrapper around the function eqdist.etest in the package energy designed to facilitate its orderly and robust application to testing the difference between a base sample and a second sample (typically a sub-sample) of points in a multivariate environmental space.

Value

An object of class htest as returned by function eqdist.etest.

Examples

## Not run: 
m1 <- matrix(runif(100), 10, 10)
df1 <- data.frame(m1)
m2 <- matrix(runif(100), 10, 10)
df2 <- data.frame(m2)
ans1 <- energyStats(m1, m2)
print(ans1)


ans2 <- energyStats(df1, df2)
print(ans2)

m2 <- matrix(runif(120), 10, 12)
df2 <- data.frame(m2)
ans <- energyStats(df1, df2)
print(ans)

## End(Not run)

peterbat1/fitMaxnet documentation built on Sept. 17, 2024, 10:50 p.m.