centcosums-class: centcosums Class.

centcosums-classR Documentation

centcosums Class.

Description

An S4 class to store (centered) cosums of data, and to support operations on the same. A cosum is the sum of products of different elements of the vector input.

Usage

## S4 method for signature 'centcosums'
initialize(.Object, cosums, order = NA_real_)

centcosums(cosums, order = NULL)

Arguments

.Object

a centcosums object, or proto-object.

cosums

the output of cent_cosums, say.

order

the order, defaulting to 2.

Details

A centcosums object contains a multidimensional array (now only 2-dimensional), as output by cent_cosums.

Value

An object of class centcosums.

Slots

cosums

a multidimensional array of the cosums. might be the output of cent_cosums, for example.

order

the maximum order. ignored for now. only a value of 2 is understood for now.

Note

The moment computations provided by fromo are numerically robust, but will often not provide the same results as the 'standard' implementations, due to differences in roundoff. We make every attempt to balance speed and robustness. User assumes all risk from using the fromo package.

Author(s)

Steven E. Pav shabbychef@gmail.com

References

Terriberry, T. "Computing Higher-Order Moments Online." https://web.archive.org/web/20140423031833/http://people.xiph.org/~tterribe/notes/homs.html

J. Bennett, et. al., "Numerically Stable, Single-Pass, Parallel Statistics Algorithms," Proceedings of IEEE International Conference on Cluster Computing, 2009. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1109/CLUSTR.2009.5289161")}

Cook, J. D. "Accurately computing running variance." https://www.johndcook.com/standard_deviation/

Cook, J. D. "Comparing three methods of computing standard deviation." https://www.johndcook.com/blog/2008/09/26/comparing-three-methods-of-computing-standard-deviation/

See Also

cent_cosums

Examples

set.seed(123)
x <- matrix(rnorm(100*3),ncol=3)
obj <- new("centcosums",cosums=cent_cosums(x,max_order=2),order=2)
# equivalently
obj2 <- centcosums(cent_cosums(x, max_order=2),order=2)


fromo documentation built on Nov. 5, 2026, 9:06 a.m.