Package 'Dogoftest'

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] , Di Chang [aut]
Maintainer: Guangbao Guo <[email protected]>
License: MIT + file LICENSE
Version: 0.1
Built: 2025-02-18 11:19:07 UTC
Source: CRAN

Help Index


Perform the Cramer-von Mises Goodness-of-Fit Test for Normality

Description

Perform the Cramer-von Mises Goodness-of-Fit Test for Normality

Usage

cvmgof(x)

Arguments

x

A numeric vector containing the sample data.

Value

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.

Examples

# 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

Description

Perform the Lilliefors (Kolmogorov-Smirnov) Goodness-of-Fit Test for Normality

Usage

ksgof(x)

Arguments

x

A numeric vector containing the sample data.

Value

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.

Examples

# 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)

Calculate the Quantile of the Cramer-von Mises Goodness-of-Fit Statistic

Description

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.

Usage

qCvMgof(X, p)

Arguments

X

A numeric vector containing the sample data.

p

A numeric value representing the desired quantile probability.

Value

root

The quantile value corresponding to the given probability.

Examples

# 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)

Perform a Simple Cramer-von Mises Goodness-of-Fit Test

Description

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.

Usage

simpleCvMgof(X)

Arguments

X

A numeric vector containing the sample data.

Value

statistic

The value of the Cramer-von Mises test statistic.

pvalue

The p-value for the test.

statname

The name of the test statistic.

Examples

# 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)