Learn R Programming

hyper2 (version 2.0-0)

hyper2: Basic functions in the hyper2 package

Description

Basic functions in the hyper2 package

Usage

hyper2(L=list(), d=0, pnames)
# S3 method for hyper2
brackets(H)
# S3 method for hyper2
powers(H)
# S3 method for hyper2
pnames(H)
# S3 method for suplist
pnames(H)
size(H)
as.hyper2(L,d,pnames)
is.hyper2(H)
is_valid_hyper2(L,d,pnames)
is_constant(H)

Arguments

H

A hyper2 object

L

A list of character vectors whose elements specify the brackets of a hyper2 object

d

A vector of powers; hyper2() recycles only if d is of length 1

pnames

A character vector specifying the names of \(p_1\) through \(p_n\).

Details

These are the basic functions of the hyper2 package. Function hyper() is the low-level creator function; as.hyper2() is a bit more user-friendly and attempts to coerce its arguments into a suitable form; for example, a matrix is interpreted as rows of brackets.

Functions pnames() and pnames<-() are the accessor and setter methods for the player names. Length-zero character strings are acceptable.

Function is_valid_hyper2() tests for valid input, returning a Boolean. Note that it is perfectly acceptable to have an element of pnames that is not present in the likelihood function (this would correspond to having no information about that particular player).

Function size() returns the (nominal) length \(n\) of nonnegative vector \(p=\left(p_1,\ldots,p_n\right)\) where \(p_1+\cdots+p_n=1\). Note that function lhyper2() takes the vector \(p=\left(p_1,\ldots,p_{n-1}\right)\).

See Also

Ops.hyper2, Extract.hyper2, loglik, hyper2-package

Examples

Run this code
# NOT RUN {
o <- hyper2(list("a","b","c",c("a","b"),letters[1:3]),1:5) 

# Verify that the MLE is invariant under reordering
pnames(icons) <- rev(pnames(icons))
maxp(icons) - icons_maxp # should be small

# }

Run the code above in your browser using DataLab