Title: | Distributed Online Goodness-of-Fit Tests for Distributed Datasets |
---|---|
Description: | Distributed Online Goodness-of-Fit Test can process the distributed datasets. The philosophy of the package is described in Guo G.(2024) <doi:10.1016/j.apm.2024.115709>. |
Authors: | Guangbao Guo [aut, cre]
|
Maintainer: | Guangbao Guo <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1 |
Built: | 2025-02-18 11:19:07 UTC |
Source: | CRAN |
Perform the Cramer-von Mises Goodness-of-Fit Test for Normality
cvmgof(x)
cvmgof(x)
x |
A numeric vector containing the sample data. |
statistic |
The value of the Cramer-von Mises test statistic. |
p.value |
The p-value for the test. |
method |
A character string describing the test. |
# Example usage: set.seed(123) x <- rnorm(100) # Generate a sample from a normal distribution result <- cvmgof(x) print(result) # Example with non-normal data: y <- rexp(100) # Generate a sample from an exponential distribution result <- cvmgof(y) print(result)
# Example usage: set.seed(123) x <- rnorm(100) # Generate a sample from a normal distribution result <- cvmgof(x) print(result) # Example with non-normal data: y <- rexp(100) # Generate a sample from an exponential distribution result <- cvmgof(y) print(result)
Perform the Lilliefors (Kolmogorov-Smirnov) Goodness-of-Fit Test for Normality
ksgof(x)
ksgof(x)
x |
A numeric vector containing the sample data. |
statistic |
The value of the Lilliefors (Kolmogorov-Smirnov) test statistic. |
p.value |
The p-value for the test. |
method |
A character string describing the test. |
# Example usage: set.seed(123) x <- rnorm(100) # Generate a sample from a normal distribution result <- ksgof(x) print(result) # Example with non-normal data: y <- rexp(100) # Generate a sample from an exponential distribution result <- ksgof(y) print(result)
# Example usage: set.seed(123) x <- rnorm(100) # Generate a sample from a normal distribution result <- ksgof(x) print(result) # Example with non-normal data: y <- rexp(100) # Generate a sample from an exponential distribution result <- ksgof(y) print(result)
This function calculates the quantile of the Cramer-von Mises goodness-of-fit statistic using the 'uniroot' function to find the root of the given function.
qCvMgof(X, p)
qCvMgof(X, p)
X |
A numeric vector containing the sample data. |
p |
A numeric value representing the desired quantile probability. |
root |
The quantile value corresponding to the given probability. |
# Example usage: set.seed(123) X <- rnorm(100) # Generate a sample from a normal distribution p <- 0.95 # Desired quantile probability result <- qCvMgof(X, p) print(result)
# Example usage: set.seed(123) X <- rnorm(100) # Generate a sample from a normal distribution p <- 0.95 # Desired quantile probability result <- qCvMgof(X, p) print(result)
This function performs a simple Cramer-von Mises goodness-of-fit test to assess whether a given sample comes from a uniform distribution. The test statistic and p-value are calculated based on the sorted sample data.
simpleCvMgof(X)
simpleCvMgof(X)
X |
A numeric vector containing the sample data. |
statistic |
The value of the Cramer-von Mises test statistic. |
pvalue |
The p-value for the test. |
statname |
The name of the test statistic. |
# Example usage: set.seed(123) X <- runif(100) # Generate a sample from a uniform distribution result <- simpleCvMgof(X) print(result) # Example with non-uniform data: Y <- rnorm(100) # Generate a sample from a normal distribution result <- simpleCvMgof(Y) print(result)
# Example usage: set.seed(123) X <- runif(100) # Generate a sample from a uniform distribution result <- simpleCvMgof(X) print(result) # Example with non-uniform data: Y <- rnorm(100) # Generate a sample from a normal distribution result <- simpleCvMgof(Y) print(result)