Description Usage Arguments Value See Also Examples
View source: R/ZINB_one_gamma.R
This ZINB_one_gamma
function finds hyperparameter estimates by implementing the Expectation-Maximization (EM) algorithm and zero-inflated negative binomial model with one gamma component. nlminb
function is used to maximize the loglikelihood function.
1 2 3 4 5 6 7 8 9 10 11 12 | ZINB_one_gamma(
alpha,
beta,
omega,
N,
E,
weight,
iteration,
Loglik = FALSE,
zeroes = FALSE,
N_star = 1
)
|
alpha |
initial shape parameter value of the gamma distribution for implementing the EM algprithm |
beta |
initial rate parameter value of the gamma distribution for implementing the EM algprithm |
omega |
initial weight for observing a true zero (according to zero-inflated poission distribution) |
N |
vector of Nij values |
E |
vector of Eij values |
weight |
set weight = rep(1, length(N)) if N and E are not squashed data, or input the weight vector corresponding to the squashed Nij vector. |
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 |
a list including the following: if Nij = 0 is included in the input dataset
theta_EM
Estimate of hyperparameters for each EM iteration
llh
logliklihood for each EM iteration (optional)
if the minimum Nij count size included in the input dataset is not 0"
alpha
Estimated alpha value
beta
Estimated beta value
omega
is not exported because the value of omega
doesn't affect the estimation of lambda
openEBGM, nlminb
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.