ooom | R Documentation |
Uses Taylor's theorem to give one over one minus a multipol
ooom(n, a, maxorder=NULL)
n |
The order of the approximation; see details |
a |
A multipol |
maxorder |
A vector of integers giving the maximum order as per
|
The motivation for this function is the formal power series
(1-x)^{-1}=1+x+x^2+\ldots
. The way to
think about it is to observe that
(1+x+x^2+\ldots+x^n)(1-x)=1-x^{n-1}
,
even if x
is a multivariate polynomial (one needs only power
associativity and a distributivity law, so this works for
polynomials). The right hand side is 1
if we neglect powers of
x
greater than the n
-th, so the two terms on the left hand
side are multiplicative inverses of one another.
Argument n
specifies how many terms of the series to take.
The function uses an efficient array method when x
has only a single
non-zero entry. In other cases, a variant of Horner's method is
used.
Robin K. S. Hankin
I. J. Good 1976. “On the application of symmetric Dirichlet distributions and their mixtures to contingency tables”. The Annals of Statistics, volume 4, number 6, pp1159-1189; equation 5.6, p1166
taylor
ooom(4,homog(3,1))
# How many 2x2 contingency tables of nonnegative integers with rowsums =
# c(2,2) and colsums = c(2,2) are there? Good gives:
(
ooom(2,lone(4,c(1,3))) *
ooom(2,lone(4,c(1,4))) *
ooom(2,lone(4,c(2,3))) *
ooom(2,lone(4,c(2,4)))
)[2,2,2,2]
# easier to use the aylmer package:
## Not run:
library(aylmer)
no.of.boards(matrix(1,2,2))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.