table_data: table_data

View source: R/table_data.R

table_dataR Documentation

table_data

Description

Creates a frequency table where all entries can be written as 2^{p_{ij}} 5^{q_{ij}}, it holds that p_{ij}<m2 and q_{ij}<m5. If the algorithm does not find a solutio then an error is thrown. Try to increase unit to 20, 50, 100 and so on. Once a table is found the table is normalized by dividing all entries by a number such that the entries are still integer. Finally a multiplicator of the form 2^p 5^5 is randomly choosen such that the sum of the entries is less equal n.

Usage

table_data(
  nrow,
  ncol,
  unit = 10,
  maxit = 1000,
  n = 100,
  m2 = ceiling(log(n)/log(2)),
  m5 = ceiling(log(n)/log(5))
)

Arguments

nrow

integer: number of rows

ncol

integer: number of columns

unit

integer: reciprocal of smallest non-zero probability (default: 10)

maxit

integer: maximal number of iterations (default: 1000)

n

integer: maximal sum of table entries (default: 100)

m2

integer: maximal power of two used on normalized table (default: ceiling(log(n)/log(2)))

m5

integer: maximal power of five used on normalized table (default: ceiling(log(n)/log(5)))

Value

a frequency table where all entries can be written as 2^{p_{ij}} 5^{q_{ij}}

Examples

tab22 <- table(2, 2)
tab22
divisor_25(tab22)
nom.cc(tab22)         # should be zero
#
table(3, 2)
table(4, 2)

sigbertklinke/exams2moodle documentation built on July 6, 2023, 3:26 p.m.