tab_dir: Wrappers for Dirichlet distribution over a table

tab_dirR Documentation

Wrappers for Dirichlet distribution over a table

Description

Wrappers for Dirichlet distribution over a table

Usage

dtab_dir(x, alpha, log = FALSE)

rtab_dir(n, alpha, rev = FALSE)

Arguments

x

tables object of observations

alpha

table containing parameters

n

number of samples

rev

logical: should output move through each table fastest?

Details

This function obtains the Dirichlet density over a contingency table structure. In other words, suppose that we have a matrix observation x = (x_{ij}) where \sum_{i,j} x_{i,j} = 1. Then we might choose to model the vector x as having a Dirichlet distribution, with weights \alpha_{ij}.

If alpha is a scalar in dtab_dir then it is applied to every entry in x.

Functions

  • dtab_dir(): density function

  • rtab_dir(): sampling function


rje42/contingency documentation built on Sept. 9, 2024, 6:32 p.m.