upsilon.gof.statistic: Upsilon Goodness-of-Fit Test Statistic

View source: R/upsilon.gof.statistic.R

upsilon.gof.statisticR Documentation

Upsilon Goodness-of-Fit Test Statistic

Description

(FOR INTERNAL USE ONLY) Calculates the Upsilon statistic for a Goodness-of-Fit (GoF) test.

Usage

upsilon.gof.statistic(x, p = rep(1/length(x), length(x)), rescale.p = TRUE)

Arguments

x

a numeric vector or one-column matrix representing observed counts.

p

a numeric vector of probabilities of the same length as x. Defaults to a uniform distribution (1/length(x)).

rescale.p

a logical scalar. If TRUE (default), p is rescaled to sum to 1. If FALSE, and p does not sum to 1, an error is raised.

Details

This statistic measures the discrepancy between observed counts and expected probabilities.

Value

A numeric value of the Upsilon Goodness-of-Fit statistic.

Examples

library("Upsilon")
counts <- c(10, 20, 30)
upsilon.gof.statistic(counts)

Upsilon documentation built on March 7, 2026, 5:07 p.m.