HZINB_one_gamma: HGZIPS - HZINB (not assuming independence)

Description Usage Arguments Value

View source: R/HZINB.R

Description

This HZINB_one_gamma function finds hyperparameter estimates by implementing the Expectation-Maximization (EM) algorithm and hierarchical zero-inflated negative binomial model with one gamma component.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
parRangeCheck(N_ij, E_ij)

grid_HZINB(a_j, b_j, omega_j, K, L, H)

HZINB_one_gamma(
  grid_a,
  grid_b,
  grid_omega,
  init_pi_klh,
  dataset,
  iteration,
  Loglik = FALSE,
  zeroes = FALSE,
  N_star = 1
)

Arguments

N_ij

matrix of N_ij values, i - AE, j - drugs

E_ij

matrix of E_ij values, corresponding to N_ij

a_j

alpha for gamma distribution

b_j

beta for gamma distribution

omega_j

proportion

K

number of a_j in grid

L

number of b_j in grid

H

number of omega_j in grid

grid_a

alpha value grid

grid_b

beta value grid

grid_omega

omega value grid

init_pi_klh

initial probability value of all the alpha, beta, omega combinations for implementing the EM algprithm

dataset

a list of squashed/unsquashed datasets that include N_ij, E_ij and weights for each drug (j). This dataset list can be generated by the rawProcessing function in this package.

iteration

number of EM algorithm iterations to run

Loglik

whether to return the loglikelihood of each iteration or not (TRUE or FALSE)

zeroes

A logical scalar specifying if zero counts should be included.

N_star

the minimum Nij count size to be used for hyperparameter estimation. If zeroes are included in Nij vector, please set N_star = NULL

Value

parRangeCheck the estimated a_j, b_j and omega_j for each drug (j) parRangeCheck

grid_HZINB build a suitable grid of a_j, b_j, and omega_j for implementing HZINB grid_HZINB

HZINB_one_gamma a list of estimated probability of each alpha, beta, omega combination and their corresponding loglikelihood (optional)

HZINB_one_gamma


sidiwang/hgzips documentation built on Jan. 19, 2021, 4:09 p.m.