dirch_from_allocations: Given a vector of different categories in 1...n and a prior,...

View source: R/RcppExports.R

dirch_from_allocationsR Documentation

Given a vector of different categories in 1...n and a prior, simulate a Dirichlet random vector

Description

Takes a vector of collection indices to which individuals (vector elements) were assigned, and returns a Dirichlet random variable generated by adding the prior to the sum of each collection's occurrences, and simulating an alpha from a gamma distribution with this shape parameter.

Usage

dirch_from_allocations(C, lambda)

Arguments

C

a vector giving different categories of individual (not counts of categories - untabulated)

lambda

priors for the categories

Details

The categories are labeled in C from 1 up to n. n is the length of lambda, which is a vector of priors. Note that all elements of lambda must be strictly greater than 0.


benmoran11/rubias documentation built on Feb. 1, 2024, 10:52 p.m.