suffstats: Sufficient statistics for the multiplicative multinomial

suffstatsR Documentation

Sufficient statistics for the multiplicative multinomial

Description

\loadmathjax

Calculate, manipulate, and display sufficient statistics of the multiplicative multinomial. Functionality for analysing datasets, and distributions specified by their parameters is given; summary and print methods are also documented here.

Usage

suffstats(y, n = NULL)
expected_suffstats(L,Y)
## S3 method for class 'suffstats'
print(x, ...)
## S3 method for class 'suffstats'
summary(object, ...)
## S3 method for class 'summary.suffstats'
print(x, ...)

Arguments

y,n

In function suffstats(), argument y is a matrix with each row being a possible observation and n is counts of observations corresponding to rows of y with default NULL interpreted as each row of y being observed once. If y is an object of class gunter, this is interpreted sensibly

L,Y

In function expected_suffstats(), argument L is an object of class Lindsey [typically returned by function Lindsey()], and Y is the known constant sum (ie the rowSums() of the observations)

x, object

An object of class suffstats or summary.suffstats, to be printed or summarized

...

Further arguments to the print or summary methods. Currently ignored

Details

Function suffstats() returns a list comprising a set of sufficient statistics for the observations y,[n].

This function requires that the rowsums of y are all identical.

Value

Function suffstats() returns a list of four components:

Y

Rowsums of y

nobs

Number of observations

row_sums

Column sums of y, counted with multiplicity

cross_prods

Matrix of summed squares

Function summary.suffstats() provides a summary of a suffstats object that is a list with two elements: row_sums and cross_prods, normalized with nobs and Y so that the values are comparable with that returned by expected_suffstats(). In particular, the sum of row_sums is the known sum \mjseqny.

Author(s)

Robin Hankin and P. M. E. Altham

Examples

data(voting)
suffstats(voting, voting_tally)

data(wilson)
wilson <- gunter(non_met)
suffstats(wilson)

L <- Lindsey(wilson)

expected_suffstats(L,5)
summary(suffstats(wilson))  ## matches.

summary(suffstats(rMM(10,5,L))) # should be close.





MM documentation built on Aug. 23, 2023, 1:08 a.m.