Learn R Programming

xactonomial (version 1.0.3)

calc_multinom_probs: Calculate multinomial probabilities

Description

Calculate multinomial probabilities

Usage

calc_multinom_probs(sar, logt, logc, d, n, nt)

Value

A vector of probabilities

Arguments

sar

The unrolled matrix containing the portion of the sample space to sum over

logt

The vector of candidate theta values, as sampled from the null space

logc

The vector of log multinomial coefficients see log_multinom_coef

d

The total dimension, sum(d_j)

n

The sample size

nt

The number of candidate theta values

Examples

Run this code
sspace_3_5 <- sspace_multinom(3, 5)
calc_multinom_probs(sspace_3_5, sample_unit_simplexn(3, 10),
  apply(matrix(sspace_3_5, ncol = 3, byrow = TRUE), 1, log_multinom_coef, sumx = 5), 3, 5, 10)

Run the code above in your browser using DataLab