predMixBinom: Predicted probability from learned binomial mixture model

View source: R/binomial_models.R

predMixBinomR Documentation

Predicted probability from learned binomial mixture model

Description

Predicted probability from learned binomial mixture model

Usage

predMixBinom(k, n, p, psi)

Arguments

k

A vector of integers. number of success

n

A vector of integers. number of trials

p

a vector of binomial success probabilities

psi

A float between 0 and 1. fraction of each component

Value

A list with two components: prob, a matrix representing the probability of each of the passed values coming from each component of the mixture and logLik, the total log-likelihood of the new samples.

Examples

n1 <- array(sample(1:30, 50, replace = TRUE))
n2 <- array(sample(1:30, 200, replace = TRUE))
k1 <- apply(n1, 1, rbinom, n = 1, p = 0.5)
k2 <- apply(n2, 1, rbinom, n = 1, p = 0.01)
RV <- mixBinom(c(k1, k2), c(n1, n2))
RV_pred <- predMixBinom(3, 10, RV$p, RV$psi)

davismcc/cardelino documentation built on Nov. 19, 2022, 2:44 a.m.