AverageStatisticEpistemicTest {FuzzySimRes} | R Documentation |
Apply averaging statistics epistemic test for one or two fuzzy samples.
Description
'AverageStatisticEpistemicTest' calculates the p-value for the given real-valued statistical test using the averaging statistics epistemic bootstrap approach.
Usage
AverageStatisticEpistemicTest(
sample1,
sample2,
bootstrapMethod = "std",
test = "ks.test",
cutsNumber = 1,
criticalValueFunction = "KSTestCriticalValue",
...
)
Arguments
sample1 |
Sample of fuzzy numbers given in the form of a list or as a single number. |
sample2 |
Sample of fuzzy numbers given in the form of a list or as a single number (two-sample test case) or
|
bootstrapMethod |
The standard ( |
test |
Name of the invoked function for the statistical test. |
cutsNumber |
Number of cuts used in the epistemic bootstrap. |
criticalValueFunction |
Name of the function that converts the test statistic into the p-value. |
... |
Additional arguments passed to the statistical test. |
Details
The procedure calculates the p-value for the selected real-valued statistical test, like, e.g. the Kolmogorov-Smirnov
one- or two-sample test (invoked by ks.test
function). Another statistical test can be also used if it has at
least one or two parameters
(x
for one or x,y
for two real-valued samples, namely) and gives
a list of at least two values (statistic
for the output test
statistic, and p.value
for the calculated p-value). If necessary, the respective wrapper can be applied for the
user-defined function. To choose the one-sample variant of the test, sample2=NULL
should be used.
Additional parameters to the statistical test can be passed with ...
As two input samples (sample1
and sample2
, respectively), two lists of fuzzy numbers should be provided.
These values have to be the fuzzy numbers defined in the FuzzyNumbers
package (triangular, trapezoidal, etc.).
If only one-sample test is used, sample1
is related to the fuzzy statistical sample, and sample2=NULL
should
be set.
Additionally, the function that calculates the p-value for the given critical level (i.e. value of the test statistic)
should be provided using the parameter criticalValueFunction
. This function is invoked with tree parameters:
criticalValue
- the critical value, n1
- tge size of the first initial sample, n2
- the
size of the second initial sample (if necessary, otherwise n2=NA
). For convenience,
its variant for the Kolmogorov-Smirnov
two-sample test is provided (the function KSTestCriticalValue
).
To calculate the output, the averaging statistics epistemic bootstrap approach is used. Depending on the parameter
bootstrapMethod
, the standard (std
) or antithetic (anti
) method can be used. Then,
the obtained test statistics are averaged to give the respective p-value and final result.
Value
The output is given in the form of a real number (the p-value) for the selected statistical test.
References
Grzegorzewski, P., Romaniuk, M. (2022) Bootstrap Methods for Epistemic Fuzzy Data. International Journal of Applied Mathematics and Computer Science, 32(2)
Grzegorzewski, P., Romaniuk, M. (2022) Bootstrapped Kolmogorov-Smirnov Test for Epistemic Fuzzy Data. Communications in Computer and Information Science, CCIS 1602, pp. 494-507, Springer
Gagolewski, M., Caha, J. (2021) FuzzyNumbers Package: Tools to deal with fuzzy numbers in R. R package version 0.4-7, https://cran.r-project.org/web/packages=FuzzyNumbers
See Also
MultiStatisticEpistemicTest
for the epistemic bootstrap test related to multi-statistic approach,
ResamplingStatisticEpistemicTest
for the epistemic bootstrap test related to resampling statistics,
EpistemicTest
for the general epistemic bootstrap test
Other epistemic bootstrap statistical test:
EpistemicTest()
,
MultiStatisticEpistemicTest()
,
ResamplingStatisticEpistemicTest()
Examples
# seed PRNG
set.seed(1234)
# generate two independent initial fuzzy samples
list1<-SimulateSample(20,originalPD="rnorm",parOriginalPD=list(mean=0,sd=1),
incrCorePD="rexp", parIncrCorePD=list(rate=2),
suppLeftPD="runif",parSuppLeftPD=list(min=0,max=0.6),
suppRightPD="runif", parSuppRightPD=list(min=0,max=0.6),
type="trapezoidal")
list2<-SimulateSample(20,originalPD="rnorm",parOriginalPD=list(mean=0,sd=1),
incrCorePD="rexp", parIncrCorePD=list(rate=2),
suppLeftPD="runif",parSuppLeftPD=list(min=0,max=0.6),
suppRightPD="runif", parSuppRightPD=list(min=0,max=0.6),
type="trapezoidal")
# apply the Kolmogorov-Smirnov two sample test for two different samples
AverageStatisticEpistemicTest(list1$value,list2$value,cutsNumber = 30)
# and the same sample twice
AverageStatisticEpistemicTest(list1$value,list1$value,cutsNumber = 30,bootstrapMethod = "anti")